Skip to content

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

Description

@scottrippey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions