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

@marianmeres/parse-csv

v1.2.0

Published

[![JSR](https://jsr.io/badges/@marianmeres/parse-csv)](https://jsr.io/@marianmeres/parse-csv) [![NPM](https://img.shields.io/npm/v/@marianmeres/parse-csv)](https://www.npmjs.com/package/@marianmeres/parse-csv) [![License: MIT](https://img.shields.io/badge

Readme

@marianmeres/parse-csv

JSR NPM License: MIT

Simple, reliable in-memory CSV parser. Returns a 2D array of strings.

Features

  • Handles quoted fields, escaped quotes (""), and newlines within quotes
  • Supports both CRLF and LF line endings
  • Custom delimiter support (comma, semicolon, tab, pipe, etc.)
  • Automatically strips UTF-8 BOM (common in Excel exports)
  • Zero dependencies — fully portable to npm/Node.js
  • TypeScript, with full type definitions

Note on portability: This parser intentionally does not use Deno's @std/csv. This is a deliberate choice to keep the package fully portable to npm/Node.js without ecosystem-specific dependencies.

In-memory limitation: The parser loads the entire CSV string into memory and processes it at once. It is not designed for streaming or very large datasets. For typical application data (configs, exports, reports) this is perfectly fine. If you need to process huge files (hundreds of MB+), consider a streaming parser instead.

Design philosophy

This parser intentionally does one thing: it turns a CSV string into a string[][]. That's it. There is no header parsing, no column count validation, and no type coercion. Whether row 0 is a header is a semantic decision — it belongs to the consumer, not the parser. The same goes for ragged rows (real-world CSVs are often messy) and value types (numbers, dates, booleans).

That said, mapping headers to record keys is such a common need that the package ships a thin convenience wrapper — parseCsvWithHeader — so you don't have to write it yourself.

Installation

# Deno
deno add jsr:@marianmeres/parse-csv

# npm
npm install @marianmeres/parse-csv

Quick Start

import { parseCsv } from "@marianmeres/parse-csv";

const csv = `name,age,city
Alice,30,Bratislava
Bob,25,"London"`;

const rows = parseCsv(csv);
// [
//   ["name", "age", "city"],
//   ["Alice", "30", "Bratislava"],
//   ["Bob", "25", "London"],
// ]

Header mode

import { parseCsvWithHeader } from "@marianmeres/parse-csv";

const csv = `name,age,city
Alice,30,Bratislava
Bob,25,"London"`;

const records = parseCsvWithHeader(csv);
// [
//   { name: "Alice", age: "30", city: "Bratislava" },
//   { name: "Bob", age: "25", city: "London" },
// ]

Custom delimiter

// European-style semicolon-separated
const rows = parseCsv("name;age;city\nAlice;30;Bratislava", { delimiter: ";" });

// Tab-separated (TSV)
const rows = parseCsv("col1\tcol2\nval1\tval2", { delimiter: "\t" });

API

parseCsv(text, options?)

function parseCsv(text: string, options?: ParseCsvOptions): string[][];

Parameters:

| Name | Type | Description | | ------------------- | -------- | -------------------------------- | | text | string | Raw CSV string to parse | | options.delimiter | string | Field delimiter (default: ",") |

Returns: string[][] — array of rows, each row an array of field strings.

parseCsvWithHeader(text, options?)

function parseCsvWithHeader(text: string, options?: ParseCsvOptions): Record<string, string>[];

Thin wrapper around parseCsv. Treats the first row as column headers and returns an array of objects keyed by those headers. Missing fields in shorter rows default to "".

Parameters: Same as parseCsv.

Returns: Record<string, string>[] — array of records keyed by header names.

License

MIT