@webufs/webufs-browser
v0.1.2
Published
webufs browser-side usable script build
Downloads
2
Readme
Webufs browser-side usable js library.
This projet builds the @webufs/webufs
package as an iife
js library,
which is directly usable in the browser.
Note: @webufs/webufs-idb
is included in the build.
Usage
<!-- use unpkg -->
<script src="https://www.unpkg.com/@webufs/webufs-browser@latest/build/webufs.min.js"></script>
<!-- or download as a static file on your server -->
<script src="webufs.min.js"></script>
and then
// Yes, it's async
const ctx = await webufs.createDefaultContext()
// Mount IndexedDB-backed filesystem at '/idb'
ctx.getVFS().registerFSType(webufs.IDBFS)
await ctx.mkdir('idb')
await ctx.mount('idbfs', '/idb')
await ctx.chdir('idb')
// ... now play with 'ctx'
For details on how to use it, please read the document of the core package @webufs/webufs
and @webufs/webufs-idb