https://github.com/olback/json-config-file
Load and save to a json config file.
https://github.com/olback/json-config-file
Last synced: 6 months ago
JSON representation
Load and save to a json config file.
- Host: GitHub
- URL: https://github.com/olback/json-config-file
- Owner: olback
- Created: 2018-08-13T19:28:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-13T19:41:45.000Z (over 7 years ago)
- Last Synced: 2025-09-20T14:26:30.959Z (7 months ago)
- Language: TypeScript
- Homepage: https://npmjs.com/package/json-config-file
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# json-config-file
Javascript:
```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:
```typescript
import * as jcf from 'json-config-file';
```