🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@swarthy/wait-for

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swarthy/wait-for

Wait for (PostgresSQL|RabbitMQ|Redis) server is available

2.1.1
latest
Source
npm
Version published
Weekly downloads
603
9.64%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

wait-for

FAQs

Package last updated on 31 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts