{"name":"streaming-json-stringify","description":"Streaming JSON.stringify()","version":"0.2.2","scripts":{"test":"make test"},"devDependencies":{"mocha":"*","cat-stream":"*"},"author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"repository":{"type":"git","url":"https://github.com/stream-utils/streaming-json-stringify.git"},"bugs":{"url":"https://github.com/stream-utils/streaming-json-stringify/issues","email":"me@jongleberry.com"},"license":"MIT","engines":{"node":">= 0.10"},"_id":"streaming-json-stringify@0.2.2","dist":{"shasum":"cda9cb61537b8b22c6a999593a1c77ce5717e260","tarball":"http://registry-npm.ywwl.com/streaming-json-stringify/download/streaming-json-stringify-0.2.2.tgz","integrity":"sha512-0CVFNJtYakp6v4jIMUesnXVemU93AcvKY29LZH/NZVeO6dV1yokWqi5gEweL6fPYUOeBne982wRdmLXHMssNng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAzoM2EbtlgwxhfZihojD140jprB73REdkAt30DQcAxaAiEAwz3A2g5UXIJT4Q3GjZG0ZtjzbwOxm6KLV4HIsAeRNNs="}],"size":2389,"noattachment":false,"key":"/streaming-json-stringify/-/streaming-json-stringify-0.2.2.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"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":1381431349473,"_cnpm_publish_time":1381431349473,"dist-tags":{"latest":"3.1.0"}}