@cthru/json-config
v1.0.3
Published
mount config files and watch them update themselves
Downloads
4
Readme
Json-Config
Simple tool for mounting a json config file and watching properties for change. When a property changes or is added or removed, the config file will be saved with the new config.
Installation
npm install @ctrhu/json-config
Usage
const mountConfig = require('@cthru/json-config').mountConfig
const config = mountConfig('./package.json', { create: false })
And you're good to go!
Options
create [false]
create the file if it does not existautoSave [true],
keep the config file in sync with changescallback
function to call when a change is detectedindentSize [4]
indent size to use during savedebounceTimeout [500]
dont save more fequently than once everydebounceTimeout
ms
License
MIT