0.1.0 • Published 6 years ago
@magicdawn/rp v0.1.0
rp
lightweight promise api for request
Install
npm i @magicdawn/rp --saveAPI
const rp = require('@magicdawn/rp')rp()
rp(options)
.then(([res, body]) => {
/* blabla */
})
.catch(err => {
/* blabla */
})rp.<http-verb>()
rp.get(url, options)
.then(([res, body]) => {
/* blabla */
})
.catch(err => {
/* blabla */
})rp.createFrom(request)
- create a rp instance from a request instance
- the request instance can be
require('request')orrequire('request').defaults()
rp.defaults(options)
same as rp.createFrom(request.defaults(options))
Changelog
License
the MIT License http://magicdawn.mit-license.org