Skip to main content

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 extensionWhat you get
.gql, .graphqlA function (vars?) => { query, subscribe, unsubscribe } — see GraphQL modules
.bpf.oA default-exported BpfObject pointing at that ELF — see eBPF
Everything elseNormal ES module

Built-in modules

ImportContents
yeet:tuiDeclarative terminal UI — Box, Text, Layer, CellBuffer, Disposal, mount, signal, computed, from, effect, face helpers — see TUI
yeet:tui/jsx-runtimeJSX runtime (jsx, jsxs, Fragment)
yeet:tui:layoutLayout engine (Node, Size, layout)
yeet:tui:faceStyled-string and color primitives
yeet:tui:textText measurement utilities
yeet:signalTC39-style signals (Signal.State, Signal.Computed, Signal.subtle)

JSX

Scripts can use JSX syntax in .jsx and .tsx files. The runtime transpiles it automatically — no pragma or build step required.

import { Box, Text, mount } from 'yeet:tui';

mount(size => (
<Box border="round" padding={1}>
<Text>hello</Text>
</Box>
));

JSX element types must be component functions. String tag names (<div>, etc.) are not supported.

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.