🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

json-ast-comments

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-ast-comments

parser json string (with comments) into json, stringify json to string(with comments)

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

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

Keywords

json

FAQs

Package last updated on 21 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts