borked: To have broken something so entirely, you break the words used to describe the item.
borked is a micro utility designed for a very specific use-case. Timing out
async functions (caveat: it does not cancel the long running promise).
the executing the rest of the function until async function returns or the
promise resolves/rejects. So if it never resolves, completes because it's
borked, your whole function will just be waiting indefinitely.
We solve this by executing your async function/promise with an
where we will reject the promise when the supplied timeout is reached.
The package in published in the public npm registry and can be installed by running.
npm install --save borked
;const borked = ;//// Normally in your code you would do://// await example();//// And wait for the results, with borked you await `borked`//try awaitcatch econsole;
;try awaitcatch econsole;