// "The browser shouldn't limit you."

Node's node:* standard library,
in 100% pure Vanilla JavaScript.

vbs (Vanilla Browser Server) is a layered, client-only runtime engine implementing node:https, node:http, node:fs, node:crypto, node:stream, and node:buffer using native Web APIs. Zero npm packages. Zero bundler. Zero edge server.

Engine: vbs v0.1.0 active Disk (OPFS): checking… SW Port Gateway: checking… Active Virtual Ports: none

4-Layer Client-Only Architecture

Every layer is plain ES Modules running directly inside the browser tab—even offline.

LAYER 3 · src/net/
Networking
node:https · node:http

Full createServer, request, and get. Routes virtual ports & /etc/hosts locally; streams public HTTPS APIs via fetch().

LAYER 2 · src/sys/
System & Disk
node:fs · node:crypto · node:os

Sync readFileSync/writeFileSync backed by persistent browser OPFS, plus synchronous SHA-256 & HMAC-SHA256.

LAYER 1 · src/core/
Core Primitives
events · buffer · stream · path · url · util

EventEmitter, Uint8Array-backed Buffer, async-iterable Readable/Writable streams, and POSIX paths.

LAYER 0 · src/kernel/
Switchboard Kernel
process · switchboard · sw.js

In-memory loopback, live /etc/hosts DNS, BroadcastChannel multi-tab RPC, and Service Worker /__vbs/:port/* routing.

Zero-Build Quickstart

Paste this native <script type="importmap"> into any static .html file—no npm install or bundler needed.

index.html
<script type="importmap">
{
  "imports": {
    "node:events": "https://vbs.jao.life/src/core/events.js",
    "node:buffer": "https://vbs.jao.life/src/core/buffer.js",
    "node:path":   "https://vbs.jao.life/src/core/path.js",
    "node:stream": "https://vbs.jao.life/src/core/stream.js",
    "node:fs":     "https://vbs.jao.life/src/sys/fs.js",
    "node:crypto": "https://vbs.jao.life/src/sys/crypto.js",
    "node:http":   "https://vbs.jao.life/src/net/http.js",
    "node:https":  "https://vbs.jao.life/src/net/https.js"
  }
}
</script>

<script type="module">
  import https from "node:https";
  import fs from "node:fs";

  fs.writeFileSync("/etc/hosts", "127.0.0.1:8443 api.vbs.local\n");

  https.createServer((req, res) => {
    res.writeHead(200, { "Content-Type": "application/json" });
    res.end(JSON.stringify({ hello: "from pure Vanilla JS", url: req.url }));
  }).listen(8443, () => {
    https.get("https://api.vbs.local/ping", (res) => {
      res.setEncoding("utf8");
      res.on("data", console.log);
    });
  });
</script>

Live In-Browser Demos

Every demo below executes real import ... from "node:*" code directly inside your browser right now.

1. Virtual node:https Server + /etc/hosts DNS
Starts an HTTPS server on virtual port :8443, signs headers with crypto.createHmac, and queries https://api.vbs.local with zero edge server.
import https from "node:https";
import fs from "node:fs";
import crypto from "node:crypto";

// Map custom local domain in virtual /etc/hosts
fs.writeFileSync("/etc/hosts", "127.0.0.1:8443 api.vbs.local\n");

const server = https.createServer((req, res) => {
  const hmac = crypto.createHmac("sha256", "vbs-key")
    .update(req.url).digest("hex").slice(0, 16);
  res.writeHead(200, {
    "Content-Type": "application/json",
    "X-VBS-Signature": hmac
  });
  res.end(JSON.stringify({
    server: "vbs/0.1.0",
    method: req.method,
    url: req.url,
    tls: req.socket.encrypted,
    cert: req.socket.getPeerCertificate().subject.CN
  }, null, 2));
});

server.listen(8443);
https.get("https://api.vbs.local/v1/inspect?mode=client-only", ...);
// Click "Run Demo" to boot :8443 and send a live HTTPS request…
2. Synchronous node:fs + Persistent Browser Disk (OPFS)
Increments a JSON counter synchronously via fs.readFileSync / fs.writeFileSync—reload the tab and watch the count persist!
import fs from "node:fs";
import crypto from "node:crypto";

const file = "/home/vbs/counter.json";
const prev = fs.existsSync(file)
  ? JSON.parse(fs.readFileSync(file, "utf8"))
  : { runs: 0 };

const next = {
  runs: prev.runs + 1,
  updatedAt: new Date().toISOString(),
  sha256: crypto.createHash("sha256")
    .update(String(prev.runs + 1)).digest("hex").slice(0, 16)
};

fs.writeFileSync(file, JSON.stringify(next, null, 2));
console.log(fs.readdirSync("/home/vbs"));
console.log(fs.readFileSync(file, "utf8"));
// Click "Write & Read Disk" to test sync fs + OPFS persistence…
3. Outbound https.get() Streaming (Public npm Registry)
Streams real HTTPS chunks from registry.npmjs.org through Node res.on("data") + Buffer.concat().
import https from "node:https";
import { Buffer } from "node:buffer";

https.get("https://registry.npmjs.org/cf/latest", (res) => {
  const chunks = [];
  res.on("data", (chunk) => chunks.push(chunk));
  res.on("end", () => {
    const pkg = JSON.parse(Buffer.concat(chunks).toString("utf8"));
    console.log({
      status: res.statusCode,
      name: pkg.name,
      version: pkg.version,
      bytesReceived: Buffer.concat(chunks).length
    });
  });
});
// Click "Fetch Live Stream" to stream from registry.npmjs.org…
4. Interactive node:* Scratchpad
Edit and execute any Vanilla JS module using node:https, node:fs, node:crypto, node:buffer, or node:path.
// Output from console.log() appears here…

Supported node:* Modules (v0.1.0)

All modules are dependency-free ES Modules with CORS enabled on https://vbs.jao.life/src/*.

Specifier Source Path Key Exports
node:https/src/net/https.jscreateServer, request, get, Server, Agent
node:http/src/net/http.jscreateServer, request, get, IncomingMessage, ServerResponse, STATUS_CODES
node:fs/src/sys/fs.jsreadFileSync, writeFileSync, mkdirSync, readdirSync, statSync, promises + OPFS sync
node:fs/promises/src/sys/fs-promises.jsreadFile, writeFile, mkdir, readdir, stat, rm
node:crypto/src/sys/crypto.jsSync createHash('sha256'), createHmac('sha256'), randomBytes, randomUUID, timingSafeEqual
node:stream/src/core/stream.jsReadable, Writable, Duplex, PassThrough, pipeline
node:buffer/src/core/buffer.jsBuffer.from, alloc, concat, byteLength (utf8, hex, base64, base64url)
node:events/src/core/events.jsEventEmitter, once
node:path/src/core/path.jsresolve, join, normalize, dirname, basename, extname, relative
node:url/src/core/url.jsURL, URLSearchParams, parse, format, fileURLToPath
node:util/src/core/util.jsinspect, format, promisify, inherits, types
node:os/src/sys/os.jsplatform, cpus, homedir, tmpdir, networkInterfaces
node:process/src/kernel/process.jsenv, cwd, chdir, nextTick, hrtime, versions