promisify-func
0.0.7 • Public • Published promisify-func
Make function async (i.e. if function returns not Promise then it wraps it with Promise; if function throws error then wrap it with Promise.reject).
Example
const promisify = require('promisify-func');
const p = (url) => url;
promisify(p)(url).then(res => {
})
const t = () => {throw new Error()};
promisify(t)().catch(err => {
})
promisify(Promise.resolve("abc")).then(res => {
})
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 0.0.7
0
Version History
Package Sidebar
Install
Weekly Downloads