json-config-file
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

json-config-file

Javascript:

// Load the module
const jcf = require('json-config-file');

// Load the config file
const config = new jcf('path/to/config.json');

// Access properties like this
console.log(config.data.something1);
console.log(config.data.something2);

// Set properties like this
config.data.something1 = 'aaaa';
config.data.something2 = 'bbbb';

// Save your changes. This will overwrite your old config.
config.save(); // true / false

If you're working with TypeScript:

import * as jcf from 'json-config-file';

Package Sidebar

Install

npm i json-config-file

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

3.35 kB

Total Files

7

Last publish

Collaborators

  • olback