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

@billdaddy/jsonlkit

v0.1.1

Published

Stream-friendly NDJSON / JSON Lines parsing and serialization for strings, ReadableStreams, and async iterables. Zero dependencies.

Readme

jsonlkit

All Contributors

Stream-friendly NDJSON / JSON Lines parsing and serialization — for strings, ReadableStreams, and async iterables. Zero dependencies.

CI npm version bundle size types license

NDJSON (a.k.a. JSON Lines) is everywhere — LLM batch outputs, structured logs, data exports, dataset shards. Parsing it correctly from a stream means handling lines split across network chunks, multi-byte characters cut in half, CRLF, a BOM, blank lines, and a final record with no trailing newline. jsonlkit handles all of that and reads straight from a fetch body.

import { parseJSONL } from "@billdaddy/jsonlkit";

const res = await fetch(batchOutputUrl);
for await (const row of parseJSONL<ResultRow>(res.body!)) {
  process(row); // one parsed record at a time, constant memory
}

Why jsonlkit?

  • Stream-native. Reads a string, a ReadableStream<Uint8Array | string>, or any (async) iterable, decoding bytes with TextDecoder — even when a multi-byte character is split across chunks.
  • Correct edges. \n / \r\n, leading BOM, blank lines skipped, and a final line without a newline still parsed.
  • Errors you can act on. A JSONLParseError carries the 1-based line number and raw text; or set skipInvalid to tolerate bad lines (with an onError hook).
  • Round-trips. toJSONL / stringifyJSONL write records back out, line by line.
  • Zero dependencies, ESM + CJS + types, and a CLI.

Install

npm install @billdaddy/jsonlkit
# or: pnpm add @billdaddy/jsonlkit  /  yarn add @billdaddy/jsonlkit  /  bun add @billdaddy/jsonlkit

API

parseJSONL(source, options?) → AsyncGenerator<T>

for await (const row of parseJSONL<MyRow>(source, { skipInvalid: true })) { … }

| Option | Type | Default | Description | | ------------- | ------------------------------------- | ------- | ---------------------------------------- | | skipInvalid | boolean | false | Skip unparseable lines instead of throwing. | | onError | (error, line, lineNumber) => void | — | Observe each parse error. | | reviver | (key, value) => unknown | — | Forwarded to JSON.parse. |

toJSONL(items, options?) → string

toJSONL([{ a: 1 }, { b: 2 }]); // '{"a":1}\n{"b":2}\n'

stringifyJSONL(items, options?) → AsyncGenerator<string>

Yields one NDJSON line per record (accepts sync or async iterables) so you can pipe to a writable stream without buffering everything.

createParser(onValue, options?)

The low-level push parser: feed(chunk) for each chunk, then end() to flush a trailing line.

const parser = createParser((row) => handle(row));
socket.on("data", (b) => parser.feed(b.toString("utf8")));
socket.on("end", () => parser.end());

CLI

cat data.jsonl | jsonlkit           # validate + re-emit compact NDJSON
cat data.jsonl | jsonlkit --pretty  # expand each record
cat data.jsonl | jsonlkit --count   # count valid records

Companion packages

Part of the same streaming toolkit as ssekit (Server-Sent Events) and jsonpluck (rescue JSON from messy LLM output).

Contributors ✨

This project follows the all-contributors specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the emoji key for how each contribution is recognized, and open a PR or issue to get involved.

Thanks goes to these wonderful people:

License

MIT © Tung Tran