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

delta-ts

v0.1.0

Published

Lightweight TypeScript reader for Delta Lake tables

Readme

delta-ts

Lightweight, read-only TypeScript library for Delta Lake tables.

  • Runtime-agnostic — works in Node.js, Deno, Bun, browsers, and edge runtimes (no fs dependency)
  • Minimal dependencies — only hyparquet (Parquet reader) and @praha/byethrow (Result type)
  • Type-safe error handling — all fallible operations return Result<T, E> instead of throwing

Install

npm install delta-ts

Quick Start

import { DeltaTable, Result } from "delta-ts";

// Open a table from a URL
const result = await DeltaTable.open({
  url: "https://example.com/path/to/delta-table",
});

if (Result.isSuccess(result)) {
  const table = result.value;

  console.log("Version:", table.version());
  console.log("Schema:", table.schema());
  console.log("Files:", table.filePaths());
  console.log("Partitions:", table.partitionColumns());
  console.log("Records:", table.numRecords());
}

Usage

Opening a Table

// From a URL (uses fetch internally)
const result = await DeltaTable.open({ url: "https://..." });

// With a custom fetch implementation
const result = await DeltaTable.open({
  url: "https://...",
  fetchImpl: myCustomFetch,
});

// With a custom store
const result = await DeltaTable.open({ store: myStore });

Time Travel

const table = Result.unwrap(await DeltaTable.open({ url: "https://..." }));

// Read a specific version
const v0Result = await table.atVersion(0);
if (Result.isSuccess(v0Result)) {
  console.log("Files at v0:", v0Result.value.filePaths());
}

Error Handling

All operations return Result<T, E> from @praha/byethrow. Errors are plain objects with a type discriminant:

const result = await DeltaTable.open({ url: "https://..." });

if (Result.isFailure(result)) {
  switch (result.error.type) {
    case "TABLE_NOT_FOUND":
    case "STORE_ERROR":
    case "LOG_NOT_FOUND":
    case "UNSUPPORTED_PROTOCOL":
    case "SCHEMA_PARSE_ERROR":
      console.error(result.error.message);
      break;
  }
}

Custom Store

Implement the DeltaStore interface to read from any storage backend (S3, GCS, local filesystem, etc.):

import type { DeltaStore } from "delta-ts";
import { Result } from "@praha/byethrow";

const myStore: DeltaStore = {
  read: async (path) => Result.succeed(/* file content as string */),
  readBytes: async (path, start?, end?) => Result.succeed(/* ArrayBuffer */),
  list: async (directory) => Result.succeed(/* string[] of filenames */),
  exists: async (path) => /* boolean */,
  fileSize: async (path) => Result.succeed(/* number */),
};

const result = await DeltaTable.open({ store: myStore });

API

DeltaTable.open(options)

Opens a Delta table and returns the latest snapshot.

  • options.url — Base URL of the Delta table
  • options.store — Custom DeltaStore implementation
  • options.fetchImpl — Custom fetch function (defaults to globalThis.fetch)

Returns ResultAsync<DeltaTable, OpenError>

DeltaTable Instance

| Method | Return Type | Description | |---|---|---| | version() | number | Current snapshot version | | schema() | StructType | Table schema | | metadata() | MetadataAction | Table metadata | | protocol() | ProtocolAction | Protocol version info | | files() | AddAction[] | Active file entries | | filePaths() | string[] | Active file paths | | partitionColumns() | string[] | Partition column names | | numRecords() | number \| null | Total record count (null if stats unavailable) | | atVersion(v) | ResultAsync<DeltaTable, Error> | Time-travel to version v |

Supported Features

  • JSON transaction log reading and replay
  • Parquet checkpoint files
  • Add/remove file reconciliation
  • Deletion vectors (parsed, not applied)
  • Schema parsing (struct, array, map, primitives)
  • Protocol version gating (reader version 1)

License

MIT