Author here. I assume you're referring to the Blockai organisation avatar? It's cute indeed :)
Shameless plug: we're looking to hire our first front end (React.js) / full stack engineer (oli@blockai.com).
If your project is open source, you can also use Travis-CI for testing your code against multiple versions of node. There are also services for non open source projects. https://travis-ci.org/
This reminds me of one time I linked to a Github pull request on IRC and some random dude commented on about every single line of code to criticize my style. Felt pretty weird.
[comment deleted]olalonde 4160 days ago. link 2 points ▲▼
My favorite pattern are plain callbacks (plus Async library). It is also probably the most common pattern in Node.js land (although promises and events are also quite common).
One reason I'm not personally a big fan of promises is that it makes it more verbose to pass around callbacks in some cases. For example:
Promise style:
async.series([
function (cb) {
user.save()
.success(function (user) {
cb(null, user);
}
.error(cb);
}
// ...
], function (err) {
// ...
});
vs plain callback style:
async.series([
user.save.bind(user)
], function (err) {
// ...
});
Some other benefits of plain callback style:
- Decoupling: how you handle the asynchronous code flow is up to you, not the library you are using. I personally like to use the "Async" library but it could easily be replaced by another library.
- Consistency: you don't have to worry about how the library you are using implements promises (some libraries have weird syntax/behavior).
edit: is there any way to format code snippets on EchoJS?