https://github.com/typicode/server-ready-cli
Run commands only when a server is available
https://github.com/typicode/server-ready-cli
Last synced: 3 months ago
JSON representation
Run commands only when a server is available
- Host: GitHub
- URL: https://github.com/typicode/server-ready-cli
- Owner: typicode
- License: mit
- Created: 2017-01-09T22:55:41.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-19T21:45:04.000Z (almost 9 years ago)
- Last Synced: 2025-04-16T21:05:55.894Z (9 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 19
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# server-ready-cli [](https://travis-ci.org/typicode/server-ready-cli)
> Run commands only when a server is available
Useful if you want to run things in parallel but need to wait for a server to be ready.
_See [server-ready](https://github.com/typicode/server-ready) for the programmatic API._
## Install
```sh
$ npm install -g server-ready-cli
```
## Usage
```sh
$ server-ready --port 3000 -- some-command
```
## Example
In your `package.json`, you can use `server-ready-cli` to run `client` only when `server` is available.
```json
{
"scripts": {
"client": "server-ready --port 3000 -- node client.js",
"server": "node server.js",
"start": "npm run server & npm run client & wait"
}
}
```
__Tip__ `server-ready-cli` works well with [npm-run-all](https://github.com/mysticatea/npm-run-all).
## License
MIT - [Typicode :cactus:](https://github.com/typicode)