strapkit
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

PageWhat's in it
Strapkit classConstructor, init(), setApiKey(), lifecycle.
Filesystemwrite, writeMultiple, read, readdir, isDir, readTree, mkdir, rm, snapshot.
Processesexec, shellExec.
Preview iframeshowPreview, onPortOpen, and the strapkit/preview-bridge module.
CachecacheSave, cacheRestore, cacheHas, cacheClear (and their standalone *With variants).
ErrorsStrapkitConfigError, 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 Uint8Array to write() for binary data.
  • Unknown options throw. Strapkit rejects misspelled option keys with a clear error rather than silently ignoring them.

On this page