DEV Community

Daniel Zotti
Daniel Zotti

Posted on

#LearnedToday: FileSystemAccess API

🤔 What if you could manage the device's files with a web app frontend?

😱 Well, YOU CAN ALREADY DO IT!!!

📚 The FileSystemAPI allows you to read, write and manage the device files and folders.

😍 This is what we needed to finally get rid of desktop apps once and for all! Combined with PWA, Push Notification, ServiceWorker and WebWorker functionalities, we are now able to create an "installable desktop web app".

😢 Unfortunately, not all that glitters is gold... It’s currently supported only by Chromium browsers, but I'm sure it will be supported by the other browsers in a short time 💪

Demo project

👨‍💻 I created a vanilla JavaScript opensource project to test FileSystemAPI features like:

  • reading file properties
  • reading a directory with its children recursively (with a little help of AsyncGenerators and AbortController for huge directories)
  • media preview (with the help of createObjectURL to create the URL for src attribute of <img> and <video>, from the ArrayBuffer)
  • create/edit/delete a text file.

🔗 Demo (remember to use Chrome!)

❓ Did you know about FileSystemAPI? In my opinion it is one of the most revolutionary APIs of recent years!

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs