CSV Parser for Node.js
This package is a parser converting CSV text input into arrays or objects. It implements the Node.js stream API. It also provides alternative APIs for convenience such as the callback API and sync API. It is both extremely easy to use and powerful. It was first released in 2010 and is used against big data sets by a large community.
Source code for this project is available on GitHub.
- Follow the Node.js streaming API
- Simplicity with the optional callback and sync API
- Support delimiters, quotes, escape characters and comments
- Line break discovery
- Support big datasets
- Complete test coverage and samples for inspiration
- No external dependencies
- Work nicely with the csv-generate, stream-transform and csv-stringify packages
- MIT License
npm install csv to install the full CSV package or run
npm install csv-parse if you are only interested by the CSV parser.
Use the stream based API for scalability and the sync or mixed APIs for simplicity.
For older browsers or older versions of Node, use the modules inside "./lib/es5", i.e.
require("csv-parse") will become
For usage and examples, you may refer to recipes page, the "samples" folder and the "test" folder.