Comparing version
{ | ||
"name": "a-csv", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "A lightweight CSV parser.", | ||
"author": "Adrian Ottiker <adrian@ottiker.com>", | ||
"author": "jillix <contact@jillix.com>", | ||
"bin": { | ||
"a-csv": "./bin/a-csv" | ||
}, | ||
"contributors": [ | ||
@@ -11,10 +14,4 @@ "Adrian Ottiker <adrian@ottiker.com>", | ||
], | ||
"dependencies": { | ||
"iconv-lite": "0.4.5" | ||
}, | ||
"devDependencies": { | ||
"mocha": "1.x.x" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "mocha test" | ||
}, | ||
@@ -28,6 +25,3 @@ "engine": "node >= 0.8.0", | ||
], | ||
"main": "index.js", | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"main": "lib/index.js", | ||
"repository": { | ||
@@ -41,3 +35,17 @@ "type": "git", | ||
}, | ||
"homepage": "https://github.com/jillix/a-csv" | ||
} | ||
"homepage": "https://github.com/jillix/a-csv", | ||
"directories": { | ||
"example": "example", | ||
"test": "test" | ||
}, | ||
"dependencies": { | ||
"bug-killer": "^1.0.0", | ||
"clp": "^1.2.0", | ||
"fs-plus": "^2.8.1", | ||
"iconv-lite": "^0.4.8", | ||
"is-there": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.2.5" | ||
} | ||
} |
@@ -12,2 +12,34 @@ a-csv | ||
# CLI Tool | ||
There is a command line tool as well and it's available if you install this package | ||
globally: | ||
```sh | ||
$ npm install -g a-csv | ||
``` | ||
Run `a-csv -h` for help content. | ||
```sh | ||
$ a-csv -h | ||
Usage: a-csv [options] | ||
Options: | ||
-l, --length <length> The buffer size. | ||
-c, --charset <charset> The file charset | ||
-i, --ignore-headers Ignore the first line in the input file. | ||
-s, --source <path> The source csv file. | ||
--verbose Display additional log messages. | ||
-h, --help Displays this help. | ||
-v, --version Displays version information. | ||
Examples: | ||
a-csv -s path/to/file.csv | ||
a-csv -s path/to/file.csv -i | ||
a-csv -s path/to/file.csv -l 2048 | ||
a-csv -s path/to/file.csv -c ascii | ||
Documentation can be found at https://github.com/jillix/a-csv | ||
``` | ||
# Example | ||
@@ -39,6 +71,6 @@ | ||
# Documentation | ||
## `parse(path, options, rowHandler)` | ||
### `parse(path, options, rowHandler)` | ||
Parses CSV files. | ||
### Params | ||
#### Params | ||
- **String** `path`: Path to CSV file. | ||
@@ -49,9 +81,10 @@ - **Object** `options`: An object containing the following properties: | ||
- `charset` (String): The charset (default: `"utf8"`). | ||
- `headers` (Boolean): A flag to indicate if the file contains headers or not (default: `false`). | ||
- **Function** `rowHandler`: The row handler callback (called with `err`, `data`, `next` arguments). | ||
## `stringify(csvArray, delimiter, lineBreak)` | ||
### `stringify(csvArray, delimiter, lineBreak)` | ||
Stringifies a CSV array. | ||
### Params | ||
#### Params | ||
- **Array** `csvArray`: The CSV array. | ||
@@ -61,5 +94,6 @@ - **String** `delimiter`: The delimiter (default: `","`). | ||
### Return | ||
#### Return | ||
- **String** The stringified CSV array. | ||
# How to contribute | ||
@@ -66,0 +100,0 @@ 1. File an issue in the repository, using the bug tracker, describing the |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
356277
1.62%15
66.67%304
25.62%107
46.58%5
400%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
Updated