🚀 Socket Launch Week 🚀 Day 3: Socket Acquires Coana.Learn More
Socket
Sign inDemoInstall
Socket

a-csv

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-csv - npm Package Compare versions

Comparing version

to
2.0.0

.travis.yml

38

package.json
{
"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