natevw / fatfs

Standalone FAT16/FAT32 filesystem implementation in JavaScript
47 stars 13 forks source link

Add promises #35

Closed zwhitchcox closed 2 years ago

zwhitchcox commented 2 years ago

Node <= 12 is no longer maintained, and it would be good to refactor the entire code base to use promises and make things much cleaner. I'm currently working on a fork, but I could just PR it if you would like..I'm not sure if you want to keep maintaining the project as it appears to not really have a lot of activity anymore.

Would you like me to create a PR or should I just fork it? I would be happy to adopt the project as well if you are no longer wanting to maintain it.

My ultimate goal is to implement it in WASM, although, right now, I'm just refactoring the code to use ES6+

natevw commented 2 years ago

Thanks, yeah I don't mind maintaining this at some level (thanks for your report at #34 btw) but my current long-term goals for this are pretty unambitious.

This library was originally made for a context in which we ± "had to" (or at least thought we had to) use asyncronous JS to access the underlying block volume, which meant all the logic had to also be async JS which meant we needed this from-scratch implementation. Otherwise this should/would have been a Node-API wrapper around an existing library like FatFS.

That said if you do need a "pure JS" version and if this is useful starting point for an async/await fork definitely feel free to do so. At that point though it's probably best to just give the new thing a life of its own and don't worry about backwards compatibility or re-integrating it into here.

zwhitchcox commented 2 years ago

Ok, I'm going to go ahead and close this for now, because I didn't have time to fully implement promises, so I basically just promisified the functions I needed, but might come back to this later.

Thanks for your response