# awaitabase

> Wait for a database to be available prior to closing the process.

Latest version **1.1.4** (published 2022-03-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install awaitabase
pnpm add awaitabase
yarn add awaitabase
bun add awaitabase
```

Provides the command `awaitabase`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2022-03-17 |
| First published | 2022-03-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Rida F'kih |
| Maintainers | ridafkih |
| Keywords | database, await, wait |

## Links

- npm: https://www.npmjs.com/package/awaitabase
- Repository: https://github.com/ridafkih/awaitabase
- Homepage: https://github.com/ridafkih/awaitabase#readme
- Issues: https://github.com/ridafkih/awaitabase/issues
- npm.io page: https://npm.io/package/awaitabase

## Dependencies (4)

- [ora](https://npm.io/package/ora.md) ^5.4.1
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.0
- [mongoose](https://npm.io/package/mongoose.md) ^6.2.7
- [pg-promise](https://npm.io/package/pg-promise.md) ^10.11.1

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.1.4 (latest) — 2022-03-17
- 1.1.2 — 2022-03-17
- 1.1.1 — 2022-03-17
- 1.1.0 — 2022-03-17
- 1.0.4 — 2022-03-15
- 1.0.3 — 2022-03-15
- 1.0.2 — 2022-03-15
- 1.0.1 — 2022-03-15
- 1.0.0 — 2022-03-15

## README

[![Deploy Package on NPM](https://github.com/ridafkih/awaitabase/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/ridafkih/awaitabase/actions/workflows/npm-publish.yml)

# Awaitabase

A CLI tool that allows you to ensure a database is live before closing the process.

https://user-images.githubusercontent.com/9158485/158486267-4c935183-257f-451b-96d1-5f47659b58f4.mov

## Usage

### Command Structure
```sh
# If the optionalUrl is not defined, it will default to the DATABASE_URL environment variable.
npx awaitabase [driver] [optionalUrl]
```

### General CLI

```sh
npx awaitabase postgres postgres://user:password@localhost/database

# ⠼ Connecting to database... 0/30
# ⠼ Connecting to database... 1/30
# ✔ Database confirmed as active
```

### Inside NPM Project

```sh
npm i -D awaitabase
```

```js
// package.json
{
  // ...
  "scripts": {
    "database:wait": "awaitabase postgres postgres://user:password@localhost/database",
    "start": "database:wait && node ."
  }
  // ...
}
```

---
_Source: https://npm.io/package/awaitabase · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
