hjson-config

1.3.0 • Public • Published

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 => {
    
})

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i hjson-config

    Weekly Downloads

    41

    Version

    1.3.0

    License

    ISC

    Unpacked Size

    6.79 kB

    Total Files

    4

    Last publish

    Collaborators

    • martinmuzatko