parse-csv-simple
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -10,3 +10,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
root["CSVParser"] = factory(); | ||
})(self, function() { | ||
})(this, function() { | ||
return /******/ (() => { // webpackBootstrap | ||
@@ -13,0 +13,0 @@ /******/ "use strict"; |
{ | ||
"name": "parse-csv-simple", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "A parser for csv file.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -8,6 +8,28 @@ # parse-csv-simple | ||
### parse the whole csv string directly | ||
```js | ||
var {parse} = require('parse-csv-simple'); | ||
var csvText = 'csv text ...'; | ||
parse(csvText); | ||
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. | ||
```js | ||
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 | ||
```js | ||
var {parse} = require('parse-csv-simple'); | ||
var csvText = 'name,age,gender\nJenny,21,female'; | ||
var iteratableObj = parse(csvText, { delimiter: '...', limit: 100 }); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22369
35