wbfs
Implementation of a basic subset of node's fs v0.12 api for the web with some caveats.
Run the integration tests in your browser.
Usage
var co = ;var fs = ; ; // Or without co + generators... fs;
Caveats
This is only known to work in Firefox currently since support for indexedDB as well as es6 features such as promises, generators, proxies, arrow functions, destructuring, and template strings is assumed.
Invocation style
- No synchronous methods are implemented.
- Asynchronous methods use promises instead of callbacks.
File permissions
- Neither file permissions nor the methods that let you interact with
them such as
chown()
,chmod()
, andaccess()
are implemented. - Methods that take an optional
mode
argument in the nodejs api do not honor themode
(since there are no file permissions).
Low-level apis, buffers, and streams
- None of the lower-level methods like
truncate()
,ftruncate()
, andfsync()
are implemented. - There are no buffers. The
write()
,readFile()
,writeFile()
, andappendFile()
methods all coerce values to strings. createReadStream()
,ReadStream
,createWriteStream()
, andWriteStream
are not implemented.
fs.exists()
exists()
is not implemented since it is slated for deprecation in the nodejs api as of v0.12.