Package Exports
- jsonc-parse
Readme
jsonc-parse
A lightweight JSON with Comments parser.
Install
npm install jsonc-parse
Usage
import { parseJSONC, parseJSONCFile } from "jsonc-parse";
// From file
const jsonCFile = await parseJSONCFile("./config.jsonc");
// From string
const jsonC = await parseJSONC(`
{
"bar": "foo",
// This is a comment.
"foo": /* This is also a comment */ "bar",
}`);