Simplify and UNIXify the HTML5 Filesystem API with filer.js
Join the DZone community and get the full member experience.Join For Free
One of the more ambitious low-level web standards presently under development is the Filesystem API, currently in W3C Working Draft status.
Rather than creating its own local storage space, an application using the Filesystem API can navigate the user's pre-existing local filesystem, within a user-defined sandbox -- thus, like many of these new web technologies, continuing to dissolve the web/local barrier.
Filesystem-appropriately, the API is long and complex.
So Eric Bidelman wrote a wrapper, filer.js, to map some basic filesystem functionality to shorter-syntax and -- here's the awesome rub -- familiar UNIX commands.
From Eric's release announcement:
Unlike other libraries [1, 2], filer.js takes a different approach and incorporates some lessons I learned while implementing the Google Docs Python client library. Namely, the library resuses familiar UNIX commands (cp, mv, rm) for its API. My goal was to a.) make the HTML5 API more approachable for developers that have done file I/O in other languages, and b.) make repetitive operations (renaming, moving, duplicating) easier.
That's pretty sweet, I'd say. Why wrap into something just simpler, when you can map onto something you already know?
Opinions expressed by DZone contributors are their own.