phadej / relaxed-json

Relaxed JSON is strict superset JSON, relaxing strictness of vanilla JSON
http://oleg.fi/relaxed-json/
Other
80 stars 8 forks source link

Relaxed JSON

Build Status NPM version Dependency Status devDependency Status Code Climate

Are you frustrated that you cannot add comments into your configuration JSON Relaxed JSON is a simple solution. Small JavaScript library with only one exposed function RJSON.transform(text : string) : string (and few convenient helpers).

Relaxed JSON (modified BSD license) is a strict superset of JSON, relaxing strictness of vanilla JSON. Valid, vanilla JSON will not be changed by RJSON.transform. But there are few additional features helping writing JSON by hand.

API

Executable

There is rjson executable

$ sudo npm install -g relaxed-json

$ rjson relaxed-json.js
Error on line 27: Unexpected character: (
(function () {

% rjson package.json
{
  "name": "relaxed-json",
  "description": "Relaxed JSON is strict superset JSON, relaxing strictness of valilla JSON",

rjson is similar to python -mjson.tool.

Changelog

Related projects

For truly human writable configuration consider using YAML.