{"name":"geojson-stream","version":"0.0.0","description":"stream features into and out of geojson","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/tmcw/geojson-stream.git"},"keywords":["geojson","stream","maps","json","pipe"],"author":{"name":"Tom MacWright"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/tmcw/geojson-stream/issues"},"dependencies":{"JSONStream":"~0.7.1","through":"~2.3.4"},"devDependencies":{"expect.js":"~0.2.0","mocha":"~1.13.0","concat-stream":"~1.0.1"},"_id":"geojson-stream@0.0.0","dist":{"shasum":"e5e09a0633ad1a63a4aec5d7c5312a3b8f91a048","tarball":"http://registry-npm.ywwl.com/geojson-stream/download/geojson-stream-0.0.0.tgz","integrity":"sha512-fvNmO6ljDiAFojEnBTMxqctPnRjuz+Pme3pdQ8voLVlAu2UVmXaQC7f9iKjrDh9fRnXgr9HNGrj+lZFH0cjPHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7pIdTL4gTvaMo6ptSSwgc5W6hcn5qXrHml9dS0KLagAiAWpkSpB1siP/wbrGGziB7UIDsfIU42D8UI8vGZsEvavA=="}],"size":1479,"noattachment":false,"key":"/geojson-stream/-/geojson-stream-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"tmcw","email":"tom@macwright.org"},"maintainers":[{"name":"tmcw","email":"tom@macwright.org"}],"directories":{},"readme":"# geojson-stream\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/tmcw/geojson-stream.svg)](https://greenkeeper.io/)\n[![build status](https://secure.travis-ci.org/tmcw/geojson-stream.svg)](http://travis-ci.org/tmcw/geojson-stream)\n\nStream features into and out of [GeoJSON](http://geojson.org/) objects\nand Feature Collections. Little more than [JSONStream](https://github.com/dominictarr/JSONStream)\nwith pre-filled settings.\n\n## usage\n\n    npm install --save geojson-stream\n\n## api\n\n### `geojsonStream.stringify()`\n\nReturns a transform stream that accepts GeoJSON Feature objects and emits\na stringified FeatureCollection.\n\n### `geojsonStream.parse(mapFunc)`\n\nReturns a transform stream that accepts a GeoJSON FeatureCollection as a stream\nand emits Feature objects.\n\n`mapFunc(feature, index)` is an optional function which takes a `Feature`, and its zero-based index in the `FeatureCollection` and returns either a `Feature`, or null/undefined \nif the feature should be omitted from output.\n\n## example\n\n```\nconst geojsonStream = require('geojson-stream');\nconst fs = require('fs');\nconst out = fs.createWriteStream('buildings-with-id.geojson');\nfs\n    .createReadStream(`buildings.geojson`)\n    .pipe(geojsonStream.parse((building, index) => {\n        if (building.geometry.coordinates === null) {\n            return null;\n        }\n        building.id = index;\n        return building;\n    }))\n    .pipe(geojsonStream.stringify())\n    .pipe(out);\n```","publish_time":1382041936093,"_cnpm_publish_time":1382041936093,"dist-tags":{"latest":"0.1.0"}}