npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cisv

v0.4.8

Published

The csv parser on steroids.

Readme

CISV Node.js Binding

Native Node-API binding for the CISV C core.

Install

npm install cisv

From source in this repository:

cd cisv
npm ci
npm run build
npm test

Quick Start

const { cisvParser } = require('cisv');

const parser = new cisvParser({ delimiter: ',', trim: true });
const rows = parser.parseSync('data.csv');

console.log(rows.length);
console.log(rows[0]);

Parser API

Constructor options

  • delimiter?: string (first character used)
  • quote?: string (first character used)
  • escape?: string | null (null means RFC4180 doubled quote escaping)
  • comment?: string | null
  • trim?: boolean
  • skipEmptyLines?: boolean
  • relaxed?: boolean
  • skipLinesWithError?: boolean
  • maxRowSize?: number
  • fromLine?: number
  • toLine?: number

Instance methods

  • parseSync(path: string): string[][]
  • parse(path: string): Promise<string[][]>
  • parseString(csv: string): string[][]
  • write(chunk: Buffer | string): void
  • end(): void
  • getRows(): string[][]
  • clear(): void
  • setConfig(config): this
  • getConfig(): object
  • transform(fieldIndex: number, kindOrFn: string | Function, context?): this
  • transformByName(fieldName: string, kindOrFn: string | Function, context?): this
  • setHeaderFields(fields: string[]): void
  • removeTransform(fieldIndex: number): this
  • removeTransformByName(fieldName: string): this
  • clearTransforms(): this
  • getTransformInfo(): { cTransformCount: number, jsTransformCount: number, fieldIndices: number[] }
  • getStats(): { rowCount: number, fieldCount: number, totalBytes: number, parseTime: number, currentLine: number }
  • openIterator(path: string): this
  • fetchRow(): string[] | null
  • closeIterator(): this
  • destroy(): void

Static methods

  • cisvParser.countRows(path: string): number
  • cisvParser.countRowsWithConfig(path: string, config?): number

Transform Types

Built-in transform names:

  • uppercase
  • lowercase
  • trim
  • to_int (or int)
  • to_float (or float)
  • hash_sha256 (or sha256)
  • base64_encode (or base64)

Examples

Async parse

const { cisvParser } = require('cisv');

(async () => {
  const parser = new cisvParser();
  const rows = await parser.parse('data.csv');
  console.log(rows.length);
})();

Streaming chunks

const fs = require('fs');
const { cisvParser } = require('cisv');

const parser = new cisvParser();
for (const chunk of [
  Buffer.from('id,name\n1,'),
  Buffer.from('john\n2,jane\n')
]) {
  parser.write(chunk);
}
parser.end();

console.log(parser.getRows());

Iterator mode (low memory)

const { cisvParser } = require('cisv');

const parser = new cisvParser({ delimiter: ',' });
parser.openIterator('large.csv');

let row;
while ((row = parser.fetchRow()) !== null) {
  if (row[0] === 'stop') break;
}

parser.closeIterator();

Name-based transforms

const { cisvParser } = require('cisv');

const parser = new cisvParser();
parser.setHeaderFields(['id', 'name', 'email']);
parser.transformByName('name', 'uppercase');

const rows = parser.parseString('id,name,email\n1,john,[email protected]');
console.log(rows[1][1]); // JOHN

Notes

  • Returned rows include the header row when the input has one.
  • removeTransform* currently removes JavaScript transforms; C-transform removal by index/name is not fully implemented yet.
  • parse() runs in a worker thread for non-transform workloads; when transforms are attached it preserves current synchronous transform behavior for compatibility.