New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

34

cli.js

@@ -7,2 +7,3 @@ #!/usr/bin/env node

var createWriteStream = require('fs').createWriteStream
var PassThrough = require('stream').PassThrough

@@ -18,2 +19,21 @@ var eventToPromise = require('event-to-promise')

function createInputStream (path) {
return path === undefined || path === '-'
? process.stdin
: createReadStream(path)
}
function createOutputStream (path) {
if (path !== undefined && path !== '-') {
return createWriteStream(path)
}
// introduce a through stream because stdout is not a normal stream!
var stream = new PassThrough()
stream.pipe(process.stdout)
return stream
}
// ===================================================================
var usage = [

@@ -43,4 +63,2 @@ 'Usage: ' + pkg.name + ' [OPTIONS] [<input file> [<output file>]]',

function main (args) {
var _ref
args = minimist(args, {

@@ -62,12 +80,4 @@ boolean: ['dynamic-typing', 'help', 'tsv'],

var input = (_ref = args._[0]) && (_ref !== '-')
? createReadStream(_ref)
: process.stdin
var output = (_ref = args._[1]) && (_ref !== '-')
? createWriteStream(_ref)
: process.stdout
return eventToPromise(pump([
input,
createInputStream(args._[0]),
csv2json({

@@ -77,3 +87,3 @@ dynamicTyping: args['dynamic-typing'],

}),
output
createOutputStream(args._[0])
]), 'finish')

@@ -80,0 +90,0 @@ }

{
"name": "csv2json",
"version": "1.3.0",
"version": "1.4.0",
"license": "ISC",

@@ -32,15 +32,15 @@ "description": "Stream and CLI to convert CSV to JSON",

"csv-parser": "^1.11.0",
"event-to-promise": "^0.7.0",
"exec-promise": "^0.6.1",
"husky": "^0.13.1",
"event-to-promise": "^0.8.0",
"exec-promise": "^0.7.0",
"minimist": "^1.2.0",
"pump": "^1.0.2",
"pumpify": "^1.3.5",
"through2": "^2.0.3",
"strip-bom-stream": "^3.0.0"
"strip-bom-stream": "^3.0.0",
"through2": "^2.0.3"
},
"devDependencies": {
"dependency-check": "^2.8.0",
"jest": "^19.0.2",
"standard": "^8.6.0"
"dependency-check": "^2.9.1",
"husky": "^0.14.3",
"jest": "^21.2.1",
"standard": "^10.0.3"
},

@@ -47,0 +47,0 @@ "scripts": {

@@ -34,2 +34,5 @@ # csv2json [![Build Status](https://travis-ci.org/julien-f/csv2json.png?branch=master)](https://travis-ci.org/julien-f/csv2json)

-t, --tsv
Use tab as separator, overrides separator flag.
<input file>

@@ -36,0 +39,0 @@ CSV file to read data from.

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