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\""
  }
}

/localhost-ready/

    Package Sidebar

    Install

    npm i localhost-ready

    Weekly Downloads

    1

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    3.46 kB

    Total Files

    5

    Last publish

    Collaborators

    • mrozbarry