Skip to content

Instantly share code, notes, and snippets.

@anandthakker
Created June 18, 2015 21:00
Show Gist options
  • Save anandthakker/b07447d97c91f2be6bf4 to your computer and use it in GitHub Desktop.
Save anandthakker/b07447d97c91f2be6bf4 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
/*
* Read a newline-delimited stream of GeoJSON features,
* write a valid GeoJSON FeatureCollection.
*/
var geojsonstream = require('geojson-stream')
var ndjson = require('ndjson')
process.stdin
.pipe(ndjson.parse())
.pipe(geojsonstream.stringify())
.pipe(process.stdout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment