New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

csvify

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csvify

make csv valid lines

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
6
20%
Maintainers
1
Weekly downloads
 
Created
Source

CSVify

I can't probably call this a streamming CSV writter, due to the lack of features, but it's enough to have the functionality I needed ATM. I'll probably add more features as needed, feel free to do it as well with a pull request ;)

Installation

npm install --save csvify

Usage

It's a transform stream that receives arrays and pipes CSV lines.

var CSVify = require('csvify');
var csvStream = new CSVify(','); // use ',' as a delimiter

csvStream.writeHead(['name', 'age', 'address']); // write a header
csvStream.writeHead('name', 'age', 'address'); // has the same behaviour as above

var header = csvStream.read();
console.log(header); // name,age,address\r\n

csvStream.write(['JJ', 23, 'Rua da Prata nº80, Lisboa']);

var line = csvStream.read();
console.log(line); // "JJ",23,"Rua da Prata nº80, Lisboa"\r\n

For a more complete usage example, check out the JSONStream test.

License

MIT!

Keywords

csv

FAQs

Package last updated on 04 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts