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

Package Sidebar

Install

npm i json-parse-with-comments

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.53 kB

Total Files

7

Last publish

Collaborators

  • nk12