For the get and post methods, it would be great to support either Promises (methods return Promises instead of using the callback), or supporting "error-first callbacks" as most Node libraries do, which indirectly enables developers to use a Promise library like Bluebird.
The get and post methods currently accept a callback with a response param, which contains either an error or result.
Most Node libraries, especially native ones, use a "error-first callbacks", where the callback would be more like:
statuspage.get("pages", function(error, result) {
if (error) {
console.log("Error:", error);
return;
}
console.log("Result:", result);
});
then, developers can use a Promise library like bluebird to "promisify" those methods.
For the
getandpostmethods, it would be great to support either Promises (methods return Promises instead of using the callback), or supporting "error-first callbacks" as most Node libraries do, which indirectly enables developers to use a Promise library like Bluebird.The
getandpostmethods currently accept a callback with aresponseparam, which contains either an error or result.Most Node libraries, especially native ones, use a "error-first callbacks", where the callback would be more like:
then, developers can use a Promise library like bluebird to "promisify" those methods.