localhost-ready

0.0.2 • Public • Published

localhost-ready

Check to see if a local tcp server can be connected to. On success, return status code 0, otherwise status code 1.

Using in your project

Add as a dev dependency

npm install --save-dev localhost-ready
# or
yarn add --dev localhost-ready

Use it

From cli:

$(npm bin)/localhost-ready --port 8080 --timeout 60000 && echo "Server running"
# or
$(yarn bin)/localhost-ready --port 8080 --timeout 60000 && echo "Server running"

In your package.json (using concurrently, but any multi-runner like npm-run-all is fine, too):

{
  ...
  "scripts": {
    "dev": "run-your-dev-server",
    "testcafe": "localhost-ready --port 8080 --timeout 10000 && testcafe",
    "test:e2e": "concurrently \"yarn dev\" \"yarn testcafe\""
  }
}

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i localhost-ready

      Weekly Downloads

      2

      Version

      0.0.2

      License

      MIT

      Unpacked Size

      3.46 kB

      Total Files

      5

      Last publish

      Collaborators

      • mrozbarry