Origin Private File System Playground

The granary’s back room: the real OPFS. What happens when its folder is opened, a write is not yet closed, a second writable writes, a folder with files is…

Why it matters

localStorage keeps only small text, IndexedDB keeps objects. For real files (a SQLite-WASM database, a media cache, an editor’s documents) OPFS gives folders and files of bytes, with no user permission. The rules people miss: a write counts only at close(), createWritable() starts from an empty copy, a folder with files is not removed without recursive, and fast sync access exists only in a Worker.

The key idea

OPFS is the origin's private folder, and a write counts once it is closed

Common mistakes

Try it in this playground