Run JavaScript
A JavaScript invocation runs against one selected disk on a Linux server. Its source is an async function body: use await and return directly. Each invocation starts with a fresh JS heap.
Send source
Section titled “Send source”curl --fail-with-body --no-buffer \ "https://api.wabe.sh/v1/disks/demo/exec?kind=js" \ -H "Authorization: Bearer YOUR_PROJECT_API_KEY" \ --data-binary @- <<'JS'await fs.mkdir('/notes', {recursive:true});await fs.writeFile('/notes/hello.txt', 'Hello wabe Disk\n');const app = kv.namespace('app');await app.put('lastFile', '/notes/hello.txt');print('saved');return {path: await app.get('lastFile')};JSThe response streams stdout/stderr records, a JSON result record on success, and a final exit record. Execution response defines their format.
Store source on the disk
Section titled “Store source on the disk”Upload a script as a file, then invoke its virtual path:
curl --fail-with-body -X PUT "https://api.wabe.sh/v1/disks/demo/files/app.js" \ -H "Authorization: Bearer YOUR_PROJECT_API_KEY" \ --data-binary @./app.js
curl --fail-with-body --no-buffer -X POST \ "https://api.wabe.sh/v1/disks/demo/exec?kind=js&path=/app.js" \ -H "Authorization: Bearer YOUR_PROJECT_API_KEY"The selected script and all its file/KV calls use the same disk. The request body is available through io.stdin when the script comes from path or script in the query.
Invoke from the shell
Section titled “Invoke from the shell”qjs /app.js first secondqjs -e 'print(args[0])' helloqjs - <<'JS'print('Hello from stdin');JSargs contains the arguments after the script selector. qjs - consumes stdin as source; use a stored path or -e when the script also needs stdin data. A returned value is emitted by direct HTTP JS execution. Shell qjs exposes printed stdout/stderr and an exit status.
Runtime APIs
Section titled “Runtime APIs”Use fs for files, kv for typed state, and io, print and bash for streams and pipelines.
The runtime provides JavaScript built-ins and the documented wabe Disk globals. Node.js modules, package imports, network access, timers and native process APIs are unavailable. Scripts and argument bytes share documented limits. A script error stops execution; writes already published remain visible.