hjsonify
v0.2.0
Published
A Browserify transform for hjson files.
Downloads
8
Maintainers
Readme
hjsonify
hjsonify is a browserify transform to require Human JSON (Hjson) files.
Require Hjson files in your files just like you would a JSON file.
Install
$ npm install hjsonify
Usage
Programatic use with Browserify:
var b = require('browserify')(),
fs = require('fs'),
hjsonify = require('hjsonify');
b.add('./app.js');
b.transform(hjsonify);
b.bundle().pipe(fs.createWriteStream('./bundle.js'));
CLI use with Browserify:
$ browserify -t hjsonify app.js > bundle.js
Example
config.hjson:
{
port: 1000 //defaults to 80
}
app.js:
var config = require('config.hjson');
console.log(config.port);
// => 1000
$ browserify -t hjsonify app.js | node
1000