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

gocsv

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gocsv

Go's CSV package ported to JavaScript to run in browser

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
decreased by-9.52%
Maintainers
1
Weekly downloads
 
Created
Source

Tests

GoCSV

There's a lack of high performance and correct implementation of CSV reading/writing in JS ecosystem, thus this library was born. All tests from Go's csv package are ported over and used to validate the correctness of this library. Furthermore it was written to run in modern browsers and should feel fairly modern to use. Finally only csv Reader has been ported at this point.

Getting started

npm install --save gocsv

Usage

Read from string

import { Reader } from 'gocsv'

const reader = new Reader('a,b,c\n1,2,3\n4,5,6')
reader
  .readAll(row => {
    console.log('read row:', row)
  })
  .then(() => {
    console.log('finished reading')
  })

Read from file

import { Reader } from 'gocsv'

const reader = new Reader(file.stream())
reader
  .readAll(row => {
    console.log('read row:', row)
  })
  .then(() => {
    console.log('finished reading')
  })

Read 10 lines

import { Reader } from 'gocsv'

const reader = new Reader(file.stream())
reader
  .readN(10, row => {
    console.log('read row:', row)
  })
  .then(() => {
    console.log('finished reading')
  })

Docs

Exports

Keywords

FAQs

Package last updated on 28 May 2021

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