hjson-config
v1.3.0
Published
A file read/write/watch/setProperty wrapper around hjson
Downloads
181
Readme
hjson-config
A file read/write/watch/setProperty wrapper around hjson.
Uses promises. Persists comments
Install
npm install hjson-config
Usage
constructor
const Config = require('hjson-config')
const serverConfig = new Config('./serverconfig.hjson')
get
let servers = await serverConfig.get()
set
servers.ip = '192.168.0.1'
await serverConfig.set(servers)
setProperty
await serverConfig.setProperty('.ip', '192.168.0.1)
watch
serverConfig.watch(newConfig => {
})