CSV Parser for Node.js

Table of Contents

Introduction

Build Status

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.

Main features

  • 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
  • BSD License

Usage

Run 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.

The source code uses modern JavaScript features and run natively in Node 7.6+. For older browsers or older versions of Node, use the modules inside "./lib/es5".