2.1.1 • Published 3 years ago

@swarthy/wait-for v2.1.1

Weekly downloads
712
License
MIT
Repository
github
Last release
3 years ago

wait-for

npm Build Status

wait-for will try connect to server then exit with code 0 if server is available and 1 otherwise.

Usage

PostgreSQL

wait-for --postgresql postgres://postgres@localhost && npm run test-integration
# or
POSTGRESQL_URI=postgres://postgres@localhost wait-for --postgresql && npm run test-integration

RabbitMQ

wait-for --rabbitmq amqp://localhost && npm run test-integration
# or
RABBITMQ_URI=amqp://localhost wait-for --rabbitmq && npm run test-integration

Redis

wait-for --redis redis://localhost && npm run test-integration
# or
REDIS_URI=redis://localhost wait-for --redis && npm run test-integration

Example

Wait for PostgreSQL, RabbitMQ and Redis (configured via environment)

wait-for --postgresql --rabbitmq --redis && npm run test-integration

Configuration

CLI argumentEnvironment variableDescriptionDefault
--postgressqlPOSTGRESQL_URIConnection string
--rabbitmqRABBITMQ_URIConnection string
--redisREDIS_URIConnection string
-c, --max-attemptsMax attempt count60
-d, --delayDelay between attempts1000
-q, --quietQuiet mode

Used packages

amqplib pg redis

2.1.1

3 years ago

2.1.0

3 years ago

2.0.3

4 years ago

2.0.2

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago