Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 340 Bytes

README.md

File metadata and controls

31 lines (24 loc) · 340 Bytes

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