# wait-for-localhost-cli

> Wait for localhost to be ready from the command-line

Latest version **4.0.0** (published 2025-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install wait-for-localhost-cli
pnpm add wait-for-localhost-cli
yarn add wait-for-localhost-cli
bun add wait-for-localhost-cli
```

Provides the command `wait-for-localhost`.

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2025-09-11 |
| First published | 2018-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 2 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 120 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | cli-app, cli, wait, localhost, server, port, delay, sleep, ready |

## Links

- npm: https://www.npmjs.com/package/wait-for-localhost-cli
- Repository: https://github.com/sindresorhus/wait-for-localhost-cli
- Homepage: https://github.com/sindresorhus/wait-for-localhost-cli#readme
- Issues: https://github.com/sindresorhus/wait-for-localhost-cli/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/wait-for-localhost-cli

## Dependencies (2)

- [meow](https://npm.io/package/meow.md) ^13.2.0
- [wait-for-localhost](https://npm.io/package/wait-for-localhost.md) ^5.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2025-09-11
- 3.2.0 — 2024-05-18
- 3.1.0 — 2023-11-01
- 3.0.0 — 2021-08-15
- 2.0.0 — 2020-07-18
- 1.1.0 — 2019-01-14
- 1.0.0 — 2018-06-08

## README

# 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`](https://github.com/webpack/webpack-dev-server) to be ready before launching Electron.

## Install

```sh
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]
    --timeout       Maximum time to wait in milliseconds.

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

## Related

- [wait-for-localhost](https://github.com/sindresorhus/wait-for-localhost) - API for this package
- [delay-cli](https://github.com/sindresorhus/delay-cli) - Delay execution for a given amount of seconds

---
_Source: https://npm.io/package/wait-for-localhost-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
