Over a million developers have joined DZone.

Simplify and UNIXify the HTML5 Filesystem API with filer.js

DZone's Guide to

Simplify and UNIXify the HTML5 Filesystem API with filer.js

· Web Dev Zone ·
Free Resource

Jumpstart your Angular applications with Indigo.Design, a unified platform for visual design, UX prototyping, code generation, and app development.

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?

Check out Eric's announcement, or the github project itself. And long live ls!

Take a look at an Indigo.Design sample application to learn more about how apps are created with design to code software.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}