connected

0.0.2 • Public • Published

connected

This module is born out of an annoyance with the Node core. Every method that receives a callback is called using an error first callback. But this is not the case with servers. When you tell the server to start listening on the given port it can will emit an error event when it failed.

Installation

npm install connected --save

Usage

var connected = require('connected')
  , http = require('http');
 
var app = http.createServer(function (req, res) {
  res.end('wobble wobble');
});
 
connected(app, 80, function (err) {
  // Received an error because we are not allowed to listen on port 80
});

And thats it.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    14,988
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    14,988
  • 0.0.1
    12
  • 0.0.0
    2

Package Sidebar

Install

npm i connected

Weekly Downloads

9,872

Version

0.0.2

License

MIT

Last publish

Collaborators

  • 3rdeden
  • v1