jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.06k stars 216 forks source link

Change the core to be mountable by default without a FS #370

Closed james-pre closed 9 months ago

james-pre commented 9 months ago

We should remove MountableFileSystem and support mounting by default. configure should work like the mountable options. Furthermore, using configure with the old syntax would just mount the FS to /. For example:

import { configure } from 'browserfs';

await configure({ fs: 'InMemory' });

// new
await configure({
    '/': { fs: 'IndexedDB' },
    '/tmp': { fs: 'InMemory' },
});

// old
await configure({
    fs: 'MountableFileSystem',
    options: {
            '/': { fs: 'IndexedDB' },
            '/tmp': { fs: 'InMemory' },
    }
});

This eliminates the need for having to create a completely separate file system just to mount something. It reduces the complexity of the project in addition to improving compatibility.

james-pre commented 9 months ago

Added in 256cadb Added a default InMemory in d2aad42