Socket
Book a DemoInstallSign in
Socket

json-stream-to-object

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-stream-to-object

Parse a JSON stream into an object

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

json-stream-to-object stability

npm version build status downloads js-standard-style

Parse a JSON stream into an object.

Usage

var toObject = require('json-stream-to-object')
var http = require('http')

http.createServer(function (req, res) {
  toObject(req, function (err, obj) {
    if (err) throw err
    console.log('json parsed', obj)
  })
}).listen(8080)

API

toObject(stream, [opts], cb(err, object))

Parse a stream of JSON to an object. Opts can be:

  • opts.limit: set a max size limit for the incoming data. Useful to prevent services getting DDoSed

License

MIT

Keywords

stream

FAQs

Package last updated on 12 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts