Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

node-jsonc-parser

> 编程语言
Open source

Scanner and parser for JSON with comments.

751 stars0 likes1 views
WebsiteGitHub

About

Scanner and parser for JSON with comments.

jsonc-parser

Scanner and parser for JSON with comments. Why?

JSONC is JSON with JavaScript style comments. This node module provides a scanner and fault tolerant parser that can process JSONC but is also useful for standard JSON.

  • the scanner tokenizes the input string into tokens and token offsets
  • the visit function implements a 'SAX' style parser with callbacks for the encountered properties and values.
  • the parseTree function computes a hierarchical DOM with offsets representing the encountered properties and values.
  • the parse function evaluates the JavaScript object represented by JSON string in a fault tolerant fashion.
  • the getLocation API returns a location object that describes the property or value located at a given offset in a JSON document.
  • the findNodeAtLocation API finds the node at a given location path in a JSON DOM.
  • the format API computes edits to format a JSON document.
  • the modify API computes edits to insert, remove or replace a property or value in a JSON document.
  • the applyEdits API applies edits to a document.

Installation

jsonc-parser is published as an ESM-only package.

bash
npm install --save jsonc-parser

API

Scanner:

…

Parser:

…

Utilities:

…

License

(MIT License)

Copyright 2018, Microsoft

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言