Socket
Socket
Sign inDemoInstall

server-ready

Package Overview
Dependencies
2
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    server-ready

Know when a server is ready to receive requests


Version published
Maintainers
1
Created

Readme

Source

server-ready

Know when a server is ready to receive requests

Install

npm install server-ready --save

Usage

var serverReady = require('server-ready')

var port = 3000
var timeout = 5000

serverReady(port, timeout, function (err) {
  if (err) return console.error('timeout, can\'t connect to port')
  console.log('port is open or has just opened')
})

How it works?

server-ready will try to connect every 250ms to the specified port until a connection has been made or timeout has been reached.

License

MIT - Typicode

Keywords

FAQs

Last updated on 05 Aug 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc