Make your json config support comments.
Installation
$ npm install json-comments
Syntax:
// require `json-comments` in your main module only once;
Examples:
config.json
// this is host "host" : "localhost" "port" : 3000 //port "url" : "https://github.com/numbcoder" /* url */ /* * comments support for json */ "username": "abc"
app.js
;var config = ; console;// ...
Parse JSON string
var JSONC = ;var fs = ; var content = fs;// parse JSON Stringvar config = JSONC; console;
Minify the JSON string
var JSONC = ;var fs = ; var content = fs; // remove comments and spaces from JSON Stringvar JsonStr = JSONC;
License
MIT