json-parse-with-comments
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

json-parse-with-comments

Parse JSON with comments

Usage:

import parse from 'json-parse-with-comments'

const source = `
  { 
    "foo": true, // Line comments
    /*
      Block comments
    */
    "bar": 42
  }
`;

const res = parse(source)
console.log(res)

// res:
{
  foo: true,
  bar: 42
}

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    3

Package Sidebar

Install

npm i json-parse-with-comments

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

4.53 kB

Total Files

7

Last publish

Collaborators

  • nk12