JSPM

write-csv

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1082
  • Score
    100M100P100Q108761F
  • License ISC

Quickly write json array to a .csv file

Package Exports

  • write-csv

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (write-csv) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

write-csv

NPM Version Build Status Coverage Status

Quickest way to write a json array to a .csv file

Install

Install with npm:

npm i --save write-csv

Then require in your file:

var writeCSV = require('write-csv')

Usage

writeFile(filename, data)

  • filename String filename or file descriptor
  • data Array of objects
writeCSV('./results.csv', [
  {a: 'foo', b: 'bar', c: 'baz'},
  {a: 'shoo', b: 'boo', c: 'chaz'},
  {a: 'gaia', b: 'loves', c: 'you'},
])

This will synchronously write your data to results.csv like this:

a,b,c
foo,bar,baz
shoo,boo,chaz
gaia,loves,you