I recently wanted to color output in a minimal way for a commandline utility I was writing so came up with this little class.
import sys
class Cursor:
class Color:
BLACK="\u001b[30m"
Recently been working with websockets and wanted a way to provide a promise based interface for calls to an api over it mirroring fetch. Inorder to do so I got the api to echo back supplied request ids with the results it handled. But what about if the connection went down? Or for some other unknown reason it was taking far too long to proccess a request? I decided to create a request queue with Promises that would explode rejecting if unresolved for a set time. These promises also need to be resolved externally from requests comming in.
var ExplodingPromise = (timeout, timeoutWith) => {
var result, error