JSPM

json-parse-with-comments

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q30461F
  • License MIT

Parse JSON with comments

Package Exports

  • json-parse-with-comments
  • json-parse-with-comments/package.json

Readme

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