Skip to main content
OPFSResource mounts the Origin Private File System as a Mirage resource. Files persist across page reloads but stay scoped to the current origin.
Browser only. There is no OPFS in Node; for local persistence in Node, use Disk.

Install

Config

Mount mode

read, write, exec.

Storage and quotas

The browser sets per-origin quotas (typically a fraction of free disk, single-digit GB on most setups). Hitting it raises QuotaExceededError.
For long-lived workspaces, request persistent storage early so the browser doesn’t evict your data under storage pressure:
See TypeScript Limitations: Browser for the full set of browser constraints.