Run commands only when a server is available
JavaScript
Latest commit f2da82c Jan 19, 2017 @typicode committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
.gitignore first commit Jan 9, 2017
.travis.yml first commit Jan 9, 2017
LICENSE first commit Jan 9, 2017
README.md Update README.md Jan 19, 2017
index.js first commit Jan 9, 2017
package.json first commit Jan 9, 2017
test.js first commit Jan 9, 2017

README.md

server-ready-cli Build Status

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 for the programmatic API.

Install

$ npm install -g server-ready-cli

Usage

$ 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.

{
  "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.

License

MIT - Typicode 🌵