Runtime
The shared host modules, available to both yuke.js and
yuked.js.
yuke:fs
Read-only filesystem access, so a script can pull a value off disk while it configures
itself. Every call is async — await it.
// yuked.js — read a secret instead of inlining it
import { defineConfig } from "yuke:daemon";
import { fs } from "yuke:fs";
const token = (await fs.readFile("secrets/token")).trim();
export default defineConfig({ authToken: token });
| Method | Returns | Meaning |
|---|---|---|
| readFile(path) | Promise<string> | Read a file as text. |
| stat(path) | Promise<FsStat> | Metadata for one entry. |
| readDir(path) | Promise<FsStat[]> | List a directory. |
FsStat
What stat and readDir return for an entry.
| Field | Type | Meaning |
|---|---|---|
| name | string | Entry name. |
| size | number | Size in bytes. |
| isDirectory | boolean | True for a directory. |
| isFile | boolean | True for a regular file. |