jstransformer-hjson
v0.0.1
Published
Hjson support for JSTransformers.
Downloads
5
Readme
jstransformer-hjson
Hjson support for JSTransformers.
Installation
npm install jstransformer-hjson
API
var hjson = require('jstransformer')(require('jstransformer-hjson'));
var text = `
{
// comments
hi: true
// no commas
test: this is a test
// no quotes
}
`
hjson.render(text).body
//=> '{"hi":"true","test":"this is a test"}'
// `formatted` is a special option that makes the output indented
hjson.render(text, {formatted: true}).body
//=> {
//=> "hi": "true",
//=> "test": "this is a test"
//=> }
// Options other than `formatted` are passed to hjson
// See https://github.com/hjson/hjson-js#hjsonparsetext-options
License
MIT