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

@slothdb/wasm

v0.2.3

Published

Fast embedded SQL database in WebAssembly. Query Parquet, CSV, JSON, Arrow, SQLite, and Excel files directly from SQL - no server, no install. A DuckDB alternative built from scratch: up to 5x faster on real workloads (16-query suite median 1.70x).

Readme

@slothdb/wasm

Fast embedded SQL database in WebAssembly. Query Parquet, CSV, JSON, Arrow, SQLite, and Excel files directly from SQL — no server, no install, 1.3 MB wasm.

npm License

  • Website: https://slothdb.org
  • Try it live: https://slothdb.org/playground
  • GitHub: https://github.com/SouravRoy-ETL/slothdb

SlothDB is a full analytical SQL engine compiled to WebAssembly. It reads seven file formats natively, runs in Node ≥18 and every modern browser, and runs 1.1×–8.6× faster than DuckDB on the benchmarked formats in its native build. The WASM build is single-threaded; expect browser-scale latencies, not native-scale.

Install

npm install @slothdb/wasm

No native dependencies. Works on Linux, macOS, Windows (and WSL).

Quick start

import { SlothDB } from '@slothdb/wasm';
import fs from 'node:fs/promises';

const db = await SlothDB.create();

// Load a file into the virtual filesystem:
const parquet = await fs.readFile('./sales.parquet');
db.loadFile('/data/sales.parquet', parquet);

// Query it:
const { columns, rows, ms } = db.query(`
    SELECT region, SUM(revenue) AS total
    FROM '/data/sales.parquet'
    GROUP BY region
    ORDER BY total DESC
`);

console.log(columns);  // ['region', 'total']
console.log(rows);     // [['EU', '14184859'], ['NA', '12295714'], ...]
console.log(`ran in ${ms.toFixed(1)} ms`);

File formats supported

All seven formats work directly from SQL by file path — no CREATE TABLE, no COPY FROM.

| Format | Example | |---|---| | Parquet | SELECT * FROM '/data.parquet' | | CSV / TSV | SELECT * FROM '/data.csv' | | JSON / NDJSON | SELECT * FROM '/data.json' | | Apache Arrow IPC | SELECT * FROM '/data.arrow' | | Avro | SELECT * FROM '/data.avro' | | SQLite | SELECT * FROM sqlite_scan('/app.db', 'users') | | Excel (.xlsx) | SELECT * FROM '/report.xlsx' |

SQL features

SELECT, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET. Joins (INNER / LEFT / RIGHT / FULL / NATURAL / USING). CTEs including recursive. Window functions with QUALIFY. Set operations (UNION / INTERSECT / EXCEPT). MERGE. CAST. 70+ scalar functions — string, math, date/time, regex. DuckDB-compatible DATE_TRUNC with all intervals (MICROSECOND through MILLENNIUM), plus MONTHNAME, DAYNAME, LAST_DAY, MAKE_DATE.

Full SQL reference: https://slothdb.org/docs.html

Browser usage

SlothDB works the same in the browser — the only differences are that you load files via fetch/<input type="file"> instead of fs, and the package needs to be served over HTTP (not file://).

import { SlothDB } from '@slothdb/wasm';

const db = await SlothDB.create();

const response = await fetch('/data/sales.parquet');
const buffer = new Uint8Array(await response.arrayBuffer());
db.loadFile('/data/sales.parquet', buffer);

const result = db.query("SELECT COUNT(*) FROM '/data/sales.parquet'");

With Vite / webpack / esbuild, slothdb.wasm is loaded automatically alongside slothdb.js via the bundler's asset handling. No special config required for the common cases; see https://slothdb.org/docs.html for bundler-specific notes.

API

SlothDB.create(options?)

Boot a new in-memory database. Returns Promise<SlothDB>.

  • options.moduleOptions — pass-through to the underlying Emscripten Module factory. Rarely needed.

db.query(sql)

Execute a SQL statement. Returns:

{
    columns: string[];
    rows: (string | null)[][];
    ms: number;         // engine-side execution time
    rowCount: number;
}

All non-NULL values come back as strings to preserve full precision. Cast at the JS layer (Number(v), BigInt(v)) as needed.

Throws Error on SQL error; the thrown error includes .ms and .sql properties for diagnostics.

db.loadFile(path, data)

Write a byte buffer (or string) to a virtual path. Accepts Uint8Array, ArrayBuffer, or string. Absolute paths required (starting with /).

db.readFile(path)

Read a file back from the virtual filesystem. Returns Uint8Array.

db.version()

Returns the engine version string, e.g. "0.1.5".

Limitations of the WASM build

  • Single-threaded. Native SlothDB uses parallel readers; the WASM build does not (SharedArrayBuffer/COOP-COEP overhead isn't worth it for playground-scale workloads).
  • No HTTP reads. FROM 'https://example.com/data.csv' returns an error. Fetch the file in JS and load it via loadFile instead.
  • Memory cap. Starts at 64 MB, grows to a 2 GB hard cap. Plenty for most analytical workloads; too small for a 10 GB Parquet.

For the full feature set (threading, HTTP reads, extensions) use the native library: https://slothdb.org.

License

MIT. Copyright (c) 2026 Sourav Roy. See LICENSE.