Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

csv2json

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv2json

Stream and CLI to convert CSV to JSON

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.8K
increased by6.63%
Maintainers
3
Weekly downloads
 
Created
Source

csv2json

Package Version Build Status PackagePhobia Latest Commit

Stream and CLI to convert CSV to JSON.

Install

Installation of the npm package:

Install globally if you want to use the CLI:

npm install --global csv2json

Install locally if you want to use it as a library:

npm install --save csv2json

Usage

CLI

Usage: csv2json [OPTIONS] [<input file> [<output file>]]

  -d, --dynamic-typing
    Convert booleans and numeric to their type instead of strings.

  -s <separator>, --separator=<separator>
    Field separator to use (default to comma “,”).

  -t, --tsv
    Use tab as separator, overrides separator flag.

  <input file>
    CSV file to read data from.
    If unspecified or a dash (“-”), use the standard input.

  <output file>
    JSON file to write data to.
    If unspecified or a dash (“-”), use the standard output.

Stream

var csv2json = require('csv2json');
var fs = require('fs');

fs.createReadStream('data.csv')
  .pipe(csv2json({
    // Defaults to comma.
    separator: ';'
  }))
  .pipe(fs.createWriteStream('data.json'));

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

Note

Thanks to @twilson63 for letting me use the csv2json name on npm.

License

ISC © Julien Fontanet

Keywords

FAQs

Package last updated on 26 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc