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.
Every layer is plain ES Modules running directly inside the browser tab—even offline.
Full createServer, request, and get. Routes virtual ports & /etc/hosts locally; streams public HTTPS APIs via fetch().
Sync readFileSync/writeFileSync backed by persistent browser OPFS, plus synchronous SHA-256 & HMAC-SHA256.
EventEmitter, Uint8Array-backed Buffer, async-iterable Readable/Writable streams, and POSIX paths.
In-memory loopback, live /etc/hosts DNS, BroadcastChannel multi-tab RPC, and Service Worker /__vbs/:port/* routing.
Paste this native <script type="importmap"> into any static .html file—no npm install or bundler needed.
<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>
Every demo below executes real import ... from "node:*" code directly inside your browser right now.
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", ...);
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"));
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
});
});
});
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.js | createServer, request, get, Server, Agent |
node:http | /src/net/http.js | createServer, request, get, IncomingMessage, ServerResponse, STATUS_CODES |
node:fs | /src/sys/fs.js | readFileSync, writeFileSync, mkdirSync, readdirSync, statSync, promises + OPFS sync |
node:fs/promises | /src/sys/fs-promises.js | readFile, writeFile, mkdir, readdir, stat, rm |
node:crypto | /src/sys/crypto.js | Sync createHash('sha256'), createHmac('sha256'), randomBytes, randomUUID, timingSafeEqual |
node:stream | /src/core/stream.js | Readable, Writable, Duplex, PassThrough, pipeline |
node:buffer | /src/core/buffer.js | Buffer.from, alloc, concat, byteLength (utf8, hex, base64, base64url) |
node:events | /src/core/events.js | EventEmitter, once |
node:path | /src/core/path.js | resolve, join, normalize, dirname, basename, extname, relative |
node:url | /src/core/url.js | URL, URLSearchParams, parse, format, fileURLToPath |
node:util | /src/core/util.js | inspect, format, promisify, inherits, types |
node:os | /src/sys/os.js | platform, cpus, homedir, tmpdir, networkInterfaces |
node:process | /src/kernel/process.js | env, cwd, chdir, nextTick, hrtime, versions |