Skip to content

CESON (Commented ECMAScript Object Notation) syntax description and parser

Notifications You must be signed in to change notification settings

mk-pmb/ceson-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CESON: Commented ECMAScript Object Notation

Yet another JSON derivative, aimed to be easy to use for humans as well as for low-level tools.

✨ 📖 ✨ spec ✨ 📖 ✨ example ✨ 📖 ✨

Main features:

  • True subset of ECMAScript.
  • Parser-friendly (block and line) comments.
  • Comma after last value in data containers. (optional)
  • Guaranteed support for UTF-8 BOM.

Related projects:

API

For examples, see test/felidae.js.

.stringify(data)

Return a CESON representation of data as a string.

.parse(ceson[, opts])

Return the data represented by the string ceson if it can be parsed, or undefined in case of a SyntaxError. Other errors are re-thrown.

You can modify the behavior by providing a config object opts. The supported keys are:

  • synErr, othErr: Modify error handling. Documented at module json-parse-pmb since that's used under the hood.

.parseFile(filename, callback)

Try to parse CESON text file filename, then report to callback.

.parseFile(fileOpts, callback)

(no description yet)

.parseCallbackData(readErr, data, callback)

(no description yet)

License

ISC

About

CESON (Commented ECMAScript Object Notation) syntax description and parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published