Socket
Socket
Sign inDemoInstall

write-csv

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    write-csv

Quickly write json array to a .csv file


Version published
Weekly downloads
2.3K
increased by4.78%
Maintainers
1
Install size
17.6 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 22 Dec 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc