json-comments
v0.2.1
Published
Make your json config file support comments.
Downloads
506
Readme
json-comments
Comments support for json with require.
Installation
$ npm install json-comments
Syntax:
// require `json-comments` in your main module only once
require('json-comments');
Examples:
config.json
{
// this is host
"host" : "localhost",
"port" : 3000, //port
/*
* comments support for json
*/
"username": "abc"
}
app.js
require('json-comments');
var config = require('./config');
console.log(config);
// ...
License
MIT