JSPM

jsonc-lite

1.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q20472F
    • License MIT

    A tiny JSONC parser for Node.js that strips comments and feeds into JSON.parse()

    Package Exports

    • jsonc-lite
    • jsonc-lite/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jsonc-lite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    jsonc-lite

    A tiny JSONC parser that removes // and /* */ comments and feeds clean JSON into JSON.parse().

    Usage

    const fs = require('fs');
    const JSONC = require('jsonc-lite');
    
    const raw = fs.readFileSync('./example/test.jsonc', 'utf-8');
    const data = JSONC.parse(raw);
    console.log(data);