Skip to content
Guides Vaern 0.0.8
Documentation

Quickstart

Install Vaern, run a TypeScript file, and replay the output from a recorded run.

Install the CLI

The npm package installs a native binary through platform-specific optional dependencies. Supported targets are Linux x64 and arm64, macOS x64 and arm64, and Windows x64.

Terminal
npm install -g @vaernjs/vaern
vaern --version
  • If the command is missing after a global install, check where npm puts global executables and add that directory to your PATH.
  • If npm installed the diagnostics wrapper without a native binary, run vaern doctor and check that optional dependencies were enabled.

Run your first TypeScript script

Save the code as hello.ts in an empty directory. Vaern strips supported TypeScript types at runtime, so this example runs without a compilation step.

hello.ts
const name: string = process.argv[2] ?? "Vaern";
console.log("Hello,", name);
Terminal
vaern run hello.ts VaernJS
  • Expected output is Hello, VaernJS.

Verify and replay the run

Leave the script in place and use the same working directory. The CLI records a journal on each run by default. The latest name points at the newest run in that journal home.

Terminal
vaern journal verify latest
vaern replay latest
  • The verify command prints the number of records and a final hash.
  • Replay prints the matching output and reports the number of console records reproduced.
Next guide · JavaScript and TypeScript runtime