https://github.com/soroushj/node-minimal-csv-formatter
Transform arrays into CSV strings.
https://github.com/soroushj/node-minimal-csv-formatter
csv csv-string nodejs npm-package
Last synced: 7 months ago
JSON representation
Transform arrays into CSV strings.
- Host: GitHub
- URL: https://github.com/soroushj/node-minimal-csv-formatter
- Owner: soroushj
- License: mit
- Created: 2017-11-04T15:03:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-18T01:11:36.000Z (over 2 years ago)
- Last Synced: 2025-08-09T10:53:49.579Z (8 months ago)
- Topics: csv, csv-string, nodejs, npm-package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/minimal-csv-formatter
- Size: 277 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Minimal CSV Formatter
[](https://travis-ci.org/soroushj/node-minimal-csv-formatter)
[](https://codecov.io/gh/soroushj/node-minimal-csv-formatter)
[](https://badge.fury.io/js/minimal-csv-formatter)
Transforms arrays into equivalent CSV strings. Conforms to [RFC 4180](https://tools.ietf.org/html/rfc4180), with the exception that, instead of `CRLF`, `LF` is used as line delimiter.
## Usage
```javascript
const csv = require('minimal-csv-formatter');
let singleRow = csv(['x', 'y']);
// 'x,y\n'
let multipleRows = csv([
[1, 2],
[3, 4],
]);
// '1,2\n3,4\n'
let emptyFields = csv([null, undefined]);
// ',\n'
let emptyRows = csv([
[],
null,
undefined,
]);
// ''
```