# csv-stream

> Simple CSV stream

Latest version **0.2.0** (published 2018-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install csv-stream
pnpm add csv-stream
yarn add csv-stream
bun add csv-stream
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-03-13 |
| First published | 2012-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 24.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 46 |
| Author | Remy Loubradou |
| Maintainers | lbdremy |
| Keywords | csv, stream |

## Links

- npm: https://www.npmjs.com/package/csv-stream
- Repository: https://github.com/lbdremy/node-csv-stream
- Homepage: https://github.com/lbdremy/node-csv-stream#readme
- Issues: https://github.com/lbdremy/node-csv-stream/issues
- npm.io page: https://npm.io/package/csv-stream

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2018-03-13
- 0.1.3 — 2012-10-23
- 0.1.2 — 2012-09-29
- 0.1.1 — 2012-08-31
- 0.1.0 — 2012-08-31

## README

# csv-stream - Simple CSV stream for node.js

[![](https://secure.travis-ci.org/lbdremy/node-csv-stream.png)](http://travis-ci.org/#!/lbdremy/node-csv-stream)

## Install

```sh
npm install csv-stream
```

## Usage

```js
var csv = require('csv-stream'),
var request = require('request');

// All of these arguments are optional.
var options = {
	delimiter : '\t', // default is ,
	endLine : '\n', // default is \n,
	columns : ['columnName1', 'columnName2'], // by default read the first line and use values found as columns
	columnOffset : 2, // default is 0
	escapeChar : '"', // default is an empty string
	enclosedChar : '"' // default is an empty string
}

var csvStream = csv.createStream(options);
request('http://mycsv.com/file.csv').pipe(csvStream)
	.on('error',function(err){
		console.error(err);
	})
	.on('header', function(columns) {
		console.log(columns);
	})
	.on('data',function(data){
		// outputs an object containing a set of key/value pair representing a line found in the csv file.
		console.log(data);
	})
	.on('column',function(key,value){
		// outputs the column name associated with the value found
		console.log('#' + key + ' = ' + value);
	})
```

## Test

```sh
npm test
```

## Contributions

Feel free to post issues and pull requests, more than welcome you are ;).

## Licence
(The MIT License) Copyright 2012 HipSnip Limited

---
_Source: https://npm.io/package/csv-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
