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

firebird-wasm

v0.3.0

Published

Firebird embedded database in WebAssembly — runs in the browser and Node, like PGlite for PostgreSQL

Readme

firebird-wasm

Firebird Embedded for Node.js / TypeScript — a PGlite-inspired wrapper around the Firebird embedded engine.

Status: Alpha — API may change before 1.0.

Installation

npm install firebird-wasm

The package ships the compiled WASM engine, so the browser backend needs nothing else — no Emscripten, no Firebird installation, no server.

The Node backend (FirebirdLite, below) is different: it talks to a real Firebird through node-firebird-driver-native, which needs the Firebird client library (libfbclient.so / fbclient.dll) on the host. That is an optional dependency, so if you only want the browser engine, skip it:

npm install firebird-wasm --omit=optional

See Firebird installation if you do want the native path.

Two backends

| Import | Engine | Needs | |--------|--------|-------| | firebird-wasm | Native driver → a real Firebird server | Firebird client library | | firebird-wasm/browser | Firebird 6.0 compiled to WebAssembly | A browser, or Node |

The rest of this file documents the Node backend. For the browser engine — which is what the package is named after — see the integration guide, or try the live demo.

import { FirebirdBrowser } from 'firebird-wasm/browser';

const db = new FirebirdBrowser('mydb', {
  worker: new Worker('/firebird-engine-worker.js'),
});

await db.exec('CREATE TABLE notes (id INTEGER, title VARCHAR(200))');
await db.exec('INSERT INTO notes VALUES (?, ?)', [1, 'Hello']);

const { rows } = await db.query('SELECT * FROM notes');
// [{ ID: 1, TITLE: 'Hello' }]

Two constraints are structural rather than incidental: the page must be cross-origin isolated, and the engine must run in a Worker — it blocks on mutexes, and a browser main thread may not block.

Quick start

import { FirebirdLite } from 'firebird-wasm';

// Connect to a Firebird server (embedded or remote)
const db = new FirebirdLite('localhost:/tmp/my-app.fdb', {
  username: 'SYSDBA',
  password: 'masterkey',
});

// DDL
await db.exec('CREATE TABLE items (id INTEGER, name VARCHAR(100))');

// Parameterised INSERT
await db.query('INSERT INTO items VALUES (?, ?)', [1, 'hello']);

// SELECT
const result = await db.query('SELECT id, name FROM items ORDER BY id');
console.log(result.rows);
// → [ { ID: 1, NAME: 'hello' } ]

// Column metadata
console.log(result.fields);
// → [ { name: 'ID' }, { name: 'NAME' } ]

// Transactions
await db.transaction(async (tx) => {
  await tx.exec('UPDATE items SET name = ? WHERE id = ?', ['world', 1]);
  // automatically committed on success, rolled back on error
});

await db.close();

API

new FirebirdLite(uri, options?)

| Parameter | Type | Description | |-----------|------|-------------| | uri | string | Database URI — e.g. localhost:/path/to/db.fdb or just /path/to/db.fdb for embedded mode | | options.username | string? | Firebird user name (default: 'SYSDBA') | | options.password | string? | Firebird password | | options.libraryPath | string? | Override the path to libfbclient.so | | options.charset | string? | charSetForNONE encoding for NONE-charset columns |

db.exec(sql)

Execute a DDL or DML statement in its own auto-committed transaction.

db.query<T>(sql, params?, options?)

Execute a query and return a QueryResult<T>:

interface QueryResult<T> {
  rows: T[];       // result rows keyed by UPPER-CASE column name
  fields: FieldInfo[];  // column metadata
}

db.transaction(fn, options?)

Run an async function inside a transaction. Automatically committed on success; rolled back on error.

await db.transaction(async (tx) => {
  await tx.exec('INSERT INTO t VALUES (?)', [1]);
  await tx.query('SELECT cnt FROM t');
});

db.close()

Disconnect from the database and release all resources.

Embedded mode

Using the Firebird embedded engine provides a single-process, single-user database without needing a Firebird server. Pass a plain file path (no host: prefix):

const db = new FirebirdLite('/tmp/my.fdb', {
  username: 'SYSDBA',
  password: '',
});

Requires the engine plugin alongside libfbclient.solibEngine12.so on Firebird 3, libEngine13.so on Firebird 4 and 5. This is the native embedded engine; for the WASM one, no Firebird install is involved at all.

Testing

FIREBIRD_PASSWORD=masterkey npm test

Roadmap

Shipped in 0.1.0 — every item the previous roadmap listed as pending, except the last:

  • [x] True WASM build — Firebird 6.0 compiled with Emscripten
  • [x] Browser support via the WASM bundle, with the engine in a Web Worker
  • [x] IndexedDB-backed persistence — atomic, incremental, and automatic
  • [x] Parameterised queries, transactions, and multi-statement scripts
  • [x] Typed column metadata; exact BIGINT/NUMERIC/DECFLOAT as decimal strings
  • [x] Multi-tab safety — a cross-tab lock refuses a second writer rather than letting it overwrite the first
  • [x] The prebuilt engine on npm, so using it needs no Emscripten

Next:

  • [ ] Live queries built on Firebird's POST_EVENT
  • [ ] Multi-tab sharing — a SharedWorker leader, so a second tab is served rather than refused
  • [ ] OPFS backend — a better match for page-oriented I/O than IndexedDB
  • [ ] A typed binary result ABI, so exact numerics need not travel as strings
  • [ ] Module disposal — close() does not currently release the WASM heap
  • [ ] Loadable character sets. src/intl compiles under Emscripten and costs +245 KB gzipped, measured; what is missing is a way for IntlManager to reach it without dlopen. See docs/roadmap.md
  • [ ] ElectricSQL sync

"Firebird 4 & 5 support" is gone from this list because it was never the gap. The build tracks Firebird master and the shipped engine reports ENGINE_VERSION 6.0.0. What is actually missing is a build matrix across versions, not initial support for them.

Fuller status, and a feature-by-feature comparison with PGlite, in docs/roadmap.md.

License

Apache-2.0