fs-sandbox
A wrapper around the node fs
module, used in the Beaker Browser to give sandboxed access to files and folders.
Usage
var fs = var fss = // create a folder sandboxed to `path`var folder = fss // api:// (all *Sync variants are supported)folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolder // open a file sandboxed to a pathvar file = fss// or...var file = folder // api:// (all *Sync variants are supported)filefilefilefilefilefilefilefilefilefilefile
Disabled methods
Most fs
methods are included.
These are not:
- access
- chmod
- chown
- createReadStream
- createWriteStream
- fchmod
- fchown
- fdatasync
- futimes
- ftruncate
- ftruncateSync
- lchmod
- lchown
- link
- mkdtemp
- readlink
- realpath
- symlink
- unwatchFile
- utimes
- watch
- watchFile
Also, the methods are not allowed to set the permission mode bits.