Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(docs): fixed small errors #344

Merged
merged 2 commits into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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