Closed kindoflew closed 1 year ago
@kindoflew hey! everything is good so far, I hope the same is for you.
I know it's not easy to leave your package manager (I didn't want to stop using rvm
for ruby stuff).
Have you heard about asdf manager?
It has an adapter for javascript, ruby and more...
I've heard they use a "pre-build" ruby to have support with M1 chips, wondering if that applies to the JS manager if you are interested in having an old version probably you can try it.
Looks good, @kindoflew, thank you!)
Can you please publish this when you have the chance?
This PR fixes a bug where
depngn
would crash on Node versions<14
. (Resolves #34)Context
The
fs/promises
module was added to Node inv14
. Before that, starting inv10
, the Promises API was available underfs.promises
(so, you'd import it likerequire('fs').promises
). https://nodejs.org/api/fs.html#promises-apiOne solution to this would have been to conditionally import the correct module using dynamic imports:
But I didn't like the idea of littering the code with conditionals and (potentially) unnecessary async stuff. So, I opted for importing the old sync versions and wrapping them in
promisify
(which has the added benefit of being available starting in Nodev8
, so potentially more "unofficial" support?).Changes
utils
directoryaccess
andwriteFile
asyncExec
toutils
(and removedsrc/queries/exec.ts
)QA
Unfortunately, I'm now on an M1 Mac which hates letting
nvm
install Node versions<14
for some reason, so I can't manually test this on my machine (although, I did QA with newer Node versions and ran tests and everything works).To QA you would:
nvm use 12
(or any version>10 && <14
)depngn
Also
Hey everybody! Hope you're all doing well!