{"name":"streaming-json-stringify","description":"Streaming JSON.stringify()","version":"1.0.1","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"repository":{"type":"git","url":"https://github.com/stream-utils/streaming-json-stringify"},"license":"MIT","devDependencies":{"mocha":"2","istanbul":"0","cat-stream":"*"},"scripts":{"test":"mocha --reporter spec","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"},"keywords":["stream","json","stringify"],"files":["index.js"],"gitHead":"1111b1e7a26efe8f3885b3e2bc2ff938d47932d6","bugs":{"url":"https://github.com/stream-utils/streaming-json-stringify/issues"},"homepage":"https://github.com/stream-utils/streaming-json-stringify","_id":"streaming-json-stringify@1.0.1","_shasum":"6b7ab43d7766035170c9a2a96c6cc143764a4ebd","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.11.14","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"dougwilson","email":"doug@somethingdoug.com"}],"dist":{"shasum":"6b7ab43d7766035170c9a2a96c6cc143764a4ebd","tarball":"http://registry-npm.ywwl.com/streaming-json-stringify/download/streaming-json-stringify-1.0.1.tgz","integrity":"sha512-dSKMNM9sG2v3aCWDiuO5anWApYVIYz2BBIS+qWK6MqyEjhcRLU8sk0pV3W2sIGv3OCVLddqJPa/ksImEN9LSZw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJ8WtT+gB6qWp1jh/qhQGzqoOJI4+wstjoskgSa7w5ywIhAJZYo7zA/aONa/ww7o5pXDY7RpYeSXEsNq38IoVUqg2t"}],"size":2570,"noattachment":false,"key":"/streaming-json-stringify/-/streaming-json-stringify-1.0.1.tgz"},"directories":{},"readme":"# Streaming JSON.stringify()\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nSimilar to [JSONStream.stringify()](https://github.com/dominictarr/JSONStream#jsonstreamstringifyopen-sep-close) except it is, by default, a binary stream, and it is a streams2 implementation.\n\n## Example\n\nThe main use case for this is to stream a database query to a web client.\nThis is meant to be used only with arrays, not objects.\n\n```js\nvar Stringify = require('streaming-json-stringify')\n\napp.get('/things', function (req, res, next) {\n  res.setHeader('Content-Type', 'application/json; charset=utf-8')\n\n  db.things.find()\n  .stream()\n  .pipe(Stringify())\n  .pipe(res)\n})\n```\n\nwill yield something like\n\n```json\n[\n{\"_id\":\"123412341234123412341234\"}\n,\n{\"_id\":\"123412341234123412341234\"}\n]\n\n```\n\n## Separators\n\n* The stream always starts with `'[\\n'`.\n* Documents are separated by `'\\n,\\n'`.\n* The stream is terminated with `'\\n]\\n'`.\n\n## Stringifier\n\nBy default, [json-stringify-safe](https://www.npmjs.com/package/json-stringify-safe) is used to convert objects into strings. This can be configured with `options.stringifier`.\n\n## API\n\n### Stringify([options])\n\nReturns a `Transform` stream.\nThe options are passed to the `Transform` constructor.\n\n### JSON.stringify options\n\nYou can override these:\n\n```js\nvar stringify = Stringify()\nstringify.replacer = function () {}\nstringify.space = 2\nstringify.opener = '['\nstringify.seperator = ','\nstringify.closer = ']'\nstringify.stringifier = JSON.stringify\n```\n\n[gitter-image]: https://badges.gitter.im/stream-utils/streaming-json-stringify.png\n[gitter-url]: https://gitter.im/stream-utils/streaming-json-stringify\n[npm-image]: https://img.shields.io/npm/v/streaming-json-stringify.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/streaming-json-stringify\n[github-tag]: http://img.shields.io/github/tag/stream-utils/streaming-json-stringify.svg?style=flat-square\n[github-url]: https://github.com/stream-utils/streaming-json-stringify/tags\n[travis-image]: https://img.shields.io/travis/stream-utils/streaming-json-stringify.svg?style=flat-square\n[travis-url]: https://travis-ci.org/stream-utils/streaming-json-stringify\n[coveralls-image]: https://img.shields.io/coveralls/stream-utils/streaming-json-stringify.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/stream-utils/streaming-json-stringify\n[david-image]: http://img.shields.io/david/stream-utils/streaming-json-stringify.svg?style=flat-square\n[david-url]: https://david-dm.org/stream-utils/streaming-json-stringify\n[license-image]: http://img.shields.io/npm/l/streaming-json-stringify.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/streaming-json-stringify.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/streaming-json-stringify\n","publish_time":1417926455317,"_cnpm_publish_time":1417926455317,"dist-tags":{"latest":"3.1.0"}}