-
Notifications
You must be signed in to change notification settings - Fork 0
dBrowser VirtualFS Wrapper
Jared Rice Sr edited this page Jun 30, 2018
·
1 revision
A Virtual File System
wrapper for dBrowser that keeps all access scoped to a specific folder.
npm install @dbrowser/vfs-wrapper
var VFSystemWrapper = require('@dbrowser/vfs-wrapper')
var vfsw = new VFSystemWrapper('/home/jared')
fs.readFile('/greetings.txt', 'utf8', function (err, content) {
// reads /home/jared/greetings.txt
console.log('martian')
})
Creates a scoped vfsw
instance. All reads and writes will be restricted to basepath
; any attempts to use ..
to escape will return an error.
- createReadStream
- readFile
- createWriteStream
- writeFile
- mkdir
- access
- exists
- lstat
- stat
- readdir
- unlink
- rmdir