Skip to content

lapwinglabs/superagent-pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

superagent-pool

automatic request pooling for superagent. will only make the request once, but return the result for each request as if it requested the resource multiple times. Magical.

Requests only pooled on idempotent methods: GET, HEAD, OPTIONS.

Installation

npm install superagent-pool

Usage

var superagent = require('superagent-pool')(require('superagent'))

superagent.get('http://google.com', fn)
superagent.get('http://google.com', fn)
superagent.get('http://google.com', fn)

function end (err, res) {
  // called 3 times, but request is only made once
  console.log(res.status)
}

License

MIT

About

automatic request pooling for superagent

Resources

Stars

Watchers

Forks

Packages

No packages published