json-ast-comments
v1.1.1
Published
parser json string (with comments) into json, stringify json to string(with comments)
Downloads
1,766
Maintainers
Readme
json-ast-comments
parser json string (with comments) into json, stringify json to string(with comments)
usage
npm i json-ast-comments;
import { parse, stringify, parser } from "json-ast-comments";
const source = `
{
// this is comments
"a": 123
}
`;
const obj = parse(source);
console.log(obj);
console.log(stringify(obj));
const ast = parser.parse(source);
console.log(ast);