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

fastest-csv

v0.2.1

Published

Fastest CSV parser — zero dependencies, 100+ lines, <1KB gzip

Readme

fastest-csv ⚡

轻量,极速,0依赖。 Lightweight, blazing fast, zero dependencies.

Benchmark

12.4MB CSV, 100000 rows, 10 cols (50% "quotes")

fastest-csv fastMode  █████                         162ms  🥇🏆
fastest-csv           ████████████                  352ms  🥉
PapaParse fastMode    ███████████                   328ms  2.0x slower
PapaParse             ██████████████                411ms  2.5x slower
csv-parse             ████████████████████████████  836ms  5.2x slower

fastMode (不解析引号 - no quote parsing)

Quick Start

npm install fastest-csv
import { parseCSV } from 'fastest-csv'

const { headers, rows } = parseCSV(`name,age,city
Alice,30,New York
Bob,25,London`)

// headers: ['name', 'age', 'city']
// rows: [
//   { name:'Alice', age:'30', city:'New York' },
//   { name:'Bob', age:'25', city:'London' }
// ]

API

parseCSV(text, options?)

| 参数Param | 类型Type | 默认值Default | 说明Description | | ------------- | --------------------- | ----------------- | --------------------------------------------------------- | | text | string | '' | CSV 文本CSV text | | separator | string | ',' | 列分隔符,任意单字符Column delimiter, any single char | | fastMode | boolean | false | 不解析引号,性能最佳Skip quote parsing, fastest mode | | headers | string[] | [] | 预设表头Preset headers | | onHeader | (v, k, i) => string | String | 表头转换钩子Header transform hook | | onValue | (v, k, i) => any | String | 值转换钩子Value transform hook |

return { headers: string[], rows: Record<string, any>[] }

Recipes

// 自动转类型 - Auto-type on parse
parseCSV('name,age\nAlice,18', {
  onValue: (v) => (isNaN(v) ? v : Number(v)),
})

// 重命名表头 - Rename headers
parseCSV('name,age\nAlice,18', {
  onHeader: (h) => h.toLowerCase(),
})

// 预设表头 - Preset headers
parseCSV('Alice,18', { headers: ['name', 'age'] })

// 任意分隔符 - Any delimiter
parseCSV('a;b;c\n1;2;3', { separator: ';' })

// fastMode:不解析引号,性能最佳 - Fastest mode (no quote parsing)
parseCSV('a,b\n1,2', { fastMode: true })

Features

  • ✅ 标准 CSV - Standard CSV
  • ✅ 任意分隔符 - Any delimiter
  • ✅ 引号字段 - Quoted fields
  • ✅ 转义引号 """ - Escaped quotes
  • ✅ 引号内换行 - Newlines in quotes
  • ✅ 换行符全兼容 \n \r\n \r - All line endings
  • ✅ 转换钩子 onHeader onValue - Transform hooks
  • ✅ 极速模式(不解析引号)- Fastest mode (no quote parsing)
  • ✅ 零依赖 - Zero dependencies
  • ✅ 浏览器 / Node.js / Deno / Bun - Any JS runtime
  • ✅ ES Module
  • ✅ TypeScript

Test

# npm run test
node --test tests/fastest-csv.test.js

全部代码分支覆盖,全绿。 All branches covered, all green.

License

MIT