CSVStringify for Node.js

IssuesGitHub

CSV Stringify API

Introduction

There are multiple APIs available, each with their own advantages and disadvantages. Under the hood, they share the same implementation.

  • Sync API
    The sync API provides simplicity, readability and convenience. Like for the callback API, it is meant for small dataset which fit in memory and which usage tolerates waiting for the last record.
  • Stream API
    The stream API might not be the most pleasant API to use but is scalable.
  • Callback API
    The callback API buffers all the emitted records from the stream API into a single array which is passed to a user provided function. Passing a function is easier than implementing the stream events function but it implies that the all dataset must fit into the available memory and it will only be available after the last record has been processed. This is usually not recommanded, use the Sync API instead.
  • Stream API + dataset
    Replace the writable stream with records or the readable stream with a callback function.
  • Async iterator API
    The Async iterator API is both scalable and elegant. It takes advantage of the native Readable Stream API upon which the parser is build to iterate over the stringified chunks of data.

For additional usages and examples, you may refer to:

About

The Node.js CSV project is an open source product hosted on GitHub and developed by Adaltas.