From 20e00efd6cf1a80385922786effac49838cbab1b Mon Sep 17 00:00:00 2001 From: "Indospace.io" Date: Thu, 16 May 2019 14:05:20 -0700 Subject: [PATCH] Change require fs (#313) what is there now is bad, everyone will think they need the fs library, when they only need it for the last example. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e5c5c7c..7157bd0 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,7 @@ Hierarchical node.js configuration with files, environment variables, command-li Using nconf is easy; it is designed to be a simple key-value store with support for both local and remote storage. Keys are namespaced and delimited by `:`. Let's dive right into sample usage: ``` js - var fs = require('fs'), - nconf = require('nconf'); + var nconf = require('nconf'); // // Setup nconf to use (in-order): @@ -39,7 +38,7 @@ Using nconf is easy; it is designed to be a simple key-value store with support // Save the configuration object to disk // nconf.save(function (err) { - fs.readFile('path/to/your/config.json', function (err, data) { + require('fs').readFile('path/to/your/config.json', function (err, data) { console.dir(JSON.parse(data.toString())) }); });