{ } qjs-modules
Native + JS for QuickJS

The standard library QuickJS deserves.

qjs-modules binds ~33 native quickjs-*.c modules — streams, XML/DOM, archives, sockets, databases, deep object ops — and layers ~45 pure-JS modules on top: WHATWG/W3C/Node-shaped APIs so scripts written for the browser, Bun, Node or Deno run here with minimal changes.

import { ReadableStream } from 'stream';
import { XMLParser } from 'xml';
import * as deep from 'deep';
import { Pointer } from 'pointer';

const doc = { users: [{ id: 1, name: 'Ada' }] };
const ptr = new Pointer(['users', 0, 'name']);

console.log(ptr.deref(doc));           // "Ada"
console.log(deep.find(doc, v => v === 1)); // 1

for (const ev of new XMLParser('<a x="1"/>'))
  console.log(ev.type, ev.eventName);

Design principles

From the project's own CLAUDE.md — the rules that shape every binding added here.

◇

Standards over custom APIs

Priority order: WHATWG > Browser > Bun > Node > Deno. Custom "qjs-modules-isms" are avoided so scripts written for other runtimes run here with minimal changes.

◇

JS-idiomatic, not C++ parity

Bindings prefer plain arrays, iterators and for...of over verbose .get()/.delete()/.size() container APIs — GC does the cleanup a C++ API would make you do by hand.

◇

Two layers, one surface

Native quickjs-*.c modules expose the primitives; lib/*.js wraps them into higher-level, Node/WHATWG-shaped APIs (fs, process, console, dom, …).

◇

Internal vs. public

Modules like deep, predicate, pointer and misc are implementation details other modules build on, not the primary public surface — kept documented, but not layered with extra API just to be "friendly".

What's in here

Every module below is documented in full — constructors, methods, properties and constants each get their own linkable, searchable anchor.

Native modules (~33)

archive, blob, stream, xml, json, bjson, deep, pointer, predicate, tree-walker, child-process, sockets, mysql, pgsql, mmap, gpio, serial, lexer, inspect and more — direct C bindings, one per quickjs-*.c file.

JavaScript layer (~45)

WHATWG/Node polyfills and wrappers: events, url, timers, console, assert, fs, fsPromises, dom, xpath, plus prototype extensions (extendArray, extendMap, …) and the central util helper library.

Full text search is built into every page (press /) — it indexes every module, class and documented member across the whole site, not just page titles.

Get it running

git clone https://github.com/rsenn/qjs-modules
cd qjs-modules

cmake -B build .
make -C build

QUICKJS_MODULE_PATH=$PWD/build qjsm -e "import('deep').then(d => console.log(d.find({a:{b:1}}, v => v === 1)))"

Needs qjsm from rsenn/quickjs (plain qjs lacks process and silently swallows uncaught module errors). Database/serial/archive/magic modules are gated behind CMake options — see Getting started for the full option matrix.