ClaudioCorridore / json-vars

Enables the use of variables in JSON and JSON-like configuration files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json-vars

Build Status

Enables the use of variables in JSON and JSON-like configuration files

Example usage

const jVars = require('json-vars')

const solver = new jVars.Solver()

const config = {
  foo: {
    bar: '${env:BAR|default("bar")}'
  },
  baz: 'foo.bar is equal to ${self:foo.bar}'
}

solver.resolve(config).then( res => console.log(res) )
// Output => { foo: { bar: 'bar' }, baz: 'foo.bar is equal to bar' }

About

Enables the use of variables in JSON and JSON-like configuration files

License:GNU General Public License v3.0


Languages

Language:TypeScript 100.0%