{ } qjs-modules

JavaScript Modules

Pure JavaScript modules (lib/*.js) providing polyfills for standard APIs, wrappers around native modules, and prototype extensions.

Complete List

Core & Language Extensions

Prototype Extensions

Runtime / Node.js Compatible

  • assert — Node.js assert module
  • console — WHATWG Console API
  • process — Node.js process object
  • readline — Node's readline
  • readlinePromises — readline/promises
  • events — Node.js EventEmitter
  • abort — AbortController/AbortSignal
  • timers — HTML5 Timers API (setTimeout, setInterval, etc.)
  • perf_hooks — Performance hooks
  • module — Module utilities, registerHooks()
  • bun — the Bun global: Bun.plugin() runtime plugins, Bun.file(), Bun.write()
  • node — Node compatibility qjsm loads at startup: the node:/node_modules/CommonJS loaders and Node's globals
  • loaders/commonjs — commonjs module format loader (registerHooks())
  • loaders/file — with { type: 'file' } imports, as in Bun (registerHooks())
  • loaders/typescript — .ts loader, types stripped by node's module.stripTypeScriptTypes (registerHooks())
  • loaders/packages — node_modules and package.json exports/imports/main, Node's ESM resolution (registerHooks(), preloaded)
  • globals — web/Node globals (URL, structuredClone, crypto, Intl, ...), installed by node
  • intl — Intl (ECMA-402) with English data: NumberFormat, DateTimeFormat, PluralRules, Collator, ListFormat, RelativeTimeFormat, Locale
  • jsonStreams — Deno's JsonParseStream, ConcatenatedJsonParseStream, JsonStringifyStream
  • string_decoder — Node's string_decoder (StringDecoder)
  • textLineStream — Deno's TextLineStream
  • timersPromises — timers/promises
  • wasi — WASI (Node's node:wasi, preview1), portable: qjsm, node, bun, deno
  • webassembly — the WebAssembly global over the wasm module (opt-in)
  • loaders/wasm — .wasm ES module loader (registerHooks(), opt-in)
  • require — CommonJS require
  • stack — Stack utilities

I/O & Filesystem

  • fs — Node.js fs module (wraps native modules)
  • fsPromises — Promise-based fs API
  • io — I/O utilities
  • stream — WHATWG Streams API (ReadableStream, WritableStream, TransformStream)
  • streams — Stream utilities
  • vfs — Virtual filesystem
  • glob — glob patterns: match(), directory scans (Bun.Glob)
  • json5 — JSON5.parse/stringify (Bun.JSON5)
  • jsonc — JSONC.parse, JSON with comments and trailing commas (Bun.JSONC)
  • inotify — inotify wrapper
  • tty — TTY utilities
  • terminal — Terminal utilities
  • socklen_t — Socket length type

Node and Bun Parts

How much of Node's, Bun's and Deno's surface this adds up to: runtime-compat.

Parsing, DOM & Selectors

  • dom — W3C DOM API (wraps native modules)
  • xpath — XPath implementation
  • parser — Parser combinator framework
  • grammar — Grammar utilities
  • lex — lex/flex .l files: lexer, parser (AST), generated lexers
  • grammar-parsers — BNF, EBNF, ANTLR .g4 and yacc/jison files to an AST
  • parse-ast — parse sources with a grammar file, print the tree as JSON (utilities/parse-ast.js)
  • module-lexer — imports and exports of a JS source as records (ES module and CommonJS), print(), merge()
  • css3-selectors — CSS3 selector engine
  • url — WHATWG URL API (polyfill)

Databases

  • sql — Bun bun:sql-flavored tagged-template client unifying sqlite/pgsql/mysql
  • db — Database utilities
  • database — bun:sqlite-style Database and Statement over the sqlite module
  • dbi — database-independent Database/Result over sqlite, mysql and pgsql

Tooling

  • repl — REPL implementation
  • lexers — Lexer for a file or language name

Utilities

  • describe — describeClass()/describeObject(), also a command-line tool that dumps an API in qjsm, node, bun, deno
  • c-functions — find C function definitions and prototypes in a source
  • magic-string — bundled magic-string: edit a string by index, generate a source map
  • tinytest — the zero-dependency test library of tests/unittests/
  • simple-queue — the Chromium SimpleQueue behind the streams
  • file — the WHATWG File
  • lazyGlobal — define a global that loads its module on first read

Module Classification

Polyfills (Standalone JS)

Pure JavaScript implementations of standard APIs with no native dependencies:

  • WHATWG/W3C/HTML5: events, url, timers, abort, console
  • ECMA-402: intl (English only)
  • Node.js: assert, fs (partial), process (partial)
  • Utilities: iterator, asyncIterator

Wrappers (Wrap Native Modules)

JavaScript code that wraps native modules to provide higher-level APIs:

  • fs — Wraps misc, mmap, syscallerror
  • fsPromises — Wraps fs
  • dom — Wraps fs, util, timers, css3-selectors, deep, pointer, tree-walker, xml, url
  • console — Wraps os, util, inspect, std
  • process — Wraps os, path, util, misc, std
  • assert — Wraps util
  • util — Wraps misc, timers

Prototype Extensions

Extend built-in JavaScript prototypes (Array, Object, Map, etc.):

  • extendArray, extendArrayBuffer, extendMap, extendSet
  • extendFunction, extendAsyncFunction, extendGenerator, extendAsyncGenerator

Statistics

  • Total JS modules: 75 files in lib/, 79 docs
  • Polyfills: 26 (standalone JS implementations)
  • Wrappers: 32 (wrap native modules)
  • Extensions: 10 (prototype extensions)

Standards Compliance

  • WHATWG/W3C/HTML5: events, url, timers, abort, console, dom
  • Node.js: assert, fs, fsPromises, process, events, util
  • Custom: Many utility modules (see api-compatibility.md)