Persist projects
Save a project to IndexedDB and restore it after a page reload.
Use saveProject() for local, durable workspace persistence. It stores the current project in IndexedDB and excludes node_modules by default.
const saved = await startpod.saveProject("workspace-42")
if (!saved) {
showMessage("This browser could not save the workspace locally.")
}The method returns false when IndexedDB is unavailable, storage is over quota, or a write fails. Storage failures do not throw.
Restore during startup
const restored = await startpod.restoreProject("workspace-42")
if (!restored) {
await startpod.mount(initialProject)
}Restore merges the saved project onto the current working directory. Restore before mounting a fallback project when you want the saved copy to win.
Choose an export path for portability
IndexedDB stays in the current browser profile and origin. Use export() and importProject() when users need a downloadable backup or a project they can move between devices.