3 ms·
> Unless I'm mistaken, it's fairly trivial to promisify the old-style code Even if it was trivial to promisify request (though it seems it isn't according to s
by lucideer 8y ago
> Unless I'm mistaken, it's fairly trivial to promisify the old-style code
Even if it was trivial to promisify request (though it seems it isn't according to sibling comments), the point is that the promisify utility is effectively a workaround for working with older libs & APIs in a modern idiomatic way. It's supposed to be a temporary shim to move into modern patterns, not something whereby you start a new project, choose new actively-developed lib, and expect to have to wrap that lib just to use it idiomatically.
Similarly, "upgrading" your popular lib to have a modern API just by wrapping it with the promisify util and leaving the internals using a legacy pattern not only adds overhead, but it also just a bit of a hack, and not very ideal. Especially when more modern alternatives to your lib exist which you could be recommending.