Socket
Socket
Sign inDemoInstall

csvtojson-converter

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    csvtojson-converter

easy csv to json converter in TypeScript, can be used as a module


Version published
Weekly downloads
528
decreased by-11.56%
Maintainers
1
Install size
11.7 kB
Created
Weekly downloads
 

Readme

Source

CSV to JSON converter

simply and fast converter that can be used as module

Description

CSV look like:

nameagesexaddress
John18MNY, Brooklyn
Alice22FBritan, Newington

Text with will look like: (delimiter: ",")

name,age ,sex,adderss
John,18,M,"NY, Brooklyn"
Alice,22,F,"Britan, Newington"

simply call function csvToJson() with at least one parametr

const csvText = 'name,age,sex,adderss\nJohn,18,M,"NY, Brooklyn"\nAlice,22,F,"Britan, Newington"';
const delimiter = ',';

//wit delimiter
const json = csvToJson(csvText, delimiter);

//you can call it without dilimiter if it is: , ; | " "
const json =  csvToJson(csvText);

It will generate JSON like this:

[
 {
  "name": "John",
  "age": 18,
  "sex": "M",
  "address": "NY, Brooklyn"
 },
 {
  "name": "Alice",
  "age": 22,
  "sex": "F",
  "address": "Britan, Newington"
 }
]

Install npm

npm install csvtojson-converter -D

Keywords

FAQs

Last updated on 04 Jun 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc