|
94 | 94 |
|
95 | 95 | ```
|
96 | 96 |
|
| 97 | +Note that `.fromFile(filePath[ ,cb ,options])` takes an `options` parameter which will be passed to `fs.createReadStream()`. See [here](https://nodejs.org/dist/latest-v6.x/docs/api/fs.html#fs_fs_createreadstream_path_options) for docs. |
| 98 | + |
97 | 99 | ### From CSV Stream
|
98 | 100 |
|
99 | 101 | ```js
|
@@ -270,8 +272,8 @@ Following parameters are supported:
|
270 | 272 | * **checkColumn**: whether check column number of a row is the same as headers. If column number mismatched headers number, an error of "mismatched_column" will be emitted.. default: false
|
271 | 273 | * **eol**: End of line character. If omitted, parser will attempt retrieve it from first chunk of CSV data. If no valid eol found, then operation system eol will be used.
|
272 | 274 | * **escape**: escape character used in quoted column. Default is double quote (") according to RFC4108. Change to back slash (\\) or other chars for your own case.
|
273 |
| -* **includeColumns**: This parameter instructs the parser to include only those columns as specified by an array of column indexes. Example: [0,2,3] will parse and include only columns 0, 2, and 3 in the JSON output. |
274 |
| -* **ignoreColumns**: This parameter instructs the parser to ignore columns as specified by an array of column indexes. Example: [1,3,5] will ignore columns 1, 3, and 5 and will not return them in the JSON output. |
| 275 | +* **includeColumns**: This parameter instructs the parser to include only those columns as specified by an array of column indexes or header names. Example: [0,2,3,"name"] will parse and include only columns 0, 2, 3, and column with header "name" in the JSON output. |
| 276 | +* **ignoreColumns**: This parameter instructs the parser to ignore columns as specified by an array of column indexes or header names. Example: [1,3,5,"title","age"] will ignore columns 1, 3, 5, title column and age column and will not return them in the JSON output. |
275 | 277 |
|
276 | 278 | All parameters can be used in Command Line tool.
|
277 | 279 |
|
@@ -585,6 +587,11 @@ There are some limitations when using multi-core feature:
|
585 | 587 |
|
586 | 588 | #Change Log
|
587 | 589 |
|
| 590 | +## 1.1.5 |
| 591 | + |
| 592 | +* `ignoreColumns` and `includeColumns` now allow put in header names and indecies. |
| 593 | +* only include `child_process` when multi worker is needed. |
| 594 | +* allow `fs.createReadStream` options being passed in through `fromFile` function |
588 | 595 |
|
589 | 596 | ## 1.1.4
|
590 | 597 |
|
|
0 commit comments