I've previously considered using the File System API from the Web APIs, specifically the origin private file system (OPFS) that allows operating on files that belong to the current page or document's origin.
The limitations I've found after iterating the MDN documentation is that obtaining directory handles through OPFS passes through promises and furthermore there are no synchronous operations at all. Also, there are synchronous file handles, but no synchronous directory handles.
- Origin private file system
- Getting started: The root directory is
navigator.storage.getDirectory().await
- Getting started: The root directory is
Other considerations:
- Cookies: Since they are simply a string (
document.cookies
IIRC), you've to build a directory hierarchy manually using some string notation. - IndexedDB: All operations are asynchronous as I understand it.
Should I simply not support the web properly in my file API and map it to RAM memory instead for now?