Socket
Socket
Sign inDemoInstall

wait-for-localhost

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wait-for-localhost

Wait for localhost to be ready


Version published
Weekly downloads
2.2K
decreased by-5.13%
Maintainers
1
Weekly downloads
 
Created
Source

wait-for-localhost Build Status

Wait for localhost to be ready

Useful if you need a local server to be ready to accept requests before doing other things.

Install

$ npm install --global wait-for-localhost

Usage

const waitForLocalhost = require('wait-for-localhost');

(async () => {
	await waitForLocalhost({port: 8080});
	console.log('Server is ready');
})();

API

waitForLocalHost([options])

Returns a Promise that settles when localhost is ready.

options

Type: Object

port

Type: number
Default: 80

useGet

Type: boolean
Default: false

Use the GET HTTP-method instead of HEAD to check if the server is running.

License

MIT © Sindre Sorhus

Keywords

FAQs

Package last updated on 03 Apr 2019

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