0.3.0 • Published 3 years ago

await-resource v0.3.0

Weekly downloads
13
License
ISC
Repository
github
Last release
3 years ago

await-resource

Simple utility tool which polls a resource (e.g. a database) until it is up. Useful e.g. in dev startup scripts. Currently only usable from npm scripts (or the command line), and works only for resources running in Docker containers.

E.g. await-resource --pg POSTGRES_CONTAINER_NAME_1 --pg POSTGRES_CONTAINER_NAME_2 --timeout 20000 waits until the postgres instances running in the two docker containers are BOTH up, or until the timeout of (20000ms = 20s) runs out - it throws an error in the latter case.

Usage

Postgres

await-resource --pg CONTAINER_NAME

RabbitMQ

await-resource --rabbit CONTAINER_NAME

Redis

await-resource --redis CONTAINER_NAME

MongoDB

await-resource --mongo CONTAINER_NAME

Firestore emulator

await-resource --firestore CONTAINER_NAME

URLs

await-resource --url SOME_URL polls the given URL until it returns a 2xx status code.

Configuration

You can wait for any number of resources in any combination in one command.

The default polling interval is 500ms, you can override it with e.g. --interval 100.

The default timeout value is 120000ms (2 minutes), you can override it with e.g. --timeout 10000.

0.3.0

3 years ago

0.2.6

3 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago