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

@distilled.cloud/iceberg

v1.0.0-rc.16

Published

Downloads

210,717

Readme

@distilled.cloud/iceberg

Effect-native SDK for the Apache Iceberg REST Catalog API, generated from the Apache Iceberg OpenAPI spec. One client for every Iceberg REST catalog: Cloudflare Basin Catalog, Apache Polaris, Nessie, Unity Catalog, the Iceberg endpoints of AWS Glue and S3 Tables, and the reference REST catalog.

Installation

npm install @distilled.cloud/iceberg effect

Quick start

import { Effect, Layer } from "effect";
import * as FetchHttpClient from "effect/http/FetchHttpClient";
import * as Iceberg from "@distilled.cloud/iceberg";

const program = Effect.gen(function* () {
  yield* Iceberg.createNamespace({ namespace: ["analytics"] });

  const table = yield* Iceberg.createTable({
    namespace: "analytics",
    name: "page_views",
    schema: {
      type: "struct",
      fields: [
        { id: 1, name: "user_id", type: "string", required: true },
        { id: 2, name: "path", type: "string", required: true },
        { id: 3, name: "at", type: "timestamptz", required: true },
      ],
    },
  });

  return table.metadata_location;
});

const Live = Layer.mergeAll(
  FetchHttpClient.layer,
  Iceberg.CredentialsFromEnv,
  Iceberg.IcebergProtocol,
);

program.pipe(Effect.provide(Live), Effect.runPromise);

Operations are exported at the package root: createNamespace, listNamespaces, createTable, loadTable, updateTable, commitTransaction, dropTable, views, scan planning, and the rest of the spec's 34 routes. List operations stream every page with .pages() and .items():

const tables = yield* Iceberg.listTables.items({ namespace: "analytics" }).pipe(Stream.runCollect);

Errors

Each operation's error channel names the exceptions the spec documents for it, matched on the response's error.type:

yield* Iceberg.loadTable({ namespace: "analytics", table: "page_views" }).pipe(
  Effect.catchTag("NoSuchTableException", () => Effect.succeed(undefined)),
);

A commit (updateTable, commitTransaction, replaceView) answered with 500, 502 or 504 fails with CommitStateUnknownException: the commit may or may not have been applied, so it is never retried automatically. Reload the table before deciding what to do.

Auth and catalog configuration

| Variable | Required | Meaning | | --- | --- | --- | | ICEBERG_CATALOG_URI | yes | The catalog's REST endpoint, without /v1. | | ICEBERG_TOKEN | no | Sent as Authorization: Bearer <token>. | | ICEBERG_PREFIX | no | The warehouse prefix every catalog route is scoped to. |

Catalogs scope their routes to a warehouse prefix that they return from GET /v1/config. fromCatalogConfig resolves it from a warehouse name, the way Iceberg clients do. For Cloudflare Basin Catalog:

const Catalog = Iceberg.fromCatalogConfig({
  uri: "https://catalog.cloudflarestorage.com/<account_id>/<bucket>",
  warehouse: "<account_id>_<bucket>",
  token: Redacted.make(process.env.CLOUDFLARE_API_TOKEN!),
});

program.pipe(
  Effect.provide(Iceberg.IcebergProtocol),
  Effect.provide(Catalog),
  Effect.provide(FetchHttpClient.layer),
  Effect.runPromise,
);

Multipart namespaces are one string in route parameters, with parts separated by the unit separator ("accounting\u001ftax"), and an array in request bodies (["accounting", "tax"]).