implementing the Node.js
npm install csv to install the full csv module or run
npm install csv-generate if you are only interested by the CSV parser.
Use the callback style API for simplicity or the stream based API for scalability.
The parser receive a string and return an array inside a user-provided
callback. This example is available with the command
var generate = ;;
// node samples/stream.jsvar generate = ;var data =var generator = ;generator;generator;generator;
One usefull function part of the Stream API is
pipe to interact between
multiple streams. You may use this function to pipe a
source to a
stream.Writable object destination. The next example available as
node samples/pipe.js read the file, parse its content and transform it.
// node samples/pipe.jsvar generate = ;var generator = ;generator;
Most of the generator is imported from its parent project CSV in a effort to split it between the generator, the parser, the transformer and the stringifier.
Tests are executed with mocha. To install it, simple run
npm test. It will install mocha and its dependencies in your
project "node_modules" directory and run the test suite. The tests run
against the CoffeeScript source files.
npm run coffee.
The test suite is run online with Travis against the versions 0.9, 0.10 and 0.11 of Node.js.