Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mwittig/restler-promise

A restler wrapper for the Promises/A+ implementation of your choice
https://github.com/mwittig/restler-promise

api-wrapper promise rest restler restler-promise wrapper

Last synced: about 6 hours ago
JSON representation

A restler wrapper for the Promises/A+ implementation of your choice

Awesome Lists containing this project

README

        

# restler-promise

[![NPM Version](https://img.shields.io/npm/v/restler-promise.svg?style=flat)](https://www.npmjs.com/package/restler-promise) ![Downloads](https://img.shields.io/npm/dm/restler-promise.svg?style=flat) [![Build Status](https://travis-ci.org/mwittig/restler-promise.svg?branch=master)](https://travis-ci.org/mwittig/restler-promise)
[![Greenkeeper badge](https://badges.greenkeeper.io/mwittig/restler-promise.svg)](https://greenkeeper.io/)

A [restler](https://github.com/danwrong/restler) wrapper for the Promises/A+ implementation of your choice.

```
// You may need to install bluebird first
var Promise = require("bluebird");
var rest = require("restler-promise")(Promise);
rest.get("http://google.com/").then(function (response) {
console.log(response);
}).catch(function (errorResult) {
// Note, the errorResult is an object containing an "error" property holding
// the Error object and an optional "response" property holding the the response
// object (if any). The response object will be missing, for example, if there is
// no response from server.
console.log(errorResult);
});
```

## License

Copyright (c) 2015-2018, Marcus Wittig and contributors. All rights reserved.

[MIT License](https://github.com/mwittig/logger-winston/blob/master/LICENSE)