Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including json-cli with all npm packages installed. Try it out:

var jsonCli = require("json-cli")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

json-cli v0.1.1

convert multipule file format to json.

json-cli

convert multipule file format to json, geojson via cli interface.

Install

npm install -g json-cli

Support

json

File format that support converting to json format.

  • tsv
  • csv
  • xml
  • xls
  • xlsx

geojson

File format that support converting to geojson format.

  • gpx
  • topojson
  • kml

Usage

json

For json format, you can simply enter

$ json-cli <file input> <file output>
// for example

$ json-cli ./sample/sample.csv ./dist/test.json

geojson

For converting to geojson format, just simply add a -g option in command.

$json-cli -g <file input> <file outpu>
// for example

$ json-cli ./sample/us-10m.topojson ./dist/test.geojson

See also

  • https://github.com/DataGarage/convert-geo
  • https://github.com/DataGarage/convert-json

License

MIT @chilijung

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free