promisify-all
Promisify all Node.js builtin async methods using util.promisify
Installation
npm install --save promisify-all
Usage
Add the following code to the start of your Node.js project:
const promisifyAll =
Then you have promisified methods such as fs.readFileAsync
and fs.writeFileAsync
:
const fs = try const content = await fs console await fs console catch err // Handle errors here
Options
suffix
Call promisifyAll
as follows to customize suffix. The default suffix is Async
.
Promisified methods list
See here
License
MIT