Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    jsonmatterpublic

    README

    NPM version Build Status Coverage Status

    jsonmatter is a JSON formatter tool by stream.

    INSTALL

    $ npm install jsonmatter -g

    USAGE

    Node:

    const tokenizer = require('json-tokenizer');
    const jsonmatter = require('jsonmatter');
     
    const indent = '\t';
     
    fs.createReadStream(path.resolve(__dirname, './source.json'))
      .pipe(tokenizer())
      .pipe(jsonmatter(indent))
      .pipe(process.stdout);

    cli:

    $ cat tmp.json | jsonmatter --indent 4

    Vim:

    autocmd FileType json setlocal formatprg=jsonmatter
    :help gq
    :help formatprg
    :help formatexpr

    OPTIONS

    -i, --indent

    default indent is 2 spaces, you can also use ' ' or '\t'.

    install

    npm i jsonmatter

    Downloadsweekly downloads

    19

    version

    2.1.1

    license

    MIT

    homepage

    github.com

    last publish

    collaborators

    • avatar