Skip to content

About

module that manipulate csv by using buffer

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

module that manipulate csv by using buffer

Installation

npm install

Import

import { getDataPointRowHeaderName, getDataPointRowColumn } from 'getdatafromcsvbuffer';

Features

  • Very fast CSV manipulation using Buffer
  • Since Buffer operates outside the V8 heap, GC pauses are less likely to occur

API

getDataPointRowHeaderName(buffer, row, headerName)

Get data by specifying a header name and row number.

Argument Type Description
buffer Buffer Buffer of the CSV file
row number Row number to retrieve (1-based, excluding header row)
headerName string Header name of the column to retrieve

Returns: Buffer (matched data), or a negative number if not found

import fs from 'node:fs';
const csv = fs.readFileSync('./data.csv');

// Get the "price" column of row 2
console.log(getDataPointRowHeaderName(csv, 2, 'price').toString());

About

module that manipulate csv by using buffer

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages