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

@pennsieve/timeseries-zarr-reader

v0.6.0

Published

Reads pyramid Zarr v3 time-series bundles in the browser or Node.js and yields per-channel segments for rendering.

Readme

timeseries-zarr-reader

A framework-agnostic TypeScript library that reads pyramid Zarr v3 bundles of electrophysiology time series in the browser or Node, and produces per-channel segments sized for canvas rendering.

The library takes a Zarr Store and yields Segment and EventBatch async iterables. Level selection, min/max resampling to the pixel grid, bipolar montages, Butterworth filtering, and spike reads all run client-side. A server only has to serve bytes with HTTP Range support.

The bundle format is written and specified by timeseries-zarr-py.

Installation

pnpm add @pennsieve/timeseries-zarr-reader

ESM only, Node 20 or later. In the browser, use any bundler that resolves the exports map.

Quick start

import { StreamingClient, openBundle } from "@pennsieve/timeseries-zarr-reader";

const client = new StreamingClient({
  store: await openBundle("https://example.org/recording.zarr"),
});

const channels = await client.channelInfo();
const continuous = channels.filter((c) => c.kind === "continuous");
const [first] = continuous;
if (!first) throw new Error("bundle has no continuous channels");

// One Segment per channel: raw samples at fine pixel widths, interleaved
// [min, max, ...] envelope pairs at coarse ones.
for await (const segment of client.query({
  channels: continuous.map((c) => c.id),
  startUs: first.startUs,
  endUs: first.startUs + 60_000_000,
  pixelWidthUs: 50_000, // 60 s across 1200 pixels
})) {
  draw(segment);
}

What a caller needs to know

  • All times are UTC microseconds. Sample values stay in each channel's recorded physical unit.
  • The reader picks the coarsest pyramid level that fits the requested pixel width. A montage, a filter, or raw: true forces a raw read instead.
  • Reads of the raw level are capped at 15 MB per query and reject with RawReadTooLargeError before fetching, whether a filter, a montage, or raw: true forced the raw level or the pixel width selected it.
  • Segments are delivered on bin boundaries, so a segment can start before startUs and run past endUs.
  • Filters carry state across consecutive windows, so a trace read window by window matches the same trace read whole.
  • query() reads continuous channels. Unit channels are read with queryUnits().

The full reference is in docs/api.md, including custom stores for authentication and caching.

Development

pnpm, Vitest with v8 coverage, TypeScript strict with ESM and nodenext resolution, ESLint and Prettier.

pnpm check         # the gate: eslint + prettier --check + tsc --noEmit + vitest + build
pnpm test          # vitest only
pnpm build         # tsc -p tsconfig.build.json -> dist/
pnpm typecheck     # tsc --noEmit
pnpm lint          # eslint --fix + prettier --write (rewrites files)
pnpm format:check  # prettier --check (read-only)

src/index.ts re-exports the public API and src/client.ts holds StreamingClient. Tests sit beside the module they cover, as src/<module>.test.ts. The acceptance tests read test-data/sample.zarr, a small bundle committed to the repository; scripts/generate-test-bundle.py documents its contents and rewrites it from a timeseries-zarr-py checkout.

License

Apache-2.0. See LICENSE.