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!

Top comments (0)