开发者社区> 镜像站> NPM> format-json-stream
format-json-stream
Formats a JSON stream to make it more readable by adding proper indentation and newlines.
Last updated 7 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install format-json-stream 
SYNC missed versions from official npm registry.

format-json-stream build status

browser support

Formats a JSON stream to make it more readable by adding proper indentation and newlines.

As Commandline Tool

# default indent 2
curl https://raw.github.com/thlorenz/format-json-stream/master/package.json | format-json-stream | head -n 20

# indent 8
curl https://raw.github.com/thlorenz/format-json-stream/master/package.json | format-json-stream --indent 8 | head -n 20

# indent 4
curl https://raw.github.com/thlorenz/format-json-stream/master/package.json | format-json-stream -i 4 | head -n 20

As Library

var format = require('format-json-stream')

// formats with indent 2
process.stdin.pipe(format()).pipe(process.stdout);

// formats with indent 4
process.stdin.pipe(format(4)).pipe(process.stdout);

Installation

npm install format-json-stream

# or as cli tool

npm install -g format-json-stream

Current Tags

  • 0.1.5                                ...           latest (7 years ago)

6 Versions

  • 0.1.5                                ...           7 years ago
  • 0.1.4                                ...           7 years ago
  • 0.1.3                                ...           7 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (3)