0.0.1 • Published 7 years ago

jstransformer-hjson v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

jstransformer-hjson

Hjson support for JSTransformers.

Build Status Coverage Status Dependency Status NPM version

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