Skip to content

mkantor/node-json5-parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json5-parser

Scanner and parser for JSON5 based on Microsoft's node-jsonc-parser.

WARNING: This package is experimental and not recommended for general use until v1.0.0.

Why?

This node module provides a scanner and fault tolerant parser that can process JSON5.

  • the scanner tokenizes the input string into tokens and token offsets
  • the visit function implements a 'SAX' style parser with callbacks for the encountered properties and values.
  • the parseTree function computes a hierarchical DOM with offsets representing the encountered properties and values.
  • the parse function evaluates the JavaScript object represented by JSON5 string in a fault tolerant fashion.
  • the getLocation API returns a location object that describes the property or value located at a given offset in a JSON5 document.
  • the findNodeAtLocation API finds the node at a given location path in a JSON5 DOM.

About

Scanner and parser for JSON5.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 97.6%
  • JavaScript 2.4%