@vaernjs/vaern
v0.0.6
Published
Vaern — an agent-native JavaScript & TypeScript runtime. Runs TypeScript directly, with fetch and an HTTP server built in.
Maintainers
Readme
vaern
An agent-native JavaScript & TypeScript runtime. Vaern runs TypeScript directly, with fetch and an HTTP server built in, on an embedded QuickJS-ng engine driven by Rust and Tokio. Capability sandboxing, tool-calling, MCP and replayable runs are being built into the engine itself.
VaernJS is a DevLogix project · licensed MIT
Status: v0.0.6, early native runtime
This release ships the native
vaernbinary for Linux, macOS and Windows. The API surface is small and will change before v1.0.
Works today
vaern run <file>: JavaScript and TypeScript, with types stripped at load time and line numbers kept- Relative ES module imports, and ES module packages already installed in
node_modules console,setTimeout/setInterval,queueMicrotaskprocess.argv,process.env,process.exit()fetchwithHeaders,Response,AbortController, redirects and timeouts (hyper and rustls)URL,URLSearchParams,TextEncoderandTextDecoderserve()fromvaern:http, an HTTP server with Web-standardRequest/Responseand streamed bodiesreadFile,writeFileandappendFilefromvaern:fs- Uncaught exceptions, unhandled rejections and throwing timers exit non-zero with a
file:line:collocation
Not implemented yet
node:*modules, CommonJS packages and downloading packages- Capability sandboxing (
vaern.toml) agent(),tool(), MCP, budgets andvaern replay
TypeScript enum, namespace and decorators are rejected with a located error, because they emit runtime code that type stripping cannot produce.
Install
npm install -g @vaernjs/vaern # global CLI
npx @vaernjs/vaern --version # without installingnpm installs one prebuilt binary for your platform through optionalDependencies, the same way esbuild does. Nothing is downloaded in a postinstall script; the platform packages are ordinary npm packages gated by os and cpu.
| Platform | Package |
|---|---|
| Linux x86_64 | @vaernjs/vaern-linux-x64 |
| Linux arm64 | @vaernjs/vaern-linux-arm64 |
| macOS arm64 | @vaernjs/vaern-darwin-arm64 |
| macOS x86_64 | @vaernjs/vaern-darwin-x64 |
| Windows x86_64 | @vaernjs/vaern-win32-x64 |
Linux binaries need glibc 2.35 or newer. On an unsupported platform, or when optional dependencies are skipped, vaern falls back to a small diagnostics CLI. Run vaern doctor there to see why.
Quick start
// latest.ts
interface Manifest {
name: string;
version: string;
}
const res = await fetch("https://registry.npmjs.org/@vaernjs/vaern/latest");
const pkg = (await res.json()) as Manifest;
console.log(`${pkg.name} ${pkg.version}, HTTP ${res.status}`);vaern run latest.tsProgrammatic use
const { binaryPath, hasNativeBinary, vaern } = require("@vaernjs/vaern");
if (hasNativeBinary()) vaern(["run", "app.ts"]);Links
- Website: vaernjs.tech
- DevLogix: devlogix.com.pk
- Repository: github.com/vaernjs/vaern
- Issues: github.com/vaernjs/vaern/issues
- npm: @vaernjs/vaern
Licence
MIT License. Copyright (c) 2026 DEVLOGIX TECHNOLOGY (PRIVATE) LIMITED (DevLogix).
See LICENSE.
Development
git clone https://github.com/vaernjs/vaern.git && cd vaern
cargo build --release
npm run check # pre-publish validation
npm run pack:dry # inspect exactly what would be publishedIssues and pull requests welcome. We would rather be corrected now than wrong later.
