json-ast-comments
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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);

Package Sidebar

Install

npm i json-ast-comments

Weekly Downloads

335

Version

1.1.1

License

ISC

Unpacked Size

54.1 kB

Total Files

9

Last publish

Collaborators

  • 2betop