localstorage-fs
v0.1.0
Published
node's fs module for the browser backed by localStorage
Downloads
278
Readme
localstorage-fs
node's fs module for the browser backed by localStorage
why
there is this, but i needed sync methods
how
browserify and use it like you would in node land
api
same as in node but a bunch of methods are not implemented yet, view the source
implementation details
- file data and file metadata are stored under two prefixes: 'file://' and 'file-meta://' respectively
- raw file data is stored as base64 encoded strings under the file:// prefix
- directory listings are indexed as comma separated lists of file names under the file:// prefix
- stats are indexed under the file-meta:// prefix
fs.WriteStream
andfs.ReadStream
are unavailable until you callfs.create[Read|Write]Stream
process.chdir
,process.cwd
andprocess.umask
are shimmed by this module for now
example
there is a very simple example: do npm run exemplify
then open example/index.html in your browser console
test
no tests yet - maybe node's fs tests would work?
license
WTFPL