bro-fs
Promise-based wrapper over HTML5 Filesystem API
allowing to work with sandboxed filesystem in browser.
API is similar to Node.js fs module with some extra sugar.
Currently it is supported only by Chrome.
Demos
API
Install
- install from npm:npm install bro-fs
- include directly from CDN via
<script>
tag: - download manually the latest release
Usage
With async/await
:
const fs = ; { await fs; await fs; await fs; const content = await fs; console; // => "hello world"};
or with .then()
:
fs ; // => "hello world"
See more usage examples in test directory.
W3C Specs
Current:
- https://dev.w3.org/2009/dap/file-system/file-dir-sys.html (Chrome)
- https://wicg.github.io/entries-api (Firefox and Edge)
Coming (draft):
Discussion:
Similar packages
- filer.js - unix-like commands, callbacks
- html5-fs - looks obsolete, callbacks
- chromestore.js - looks obsolete, callbacks
- BrowserFS - many backends, callbacks
- fs-web - store files in IndexedDB, not html5 filesystem
- web-fs - abandoned
- browserify-fs - uses leveldb under hood, callbacks
- fs-browserify - abandoned
- dom-fs - abandoned
License
MIT @ Vitaliy Potapov