Skip to content
/ jsonext Public

A subset of JSON with support for comments and value transformations.

Notifications You must be signed in to change notification settings

rlacd/jsonext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSONext

Copyright (C) techspider 2019. Licensed under GNU GPLv3.

What is JSONext?

JSONext (which stands for JSON extended) is a subset of JSON offering support for comments and value transformations. It is currently available in JavaScript and can be used in the browser or as a NodeJS module.

Getting started

Getting started with JSONext is very simple. To install JSONext, clone the repository and reference the JavaScript file using either require('./jsonext') (NodeJS) or <script src="jsonext.js"></script> (Browser). To verify the installation, you may check for the existence of the JSONext object (Browser) or the module exports (NodeJS).

The syntax for JSONext is identical to the syntax of functions in the JSON object. It defines standard functions such as stringify() and parse() with the same arguments, to ensure maximum compatibility.

Replacing the JSON object with JSONext

In most cases, it is recommended to keep the JSON object as is. In some cases, however, the developer may wish to use the JSONext format as the default behavior for JSON.

Replacing JSON object on browser (strict mode must be disabled)

delete window.JSON;
window.JSON = JSONext;

Replacing JSON object in NodeJS

delete global.JSON;
var global.JSON = JSONext;

Writing JSONext

Refer to file examples/example-files/full-feature-example.jsone for an example of JSONext syntax.

About

A subset of JSON with support for comments and value transformations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published