Adds .promise() to 🚨Function.prototype🚨
npm install promisify-global
If you would normally call some_function(function(e, val){...})
, instead you can get a promise by using some_function.promise()
.
Example: is_doge
; // is_doge normally uses callbacks { if arg !== 'doge' else } // but hey it's so easy to get a promise for itvar doge_promise = is_doge; doge_promise
IT'S JUST THAT SIMPLE.
there could be no negative fallout from adding .promise
to Function.prototype
. like if it does somehow mess up everything, that probably means you've got 99 problems already, and trying to use this library won't really help solve those problems.
yep.
...
...
...
adding to Function.prototype is not bad at all.
...
...
...
...
...
...
...
...
...
...
...
...