Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
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(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: string
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 14 Jan 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