JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q47563F
  • License MIT

a simple useful wrapper of request

Package Exports

  • beer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (beer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

logo beer npm

a useful warpper of request. have a drink and waiting for results callback.

How to install

$ npm install beer

Sample code

var beer = require('beer');

beer.get("http://google/com",{
    query: {
        param: 1,
        param2: 2
    }
},function(err,result){
    if (!err) {
        // enjoy !
        console.log(result)
    } else {
        console.log('Opps !!');
    }
});

API

beer.get(url,params,callback)

  • url [String]
  • params [Object]
    • query
      • key : value : params will join URL as ?key=value
  • callback [Funtion]
    • error : null or error object
    • result : fetch result

beer.post(url,params,callback)

  • url [String]
  • params [Object] sent as form
    • key : value
  • callback [Funtion]
    • error : null or error object
    • result : fetch result

Run unit-test (Mocha)

$ git clone https://github.com/turingou/beer.git
$ cd beer
$ npm install // will install mocha localy
$ npm test