Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pdehaan/requestp
A promise based version of request.
https://github.com/pdehaan/requestp
Last synced: 15 days ago
JSON representation
A promise based version of request.
- Host: GitHub
- URL: https://github.com/pdehaan/requestp
- Owner: pdehaan
- License: unlicense
- Created: 2014-11-01T01:54:02.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-01T18:23:47.000Z (about 10 years ago)
- Last Synced: 2024-10-31T13:12:42.279Z (2 months ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# requestp
A promise based version of [request](https://github.com/mikeal/request).
## How do I even?
You can install the simple `requestp` module via npm using the following command:
```sh
$ npm install pdehaan/requestp --save # or `npm i pdehaan/requestp -S`
```And then in your Node project simply `require()` the module and pass in a [`request` options object](https://github.com/request/request#requestoptions-callback) and you get a promise resolved with the response body (String or Buffer, or JSON object if the json option is supplied), or rejected with an error (usually from http.ClientRequest object).
```js
'use strict';var requestp = require('requestp');
requestp({
uri: 'https://raw.githubusercontent.com/pdehaan/requestp/master/package.json',
json: true
}).then(console.log, console.error);
```