@cthru/json-config
v1.0.3
Published
mount config files and watch them update themselves
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-configUsage
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 changescallbackfunction to call when a change is detectedindentSize [4]indent size to use during savedebounceTimeout [500]dont save more fequently than once everydebounceTimeoutms
License
MIT
