🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

parse-csv-simple

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-csv-simple

A parser for csv file.

1.0.6
latest
Source
npm
Version published
Weekly downloads
9
-59.09%
Maintainers
1
Weekly downloads
 
Created
Source

parse-csv-simple

A parser for csv file.

Usage

Import the library in your code

parse the whole csv string directly

var {parse} = require('parse-csv-simple');
var csvText = 'name,age,gender\nJenny,21,female';
parse(csvText); // [['name', 'age', 'gender'], ['Jenny', '21', 'female']]

get an iterable object, you can control the iterate flow.

var {parseIterable} = require('parse-csv-simple');
var csvText = 'name,age,gender\nJenny,21,female';
var iteratableObj = parseIterable(csvText);

for (var row of iteratableObj) {
  // do something
}

custom the delimiter or rows to parse

var {parse} = require('parse-csv-simple');
var csvText = 'name,age,gender\nJenny,21,female';
var iteratableObj = parse(csvText, { delimiter: '...', limit: 100 });

Keywords

csv

FAQs

Package last updated on 15 Jul 2021

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