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 => {
//res == url
})
const t = () => {throw new Error()};
promisify(t)().catch(err => {
//err == new Error()
})
//will do nothing for Promises
promisify(Promise.resolve("abc")).then(res => {
//res == abc
})