Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/neat-csv
Fast CSV parser
https://github.com/sindresorhus/neat-csv
Last synced: 6 days ago
JSON representation
Fast CSV parser
- Host: GitHub
- URL: https://github.com/sindresorhus/neat-csv
- Owner: sindresorhus
- License: mit
- Created: 2015-05-29T22:54:37.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-06-21T00:27:07.000Z (over 1 year ago)
- Last Synced: 2025-01-05T10:09:56.283Z (6 days ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 322
- Watchers: 7
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-nodejs - neat-csv - Fast CSV parser. Callback interface for the above. ![](https://img.shields.io/github/stars/sindresorhus/neat-csv.svg?style=social&label=Star) (Repository / Parsing)
- awesome-nodejs - neat-csv - Fast CSV parser. Callback interface for the above. (Packages / Parsing)
- awesome-nodejs - neat-csv - Fast CSV parser - ★ 75 (Parsing)
- awesome-node - neat-csv - Fast CSV parser. Callback interface for the above. (Packages / Parsing)
- awesome-nodejs-cn - neat-csv - **star:322** 快CSV解析器上面的回调接口 (包 / 解析)
README
# neat-csv
> Fast CSV parser
Convenience wrapper around the super-fast streaming [`csv-parser`](https://github.com/mafintosh/csv-parser) module. Use that one if you want streamed parsing.
Parsing-related issues should be reported to [`csv-parser`](https://github.com/mafintosh/csv-parser/issues).
## Install
```sh
npm install neat-csv
```## Usage
```js
import neatCsv from 'neat-csv';const csv = 'type,part\nunicorn,horn\nrainbow,pink';
console.log(await neatCsv(csv));
//=> [{type: 'unicorn', part: 'horn'}, {type: 'rainbow', part: 'pink'}]
```## API
### neatCsv(data, options?)
Returns a `Promise` with the parsed CSV.
#### data
Type: `string | Buffer | stream.Readable`
The CSV data to parse.
#### options
Type: `object`
See the [`csv-parser` options](https://github.com/mafintosh/csv-parser#options).