npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

idb.filesystem.js

v0.0.8

Published

HTML5 Filesystem API polyfill using IndexedDB

Readme

idb.filesystem.js

idb.filesystem.js is a well tested JavaScript polyfill implementation of the HTML5 Filesystem API. It is intended for browsers that do not support the API natively.

The library works by using IndexedDB as its underlying storage layer. Essentially, this means that any browser supporting IndexedDB also supports the Filesystem API! All you need to do is make Filesystem API calls, and the rest is magic.

Supported Browsers

  • Firefox 11+
  • Safari 7.1+
  • iOS 8+
  • Opera 15+
  • IE 10+

Unlisted browsers and/or versions (e.g. earlier versions of Firefox) that support IndexedDB will likely work; I just haven't tested them.

Demo

Two demo apps are included under /demos. The basic demo allows you add files to the app by drag and drop from the desktop. The second demo is a slightly modified version of filer.js's playground app. What's exciting is that the same app now works in other browsers besides Chrome!

Getting started

Install the polyfill:

npm install idb.filesystem.js --save

Drop it on your page:

<script src="node_modules/idb.filesystem.js/dist/idb.filesystem.min.js" async></script>

Then use the Filesystem API as normal! See my HTML5Rocks article on using the Filesystem API.

Basic example of opening a filesystem and writing to a new .txt file:

window.requestFileSystem(TEMPORARY, 1024 * 1024, function(fs) {
  console.log('Opened ' + fs.name);
  
  fs.root.getFile('NewFile.txt', {create: true}, function(fileEntry) {
    fileEntry.createWriter(function(fileWriter) {
      fileWriter.onwritestart = function() {
        console.log('WRITE START');
      };
      
      fileWriter.onwriteend = function() {
        console.log('WRITE END');
      };

      var blob = new Blob(['1234567890'], {type: 'text/plain'});
    
      fileWriter.write(blob);
    }, onError);
  }, onError);
}, onError);

function onError(e) {
  console.log('Error', e);
}

Using with filer.js

filer.js is a convenience library for the HTML5 Filesystem API. It wraps API calls with familiar UNIX commands (cp, mv, ls) for its own API.

filer.js works well with idb.filesystem.js, with a few exceptions. Unimplemented methods in this library and filer.open() (because filesystem: URLs are not known by unsupported browsers). There may be other API calls in filer.js that do not work, but I haven't tested them.

Contributing

Building

Install the dependencies and compile the library by running gulp:

npm install
gulp

This will output a built file to dist/idb.filesystem.min.js.

Releasing

To cut a new release, run:

npm version patch
gulp
npm publish

Analytics