letsconfig

letsConfig

letsConfig is a class for working with a configuration file.

Table of Contents

letsConfig

Getting started

Node.js

Install letsconfig using npm:

npm install letsconfig

And import it as a CommonJS module:

const letsConfig = require('letsconfig');

Examples

Here are some examples of how to use letsConfig.

Constructor

The constructor method takes the following optional parameters:

let config = new letsConfig({
		host: 'localhost',
		port: 8000
	},
	'/home/username/sites/somedomain/',
	'configuration.json');
console.log(config.host);
console.log(config.port);

// or

let conf = new letsConfig();
console.log(conf);

writeConfigFile

The writeConfigFile function writes the current class data to a JSON configuration file.

config.writeConfigFile();

License

GNU Lesser General Public License (3.0 or any later version). Please take a look at the LICENSE file for more information.