@magicdawn/rp
lightweight promise api for request
Last updated a year ago by magicdawn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @magicdawn/rp 
SYNC missed versions from official npm registry.

rp

lightweight promise api for request

Build Status Coverage Status npm version npm downloads npm license

Install

npm i @magicdawn/rp --save

API

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') or require('request').defaults()

rp.defaults(options)

same as rp.createFrom(request.defaults(options))

Changelog

CHANGELOG.md

License

the MIT License http://magicdawn.mit-license.org

Current Tags

  • 0.1.0                                ...           latest (a year ago)

3 Versions

  • 0.1.0                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |