Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you support either a Promise-version of this API, or Node-style callbacks? #5

Open
scottrippey opened this issue May 26, 2016 · 0 comments

Comments

@scottrippey
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant