Skip to content

Use Native Promises With Node.js fs Module

View on Twitter

💡 Have you been promisifying the fs module in Node.js all this time like I did?

👉🏼 Not anymore! Node.js >= 10 ships with a native promise implementation of the fs module. #latetotheparty 😅

➡️ require('fs/promises')

Use the built-in promisified version of fs module in Node.js by importing fs/promises.
You might also like
Find Popular JavaScript/Node.js Libraries Read tip
Organise Large Nginx Configs Read tip
Find DigitalOcean Region With Lowest Ping Read tip