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

gulp-csvtojson

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-csvtojson

convert csv to json

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-csvtojson Build Status

gulp plugin to wrap csvtojson

Install

$ npm install --save-dev gulp-csvtojson

Usage

Here is the code snippet for general usage which generate json for you.

var gulp = require('gulp');
var csvtojson = require('gulp-csvtojson');

gulp.task('default', function () {
    return gulp.src('src/file.csv')
        .pipe(csvtojson({ toArrayString: true }))
        .pipe(gulp.dest('dist'));
});

Here is the code snippet for generating js file.

var gulp = require('gulp');
var csvtojson = require('gulp-csvtojson');
var insert = require('gulp-insert');
var ext_replace = require('gulp-ext-replace');

gulp.task('default', function () {
    return gulp.src('src/file.csv')
        .pipe(csvtojson({ toArrayString: true }))
        .pipe(insert.prepend('var anyVariable = '))
        .pipe(insert.append(';'))
        .pipe(ext_replace('.js'))
        .pipe(gulp.dest('dist'));
});

Options

Refer to this list for full options.

Note: to get a valid json file, you need set toArrayString to true.

API

Since v0.2.0, API no longer supported, to achieve the same result, please adapt your code according to the second code snippet.

License

MIT © Icer

Keywords

FAQs

Package last updated on 10 Jun 2016

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