Closed jcubic closed 2 years ago
This is a replacement for #49
My test example:
class MemoryBackend { constructor() { this._store = new Map(); } saveSuperblock(superblock) { this._store.set("!root", superblock) } loadSuperblock() { return this._store.get("!root") } readFile(inode) { return this._store.get(inode) } writeFile(inode, data) { return this._store.set(inode, data) } unlink(inode) { return this._store.delete(inode) } wipe() { this._store = new Map() } close() { } } var fs = new LightningFS("fs", { db: new MemoryBackend() }); (async () => { await fs.promises.writeFile('/foo', 'hello'); const file = await fs.promises.readFile('/foo'); console.log(file.toString()); })();
:tada: This PR is included in version 4.5.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
This is a replacement for #49
My test example: