# blocking-await

> Synchronously wait for a Promise to resolve

Latest version **1.0.0** (published 2017-04-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install blocking-await
pnpm add blocking-await
yarn add blocking-await
bun add blocking-await
```

## 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.0 |
| Published | 2017-04-23 |
| First published | 2017-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.8 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Will Franzen |
| Maintainers | wtfaremyinitials |

## Links

- npm: https://www.npmjs.com/package/blocking-await
- Repository: https://github.com/wtfaremyinitials/blocking-await
- Homepage: https://github.com/wtfaremyinitials/blocking-await#readme
- Issues: https://github.com/wtfaremyinitials/blocking-await/issues
- npm.io page: https://npm.io/package/blocking-await

## Dependencies (1)

- [deasync](https://npm.io/package/deasync.md) ^0.1.9

## Recent versions

- 1.0.0 (latest) — 2017-04-23

## README

blocking-await
===

![](https://img.shields.io/npm/dm/blocking-await.svg)
![](https://img.shields.io/npm/v/blocking-await.svg)
![](https://img.shields.io/npm/l/blocking-await.svg)

> Synchronously wait for a Promise to resolve

Use this module to block the entire node process while waiting for a Promise to resolve.

**NOTE**: In almost every case you should not use this and instead opt for true `async` functions
using JavaScript's built-in `await` construct. Your entire app will become unresponsive while waiting.

Installation
===

```bash
npm install blocking-await --save
```

Usage
===

```js
var wait = require('blocking-await')
var got = require('got')

var res = wait(got('todomvc.com'))
console.log(res.body)
//=> '<!doctype html> ...'
```

API
===

### Wait for a Promise to resolve

`wait(promise) -> value`

Synchronously waits for a Promise to resolve. This locks up the entire node process.

**promise**

Type: `Promise`

The promise to wait on.

**return**

Type: `T`

Returns the value the promise resolved (or throws what it rejected).

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