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 csv-json with all npm packages installed. Try it out:

var csvJson = require("csv-json")

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

csv-json v0.1.0

Node.js module for read csv file and reorganize it to json-object


csv file parser and reorganizer to user defined json object

Build Status


npm install csv-json

News: version: 0.1.0 - possible to put csv direct in string format Fix functionality


options parameter can omitted (default settings will be used, eg. csv delimeter is ',')

var csvjs = require('../lib/csv-json');
  { rules: {
    { //Rules:
    HEADER1: {path: 'test.h1'},
    HEADER2: {path: 'h2'},
    HEADER3: {path: 'h3'},
    HEADER4: {path: 'test2.h4'}
  options: { //Options:
    delimiter : ','
  function(error, json, stats){
    /* json:
    [ {
       test: {h1  'H1R0'},
       h2: 'H2R0',
       h3, 'H3R0',
       test2: {h4: 'H4R0'}


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