You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
Node.js has had fs.promises since v10. The definition seems to remain the same between versions all the way up to v16. It says that there is a FileHandle class and that fsPromises.open() returns an instance of that class. However, in pkg's bootstrap.js the fs.promises.open function is just a promisified version of the normal fs.open, which uses file descriptor numbers instead of the FileHandler class.
This makes it difficult to write code that uses fs.promises and have it run with node directly and with pkg. Also, fs.promises is essentially unusable with typescript now since it can't tell there is a different API. I searched the readme and other issues but have not found this called out anywhere.
It would be nice if this was at least called out in the readme. It took me some time to finally track down why my code wasn't working when pkged and having it called out in the readme might save others the trouble. Ideally though, I imagine it would be good to have a more compatible API for fs.promises.
I can start working on implementing a compatible API if there are no objections from any of the maintainers.
Node.js has had
fs.promisessince v10. The definition seems to remain the same between versions all the way up to v16. It says that there is a FileHandle class and thatfsPromises.open()returns an instance of that class. However, in pkg's bootstrap.js thefs.promises.openfunction is just a promisified version of the normalfs.open, which uses file descriptor numbers instead of the FileHandler class.This makes it difficult to write code that uses
fs.promisesand have it run with node directly and with pkg. Also,fs.promisesis essentially unusable with typescript now since it can't tell there is a different API. I searched the readme and other issues but have not found this called out anywhere.It would be nice if this was at least called out in the readme. It took me some time to finally track down why my code wasn't working when
pkged and having it called out in the readme might save others the trouble. Ideally though, I imagine it would be good to have a more compatible API forfs.promises.I can start working on implementing a compatible API if there are no objections from any of the maintainers.