API Reference
API Reference
Everything the strapkit package exports.
The @strapkit/core package has one default export — the Strapkit class — plus
a handful of named exports for error classes and standalone cache helpers.
import Strapkit, {
StrapkitConfigError,
StrapkitRuntimeError,
cacheSaveWith,
cacheRestoreWith,
cacheHasWith,
cacheClearWith,
} from '@strapkit/core';Sections
| Page | What's in it |
|---|---|
| Strapkit class | Constructor, init(), setApiKey(), lifecycle. |
| Filesystem | write, writeMultiple, read, readdir, isDir, readTree, mkdir, rm, snapshot. |
| Processes | exec, shellExec. |
| Preview iframe | showPreview, onPortOpen, and the strapkit/preview-bridge module. |
| Cache | cacheSave, cacheRestore, cacheHas, cacheClear (and their standalone *With variants). |
| Errors | StrapkitConfigError, StrapkitRuntimeError, and proxy connection error codes. |
Conventions used in these docs
- Every instance method is async and returns a
Promise, even when it looks like a quick local call. - Paths are absolute. The default working directory is
/; pass full paths everywhere. - Text reads and writes are UTF-8. Pass a
Uint8Arraytowrite()for binary data. - Unknown options throw. Strapkit rejects misspelled option keys with a clear error rather than silently ignoring them.