Package Exports
- wait-for-localhost
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wait-for-localhost) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
wait-for-localhost 
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-localhostUsage
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.
Related
- wait-for-localhost-cli - CLI for this module
- delay - Delay execution for a given amount of seconds
License
MIT © Sindre Sorhus