pradeep-mishra / csvjson

csv to json
MIT License
59 stars 22 forks source link

What if the input is in the form of string instead of stream? #21

Closed rkbansal closed 6 years ago

rkbansal commented 6 years ago

Actually i am getting CSV (here Tab-separated) data from client through HTTP on server side, now i want to convert that data to json. How can i?

pradeep-mishra commented 6 years ago

try like this

const csvjson = require('csvjson');
let options = {
  delimiter : '\t'
};
let json = csvjson.toObject(csv, options);