Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-csv

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-csv

ES7 async-await wrapper for the csv package.

  • 2.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
197K
increased by21.29%
Maintainers
1
Weekly downloads
 
Created

What is async-csv?

The async-csv npm package provides asynchronous methods for parsing and stringifying CSV data. It is designed to handle CSV operations in a non-blocking manner, making it suitable for applications that require high performance and scalability.

What are async-csv's main functionalities?

Parsing CSV

This feature allows you to parse a CSV string into an array of records asynchronously. The code sample reads a CSV file and parses its content into an array of records.

const fs = require('fs');
const { parse } = require('async-csv');

(async () => {
  const csvString = await fs.promises.readFile('path/to/file.csv', 'utf-8');
  const records = await parse(csvString);
  console.log(records);
})();

Stringifying CSV

This feature allows you to convert an array of records into a CSV string asynchronously. The code sample takes an array of records and writes it to a CSV file.

const fs = require('fs');
const { stringify } = require('async-csv');

(async () => {
  const records = [
    ['name', 'age'],
    ['Alice', 30],
    ['Bob', 25]
  ];
  const csvString = await stringify(records);
  await fs.promises.writeFile('path/to/output.csv', csvString);
})();

Other packages similar to async-csv

Keywords

FAQs

Package last updated on 30 Dec 2019

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc