Last Updated: February 25, 2016
·
480
· thure

Sometimes you've gotta forgo npm for a module on GitHub that really works.

UPDATE: Good news, everyone! The maintainer of the particular module that I discuss here has just accepted the pull request I nagged about. The advice here can still be useful, but this should no longer reflect on promised-io's current state, so I've switched references to it to the past tense.


Have you ever used a package that, while extremely useful, has one fatal flaw that has developers knocking down the maintainer's door with pull requests to fix it? And not only that, but the maintainer won't accept pull requests? I know I have.

To be fair, I'm sure it's happened to the best of us — it's hard to keep on top of all your repos. But promised-io was a particular problem.

I found myself needing deferred promises desperately, and this package has everything. …Everything except, at one time, .all, where if more than one promise was rejected, it would throw an uncaught (and uncatchable) error. You couldn't even put a try{}catch(e){} block around it.

The good thing is that's what social coding is all about! I just replaced

"promised-io": "*",

in package.json with

"promised-io": "git://github.com/rap1ds/promised-io.git",

et voilà! Let's just hope Heroku can work with that. (UPDATE: it does.)

Just find a fork that works for your code and stick the git:// URI in there and it's good to go! The only hard part is relying on a fork indefinitely. Cue sneaky-clarinet-theme-of-unease.