Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 13, 2024 via pnpm

jsonc-parser 3.2.0

Scanner and parser for JSON with comments.
Package summary
Share
0
issues
1
license
1
MIT
Package created
18 Apr 2016
Version published
30 Aug 2022
Maintainers
7
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
jsonc-parser@3.2.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of jsonc-parser 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does jsonc-parser do?

The jsonc-parser is a scanner and parser for JSON enriched with JavaScript style comments, or JSONC. Represented as an npm package, this tool can process standard JSON as well as JSONC in a structured and organized way. It tokenizes input strings into tokens and offsets via its scanner utility, while the visit function implements a 'SAX' style parser initiating callbacks for encountered properties and values. It evaluates JavaScript objects represented by JSON strings in a fault tolerant manner, ensuring effective processing and handling done through its parse function. The package also includes various other useful utilities such as format, modify, and applyEdits.

How do you use jsonc-parser?

To use jsonc-parser, start by installing it via npm in your project with the command npm install --save jsonc-parser. The functionality of the package can then be exploited by calling the relevant functions provided by the API. For instance, to parse JSONC text, the parse function can be used in the following way:

var jsonc = require('jsonc-parser');
var jsoncText = `{
    // this is a comment
    "key": "value"
}`;
var parsedObject = jsonc.parse(jsoncText); // parsedObject will be { key: 'value' }

Additional functionality can be utilized similarly. Errors can be checked with the parse function if required:

var jsonc = require('jsonc-parser');
var jsoncText = `{
    // this is a comment
    "key: value
}`;
var errors = [];
var parsedObject = jsonc.parse(jsoncText, errors); // errors will contain the parse error details

Where are the jsonc-parser docs?

The detailed documentation for the jsonc-parser is included within the package's README file available on its GitHub repository at https://github.com/microsoft/node-jsonc-parser. This documentation outlines all the functions, methods, and options available, such as how the scanner works, how the parser can be used, and how each utility function operates. It includes detailed code examples for each function to help users efficiently implement this npm package in their projects.