# ps-wait

> Wait for a condition to be met

Latest version **1.0.6** (published 2016-06-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install ps-wait
pnpm add ps-wait
yarn add ps-wait
bun add ps-wait
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2016-06-03 |
| First published | 2016-06-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pluralsight |
| Maintainers | pluralsight |
| Keywords | wait, until, poll |

## Links

- npm: https://www.npmjs.com/package/ps-wait
- npm.io page: https://npm.io/package/ps-wait

## Dependencies (1)

- [is-promise](https://npm.io/package/is-promise.md) ^2.1.0

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2016-06-03
- 1.0.5 — 2016-06-03
- 1.0.2 — 2016-06-02
- 1.0.1 — 2016-06-02
- 1.0.0 — 2016-06-02

## README

## Usage

```javascript
const wait = require('ps-wait')

wait.until(() => conditionIsTrue())
    .then(() => doSomeOtherStuff())
```

## API

`wait.until(callback, intervalMs, maxWaitTimeMs)`

**callback** -- Is called on an interval until the result is truthy.
If it returns a promise, then the value the promise is resolved with
will be checked instead.

**intervalMs** -- How often to call the callback.

**maxWaitTimeMs** -- If the callback does not return or resolve to a truthy value within this
time limit in milliseconds, then the Promise returned by wait.until will
reject.

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