void-jsonc
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.1 • Public • Published

    void-jsonc

    Standalone Javascript JSONC/CSON parser.

    how does it work?

    void-jsonc remove comments from the jsonc data and use a json parser to turn it into a JSON Object.
    void-jsonc does not let you write jsonc files.

    how to use it?

    // or const { parse } = require('void-jsonc');
    const JSONC = require('void-jsonc');
    
    JSONC.parse('path/to/test.jsonc');

    can i use a different json parser?

    absolutely! you can make this use any parser

    // either have a function like this or use the parser directly
    let parser = (jsonString) => {
        return MyParser(jsonString)
    }
    // use `JSON.parse` by default
    JSONC.parse('path/to/test.jsonc');
    // use a custom function to parse json
    JSONC.parse('path/to/test.jsonc', parser);
    // use your parser directly
    JSONC.parse('path/to/test.jsonc', MyParser);

    Install

    npm i void-jsonc

    DownloadsWeekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    3.37 kB

    Total Files

    7

    Last publish

    Collaborators

    • mrthomas20121