wait-for-localhost-cli

3.2.0 • Public • Published

wait-for-localhost-cli

Wait for localhost to be ready from the command-line

Useful if you need a local server to be ready to accept requests before executing the next command.

I personally use this to wait for webpack-dev-server to be ready before launching Electron.

Install

npm install --global wait-for-localhost-cli

Usage

$ wait-for-localhost --help

  Usage
    $ wait-for-localhost [port]

  Options
    --use-get       Use the HTTP-method GET instead of HEAD to test if the server is ready.
    --path          Use a custom path. For example, /health for a health-check endpoint.
    --status-codes  Define status codes indicating the server is ready. [Default: 200]

  Examples
    $ wait-for-localhost 8080 && echo 'Server is ready'
    $ wait-for-localhost 8080 --status-codes 200,201 && echo 'Server is ready'

Related

Package Sidebar

Install

npm i wait-for-localhost-cli

Weekly Downloads

1,038

Version

3.2.0

License

MIT

Unpacked Size

4.32 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus