package
A simple JSON parser that supports comments and optional trailing commas.
npm install jsonc-simple-parserGitHub-flavored package documentation.
Across all versions, last 30 days.
584,268 in 30 days
Runtime metadata.
Tagged topics.
A simple JSON parser that supports comments and optional trailing commas.
JSON.parse.npm install --save jsonc-simple-parserimport JSONC from 'jsonc-simple-parser';
const source = `
{ // This is an example
"foo": 123,
/* TRAILING COMMAS */
"bar": [1, 2, 3,],
}
`;
const result = {
foo: 123,
bar: [1, 2, 3]
};
JSONC.parse ( source ); // => returns an object that's deeply equal to `result`
JSONC.stringify ( result ); // => same as calling `JSON.stringify`MIT © Fabio Spampinato
Estimated unpacked size across 2 packages.
485.6 kB
Includes dependencies.