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 => {
})
Install
npm i promisify-func
Weekly Downloads