Browser-native persistence

A database, written in files.

DBOPFS maps tables to directories and records to files in the browser's Origin Private File System. It keeps the API small, the storage local, and each application's records in a stable namespace.

Released Version 1.0.0 Browser-only ES module

A legible storage model

Database concepts become browser files.

DBOPFS is intentionally direct. The application ID chooses an app-owned directory, a table becomes a child directory, and every record is stored as one file.

01 / TABLE

Directories hold tables.

Create a table by naming it. DBOPFS opens or creates the matching OPFS directory and remembers its handle for the current page.

02 / RECORD

Files hold records.

Use .json for parsed structured values, .txt for text, or .ndjson for newline-delimited records.

03 / SCOPE

Apps own a namespace.

A validated application ID places data below apps/<application-id>, reducing accidental cross-app reads and clears. It organizes trusted same-origin apps; it is not a hostile-code security boundary.

Understand application isolation and sharing

DBOPFS Studio Extension

Inspect the database on the current site.

DBOPFS Studio turns an origin's DBOPFS applications, tables, and records into a focused browser workspace. Connect from the extension toolbar or directly from DevTools (the Console) while inspecting a site.

TOOLBAR / CURRENT SITE

Open Studio from the extension.

Make the site active, select the DBOPFS Studio toolbar icon, verify the displayed origin, and open a Studio tab connected to that site.

DEVTOOLS / INSPECTED SITE

Launch Studio from DevTools.

Open DevTools on the site, select the dedicated DBOPFS Studio panel, and choose Open Studio window. The workspace connects to the page DevTools is inspecting.

Install and initialize

Your first durable record.

Install 1.0.0 from npm, or download the same verified tarball from the GitHub release for plain self-hosted browser JavaScript.

Open npm package Download GitHub release

npm
npm install dbopfs@1.0.0
GitHub Release (shell)
curl -fL https://github.com/TheWizardNexus/DBOPFS/releases/download/v1.0.0/dbopfs-1.0.0.tgz -o dbopfs-1.0.0.tgz
mkdir -p vendor/dbopfs
tar -xzf dbopfs-1.0.0.tgz -C vendor/dbopfs --strip-components=1
index.html
<meta name="arcane-app-id" content="my-app">

<script type="module">
    import '/vendor/dbopfs/arcane/modules/DBOPFS.js';

    await window.dbopfs.readyPromise;

    await window.dbopfs.set(
        'users',
        'alex.json',
        {name:'Alex',role:'admin'}
    );

    const user=await window.dbopfs.get(
        'users',
        'alex.json'
    );
</script>

One browser import for either source. With npm, expose node_modules/dbopfs/ as /vendor/dbopfs/. The GitHub Release commands extract the same verified package directly into vendor/dbopfs/. Keep the complete directory layout in both cases.

Serve it over HTTPS or localhost. OPFS is a secure-context browser API. Opening the page directly from a file: URL will not provide the required storage surface.

Designed for application code

Small surface, useful primitives.

CRUD and batch operations

Set, get, enumerate, filter, count, delete, and clear records. Batch methods return settled results so one rejected record does not hide the rest.

Browse record methods

Raw file access

Read a browser File, inspect modification metadata, write strings or bytes, and append when the selected record format supports it.

Work with files

Portable visual backups

Export the current app database as a deflate-compressed PNG payload and restore it into the same application scope.

Back up and restore

Arcane-ready identity

In Arcane, the native application binding is authoritative. In an ordinary browser, a stable metadata declaration supplies the application ID.

Understand identity

Async without guesswork

Learn when to await immediately, when independent operations can overlap, and why sequencing is not the same as a transaction.

Use promises safely

Know the boundary

Local by design.

DBOPFS does not create a server, account, synchronization layer, encryption boundary, or cross-origin database. Applications may build secure preload and synchronization services around it; browser site-data controls, quota, and eviction policy still apply.

Ready to inspect it?

The playground performs structured operations against its own dbopfs-playground namespace and shows the exact code for each action.

Launch structured playground