Socket
Socket
Sign inDemoInstall

middleagent

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    middleagent

HTTP client for Node.js with Koa-like middleware interface


Version published
Weekly downloads
3
Maintainers
1
Install size
22.1 kB
Created
Weekly downloads
 

Readme

Source

Middleagent

HTTP client for Node.js with Koa-like middleware interface

Usage

Currently this is just a simple wrapper of Node.js http module with Koa-like middleware API and ES6 Promise:

var agent = require('middleagent')

agent.use(function * (next) {
  // do something with this.request in the cascading
  yield next
  // do something with this.response in the cascading
}).get('http://example.com', function * () {
  // do something in the cascading
}).then(function (context) {
  // do something
}, function (err) {
  // handle errors
})

License

MIT license

Keywords

FAQs

Last updated on 21 May 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc