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

@jr200-labs/xstate-duckdb

v2.0.3

Published

XState machine for DuckDB

Downloads

1,537

Readme

@jr200-labs/xstate-duckdb

A state machine for managing DuckDB operations in web applications. This library provides a type-safe interface for database initialization, query execution, transaction management, and table catalog operations.

Features

  • State Management: Full XState integration for predictable database state management
  • DuckDB Integration: Built on top of @duckdb/duckdb-wasm for browser-based analytics
  • Transaction Support: Complete transaction lifecycle management (begin, execute, commit, rollback)
  • Table Catalog: Dynamic table loading, versioning, and management
  • Type Safety: Full TypeScript support with comprehensive type definitions
  • Multiple Data Formats: Support for Arrow IPC and JSON data formats
  • Compression: Built-in support for data compression (zlib)
  • Real-time Updates: Subscription-based table change notifications
  • Optimistic Projections: Typed local operations over authoritative DuckDB views with acknowledgement and reconciliation

Installation

npm install @jr200-labs/xstate-duckdb
# or
yarn add @jr200-labs/xstate-duckdb
# or
pnpm add @jr200-labs/xstate-duckdb

Peer dependencies

@duckdb/duckdb-wasm, apache-arrow, @opentelemetry/api, and @opentelemetry/api-logs are declared as peer dependencies and must be installed directly by the consumer. This guarantees a single resolved version across the dependency tree -- preventing the class of bug where a transitive copy of DuckDB-wasm diverges from the .wasm assets the consumer actually ships.

pnpm add @duckdb/duckdb-wasm apache-arrow @opentelemetry/api @opentelemetry/api-logs

Supported ranges:

| Peer | Range | | ------------------------- | --------------------- | | @duckdb/duckdb-wasm | >=1.33.1-dev42.0 <2 | | apache-arrow | >=21 <22 | | @opentelemetry/api | ^1.10.0 | | @opentelemetry/api-logs | ^0.223.0 |

This version requires OpenTelemetry API 1.10.0 or newer within major 1 and OpenTelemetry Logs API 0.223.x. Consumers using API 1.9.x or Logs API 0.222.x must upgrade those direct dependencies together with this package.

Documentation and live demo

The Quarto documentation lives in docs/, with guides for getting started, queries and transactions, the catalog, observability, and optimistic projections.

The interactive React example now lives in docs/demo/. It runs DuckDB in the visitor's browser and displays a live XState lifecycle diagram alongside query, transaction, and catalog controls.

pnpm install --frozen-lockfile
pnpm demo:dev       # library build + Vite demo
pnpm docs:preview   # Quarto docs with embedded production demo
pnpm docs:build     # static site in docs/_site
pnpm test

Documentation builds require Node.js 22+ and Quarto. Quarto's pre-render hook builds the library and demo automatically. Generated files are not committed.

Publishing

.github/workflows/bespoke_docs.yaml validates the site on pull requests and uses GAT's reusable Quarto publisher on master. The caller includes library and lockfile changes as well as docs, so the demo is rebuilt when its code changes. GAT publishes the rendered site to gh-pages. Configure GitHub Pages to serve that branch's root directory. The demo uses relative asset paths so the site works beneath the project's GitHub Pages path.

Contributing

Contributions welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.