10.0.0 • Public • Published


Use the Node fs API in Chrome Apps

This module is used by chromiumify


This library can be used directly with your browserify builds with targeting Chrome Packaged Apps.

$ npm install chrome-fs --save
$ browserify -r chrome-fs:fs index.js -o bundle.js

API Status

This list is based on the node.js documentation Sync apis won't be supported they are listed here


  • fs.rename(oldPath, newPath, callback)
  • fs.ftruncate(fd, len, callback)
  • fs.truncate(path, len, callback)
  • fs.chown(path, uid, gid, callback)
  • fs.fchown(fd, uid, gid, callback)
  • fs.lchown(path, uid, gid, callback)
  • fs.chmod(path, mode, callback)
  • fs.fchmod(fd, mode, callback)
  • fs.lchmod(path, mode, callback)
  • fs.stat(path, callback)
  • fs.lstat(path, callback)
  • fs.fstat(fd, callback)
  •, dstpath, callback)
  • fs.symlink(srcpath, dstpath[, type], callback)
  • fs.readlink(path, callback)
  • fs.realpath(path[, cache], callback)
  • fs.unlink(path, callback)
  • fs.rmdir(path, callback)
  • fs.mkdir(path[, mode], callback)
  • fs.readdir(path, callback)
  • fs.close(fd, callback)
  •, flags[, mode], callback)
  • fs.utimes(path, atime, mtime, callback)
  • fs.futimes(fd, atime, mtime, callback)
  • fs.write(fd, buffer, offset, length[, position], callback)
  • fs.write(fd, data[, position[, encoding]], callback)
  •, buffer, offset, length, position, callback)
  • fs.readFile(filename[, options], callback)
  • fs.writeFile(filename, data[, options], callback)
  • fs.appendFile(filename, data[, options], callback)
  • fs.watchFile(filename[, options], listener)
  • fs.unwatchFile(filename[, listener])
  •[, options][, listener])
  • fs.exists(path, callback)
  • fs.access(path[, mode], callback)
  • fs.createReadStream(path[, options])
  • fs.createWriteStream(path[, options])

Class: - fs.Stats

  • fs.Stats
  • Stat Time Values

Class: - fs.ReadStream

  • fs.ReadStream
  • Event: 'open'

Class: - fs.WriteStream

  • fs.WriteStream
  • Event: 'open'
  • file.bytesWritten

Class: - fs.FSWatcher

  • fs.FSWatcher
  • watcher.close()
  • Event: 'change'
  • Event: 'error'


$ npm test

This will load the folder test/chrome-app as an unpacked extension in chrome. Test currently designed for Chrome on Windows and Linux Canary on Mac other variants accepted


It is recommended that the following permissions are added to your chrome packaged app for this module.

  "permissions": [


Relative Directories

Chrome Packaged Apps don't have the notion of current working directory CWD. So relative paths are not escapted they are trimmed to be relative from root i.e. ../../direct1/file1 Will resolve to /direct1/file1

. Will resolve to /

Ownership Mod Mapping

Chrome Packaged Apps allow you to see and edit the filesystem from the dev tools so the chown, fchown, chmod, fmod calls are there for compatibility only. Any chown call will not be reflected in stat


Best effort has been made to support stat but the Chrome File System is not a complete implementation. Files have size and last modified but directories have no size and default to the start of epoc for last modified.


Currently only UTF-8 is supported

File Extensions

There seems to be an issue around saving files in chomefs


anton whalley @no9


npm i chrome-fs

DownloadsWeekly Downloads






Last publish


  • no9