Necessarily Precedes Mischief

    hjsonify

    0.2.0 • Public • Published

    NPM version shield License shield

    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

    Install

    npm i hjsonify

    DownloadsWeekly Downloads

    1

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • dannyfritz