All Projects → koenpunt → superagent-use

koenpunt / superagent-use

Licence: MIT license
Global plugin support for SuperAgent

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to superagent-use

superagent-no-cache
Plugin for visionmedia/superagent that adds headers to all requests that prevents caching.
Stars: ✭ 25 (-30.56%)
Mutual labels:  superagent
buptclass
A nodejs-spider that gets the infomation of empty classrooms in BUPT
Stars: ✭ 29 (-19.44%)
Mutual labels:  superagent
superdeno
Super-agent driven library for testing Deno HTTP servers.
Stars: ✭ 119 (+230.56%)
Mutual labels:  superagent
Douban
Awesome douban DEMO created with Vue2.x + Vuex + Vue-router + Superagent
Stars: ✭ 2,324 (+6355.56%)
Mutual labels:  superagent
Supertest
The motivation with this module is to provide a high-level abstraction for testing HTTP, while still allowing you to drop down to the lower-level API provided by superagent.
Stars: ✭ 11,712 (+32433.33%)
Mutual labels:  superagent
douyin signature
douyin web signature
Stars: ✭ 98 (+172.22%)
Mutual labels:  superagent
cucumber-steps
🥒 Quick start for testing with Cucumber.js
Stars: ✭ 15 (-58.33%)
Mutual labels:  superagent
superagent-intercept
Add functions that will be called during end() e.g. for handling error conditions without having the same code all over the place.
Stars: ✭ 23 (-36.11%)
Mutual labels:  superagent
Fee-movie2.0
整合了几个常用的电影网站,获取资源更方便,更新中
Stars: ✭ 33 (-8.33%)
Mutual labels:  superagent

superagent-use Build Status

Global plugin support for SuperAgent.

Summary

Instead of manually calling use() for every request, use() is called automatically for every request.

Example

/* The superagent-use module returns a clone of the superagent provided with the new functionality. */
var agent = require('superagent-use')(require('superagent'));
/* A sample superagent plugin/middleware. */
var prefix = require('superagent-prefix');

agent.use(prefix('https://api.example.com'));

agent
  .post('/auth')
  .send({user: 'foo', pass: 'bar123'})
  .on('request', function(req) {
    console.log(req.url); // => https://api.example.com/auth
  })
  .end(function(err, res) {
    //
  });
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].