01 · Hello World
The simplest possible 3va script. Pure computation and console output need
no permissions at all.
Source: examples/01-hello-world
Run
cd examples/01-hello-world
3va run app.jsHello from 3va!
Runtime: 3va
Node compat: trueThe code
app.js
console.log("Hello from 3va!");
console.log(`Runtime: ${typeof Deno !== "undefined" ? "Deno" : "3va"}`);
console.log(`Node compat: ${typeof process !== "undefined"}`);How it works
3va run <file>executes a script in 3va’s V8 engine. The entry file itself is always readable; nothing else is.- Node globals such as
processandconsoleexist, so ordinary Node-style code runs unchanged. There is noDenoglobal. - No
--allow-*flag is needed because the script touches no file, network, environment variable or child process.
Things to keep in mind
- Reading
processis not reading the environment.typeof processworks without flags, butprocess.envlooks empty until you grant--allow-env(see 10 · Permissions). - This only stays flag-free while it stays one file. The moment the
script imports another local module, that import is a file read and
needs
--allow-read(see 12 · Expo).