DEV Community

Discussion on: 5 neat JavaScript tips

Collapse
 
jportella93 profile image
Jon Portella

FYI there's a Node.js util that does the promisifying for you, you don't need to write your own. Thanks for sharing!

Collapse
 
qm3ster profile image
Mihail Malo

And a lot of nodejs builtins come in proper promise versions now, not by making you promisify them in userspace!

require("fs/promises").readdir('.').then(console.log)
Enter fullscreen mode Exit fullscreen mode

Hurrah!