UNMAINTAINED: Node's fs module for browsers using Web FileSystem API
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
instance
test
.gitignore
README.md
index.js
package.json
stats.js
watchers.js

README.md

web-fs

Node's fs interface for Web File System API and Chrome Packaged Apps.

Based on johnnyscript's nota-bene but allows specifying root entry.

Install via npm

$ npm install web-fs

Use with browserify!

API

var WebFS = require('web-fs')

var fs = WebFS(entry)

Create an instance of WebFS with a root directory specified by entry (DirectoryEntry).

Web File System API example:

var fs = null
navigator.webkitPersistentStorage.requestQuota(1024*1024, function(grantedBytes) {
  window.webkitRequestFileSystem(PERSISTENT, grantedBytes, function(result){
    fs = WebFS(result.root)
  })
})

Chrome Packaged App File System example:

var fs = null

// browse for root directory
chrome.fileSystem.chooseEntry({type: 'openDirectory'}, function(entry){
  fs = WebFS(entry)
})

Instance methods

  • fs.close
  • fs.createReadStream
  • fs.createWriteStream
  • fs.exists
  • fs.mkdir
  • fs.open
  • fs.readFile
  • fs.read
  • fs.readdir
  • fs.rename
  • fs.rmdir
  • fs.stat
  • fs.truncate
  • fs.unlink
  • fs.writeFile
  • fs.write
  • fs.watchFile
  • fs.unwatchFile
  • fs.watch