Skip to content

Commit

Permalink
Merge pull request #344 from 0xflotus/master
Browse files Browse the repository at this point in the history
(docs): fixed small errors
  • Loading branch information
jeremyrajan authored Apr 8, 2020
2 parents 8a2f74c + 3bdaff0 commit 02f4cfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/csvtojson-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ csv()
csv()
.fromFile(csvFilePath)
.subscribe((json,lineNumber)=>{
// process the json line in synchronouse.
// process the json line in synchronous.
},onError, onComplete)

```
Expand Down Expand Up @@ -194,7 +194,7 @@ const jsonArray=await csv().fromString(myCSV); // async /await

Worker feature makes sense to Command Line where it could utilize multiple CPU cores to speed up processing large csv file. However, it does not quite work as expected mainly because cooperation of multiple processes' result is very complex. Also the inter process communication adds too much overhead which minimize the benefit gained from spawning workers.

Thus in verions `2.0.0` I decided to temporarily remove `Worker` feature and will re-think how to better utilize multiple CPU Cores.
Thus in version `2.0.0` I decided to temporarily remove `Worker` feature and will re-think how to better utilize multiple CPU Cores.


## fromFile / fromStream / fromString will not accept callback. Use `.then` instead
Expand Down Expand Up @@ -273,9 +273,9 @@ csv()
csv()
.preRawData((csvRawData)=>{
var newData=csvRawData.replace('some value','another value')
// synchronouse
// synchronous
return newData;
// or asynchronousely
// or asynchronously
return Promise.resolve(newData);
})
```
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

`csvtojson` module is a comprehensive nodejs csv parser to convert csv to json or column arrays. It can be used as node.js library / command line tool / or in browser. Below are some features:

* Strictly follow CSV definition [RF4180](https://www.loc.gov/preservation/digital/formats/fdd/fdd000323.shtml)
* Strictly follow CSV definition [RFC4180](https://www.loc.gov/preservation/digital/formats/fdd/fdd000323.shtml)
* Work with millions of lines of CSV data
* Provide comprehensive parsing parameters
* Provide out of box CSV parsing tool for Command Line
Expand Down Expand Up @@ -342,7 +342,7 @@ the hook -- `preRawData` will be called with csv string passed to parser.

```js
const csv=require('csvtojson')
// synchronouse
// synchronous
csv()
.preRawData((csvRawData)=>{
var newData=csvRawData.replace('some value','another value');
Expand All @@ -366,7 +366,7 @@ The function is called each time a file line has been parsed in csv stream. The

```js
const csv=require('csvtojson')
// synchronouse
// synchronous
csv()
.preFileLine((fileLineString, lineIdx)=>{
if (lineIdx === 2){
Expand Down Expand Up @@ -529,7 +529,7 @@ There are currently following built-in parser:
* number: Convert value to number
* omit: omit the whole column

This will override types infered from `checkType:true` parameter. More built-in parsers will be added as requested in [issues page](https://github.com/Keyang/node-csvtojson/issues).
This will override types inferred from `checkType:true` parameter. More built-in parsers will be added as requested in [issues page](https://github.com/Keyang/node-csvtojson/issues).

Example:

Expand Down

0 comments on commit 02f4cfb

Please sign in to comment.