Scripts
Yeet scripts run inside a V8 isolate with a curated set of globals. The runtime is intentionally minimal — it is not Node.js, not Deno, and not a browser.
Running a script
yeet run script.js # run once, exit when done
yeet run -w script.js # watch mode — re-runs automatically when the file changes
Press Ctrl+C to cancel a running script at any time.
Module system
Scripts are evaluated as ES modules. import / export syntax works. require() / CommonJS is not supported.
import myQuery from './my-query.graphql';
Special import rules
| File extension | What you get |
|---|---|
.gql, .graphql | A function (vars?) => { query, subscribe, unsubscribe } — see GraphQL modules |
.bpf.o | A default-exported BpfObject pointing at that ELF — see eBPF |
| Everything else | Normal ES module |
Execution model
- Scripts run as ES modules inside a single-threaded V8 isolate.
- Async/await and promises work — the event loop runs timers and resolves pending promises between turns.
- The isolate terminates when the top-level module finishes and no pending timers or unresolved promises remain, or when
yeet.exit()is called. - Uncaught exceptions and unhandled promise rejections are reported to the daemon and terminate the isolate.