Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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

Programmatic 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);
$ browserify -t hjsonify app.js | node
1000

About

A Browserify transform for hjson files.

Resources

License

Packages

No packages published
You can’t perform that action at this time.