Socket
Book a DemoInstallSign in
Socket

beer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beer

a simple useful wrapper of request

latest
Source
npmnpm
Version
0.0.8
Version published
Maintainers
1
Created
Source

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

Keywords

beer

FAQs

Package last updated on 14 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts