Hacker News new | past | comments | ask | show | jobs | submit login

How does the saving notes on disk work? You mean just downloading it? Or is the content synced? If so how does that work?



Chrome implements APIs that allow accessing files on the disk.

So Edna either stores notes in localStorage or in a directory of your choosing on disk.

In Edna you can right-click for context menu to switch between localStorage and disk.

If you ask: "how do the browser APIs work", you can look at https://github.com/kjk/edna/blob/main/src/fileutil.js

Basically, there's `window.showDirectoryPicker()` to ask user for permission to access directory (either read only or read write). And then using that directory handle you can read list of files, read / write files or create new files.


Oh, man, many years ago I used Tiddlywiki (and later Wiki-On-A-Stick) as a browser-based note taking app, but stopped using it because the API they used to save the file to disk got deprecated and removed.

History not repeating but rhyming, I suppose...

Anyway, thanks for this. I've just added it to my bookmarks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: