Socket
Socket
Sign inDemoInstall

connected

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connected

Error first callback for listening on the server.


Version published
Weekly downloads
11K
decreased by-9.86%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 04 Jul 2014

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc