Permalink
Browse files

command version seems to work

  • Loading branch information...
1 parent 616b0ba commit aca75eaece7721679e366bb0ada070b990e496e3 @substack committed Dec 4, 2011
Showing with 71 additions and 0 deletions.
  1. +23 −0 bin/cli.js
  2. +48 −0 package.json
View
@@ -0,0 +1,23 @@
+#!/usr/bin/env node
+var fs = require('fs');
+var toJSON = require('../');
+
+if (process.argv.slice(2).join(' ') === '-h') {
+ console.log('Usage: shp2json {infile|-} {outfile|-}');
+ process.exit(0);
+}
+
+var inFile = process.argv[2] || '-';
+var inStream = inFile === '-'
+ ? process.stdin
+ : fs.createReadStream(inFile)
+;
+
+var outFile = process.argv[3] || '-';
+var outStream = outFile === '-'
+ ? process.stdout
+ : fs.createWriteStream(outFile)
+;
+
+toJSON(inStream).pipe(outStream);
+if (inStream.resume) inStream.resume();
View
@@ -0,0 +1,48 @@
+{
+ "name" : "shp2json",
+ "description" : "Streaming conversion of shapefile.zip files into GeoJSON using ogr2ogr",
+ "version" : "0.0.0",
+ "repository" : {
+ "type" : "git",
+ "url" : "git://github.com/substack/shp2json.git"
+ },
+ "main" : "index.js",
+ "bin" : {
+ "shp2json" : "bin/cli.js"
+ },
+ "keywords" : [
+ "shapefile",
+ "shp",
+ "zip",
+ "stream",
+ "convert",
+ "geojson",
+ "geo",
+ "gis",
+ "json"
+ ],
+ "directories" : {
+ "lib" : ".",
+ "example" : "example",
+ "test" : "test"
+ },
+ "scripts" : {
+ "test" : "tap test/*.js"
+ },
+ "dependencies" : {
+ "seq" : "0.3.x",
+ "morestreams" : "0.2.x"
+ },
+ "devDependencies" : {
+ "tap" : "0.0.x"
+ },
+ "engines" : {
+ "node" : ">=0.4.0"
+ },
+ "license" : "MIT",
+ "author" : {
+ "name" : "James Halliday",
+ "email" : "mail@substack.net",
+ "url" : "http://substack.net"
+ }
+}

0 comments on commit aca75ea

Please sign in to comment.