GitHub - microsoft/node-jsonc-parser: Scanner and parser for JSON with comments. (original) (raw)

jsonc-parser

Scanner and parser for JSON with comments.

npm Package NPM Downloads Build Status License: MIT

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.

Installation

npm install --save jsonc-parser

API

Scanner:

/**

/**

Parser:

export interface ParseOptions { disallowComments?: boolean; allowTrailingComma?: boolean; allowEmptyContent?: boolean; } /**

/**

/**

}

/**

export declare type NodeType = "object" | "array" | "property" | "string" | "number" | "boolean" | "null"; export interface Node { type: NodeType; value?: any; offset: number; length: number; colonOffset?: number; parent?: Node; children?: Node[]; }

Utilities:

/**

/**

/**

/**

/**

/**

/**

/**

/**

/**

/**

/**

/**

/**

/**

License

(MIT License)

Copyright 2018, Microsoft