# cubbyhole

> Asynchronous cubbyholes used to wait for a future value by name.

Latest version **4.0.9** (published 2022-02-07) · MIT license · 0 weekly downloads

## Install

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

## 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 | 4.0.9 |
| Published | 2022-02-07 |
| First published | 2017-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Alan Gutierrez |
| Maintainers | bigeasy |
| Keywords | async, semaphore, map |

## Links

- npm: https://www.npmjs.com/package/cubbyhole
- Repository: https://github.com/bigeasy/cubbyhole
- Issues: https://github.com/bigeasy/cubbyhole/issues
- npm.io page: https://npm.io/package/cubbyhole

## Dependencies (2)

- [perhaps](https://npm.io/package/perhaps.md) 0.0.13
- [vivifyer](https://npm.io/package/vivifyer.md) ^3.0.0

## 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

- 4.0.9 (latest) — 2022-02-07
- 3.0.0-alpha.3 (canary) — 2019-10-23
- 4.0.8 — 2021-09-20
- 4.0.7 — 2021-09-20
- 4.0.6 — 2021-07-23
- 4.0.5 — 2021-07-23
- 4.0.4 — 2021-03-28
- 4.0.3 — 2021-03-15
- 4.0.2 — 2021-01-12
- 4.0.1 — 2021-01-12
- 4.0.0 — 2020-05-05
- 3.0.0-alpha.2 — 2019-10-12
- 3.0.0-alpha.1 — 2019-09-17
- 3.0.0-alpha.0 — 2019-09-17
- 2.0.1 — 2019-07-22
- … 28 more at https://npm.io/package/cubbyhole/versions

## README

[![Actions Status](https://github.com/bigeasy/cubbyhole/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/cubbyhole/actions)
[![codecov](https://codecov.io/gh/bigeasy/cubbyhole/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/cubbyhole)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Asynchronous cubbyholes used to wait for a future value by name.

| What          | Where                                         |
| --- | --- |
| Discussion    | https://github.com/bigeasy/cubbyhole/issues/1 |
| Documentation | https://bigeasy.github.io/cubbyhole           |
| Source        | https://github.com/bigeasy/cubbyhole          |
| Issues        | https://github.com/bigeasy/cubbyhole/issues   |
| CI            | https://travis-ci.org/bigeasy/cubbyhole       |
| Coverage:     | https://codecov.io/gh/bigeasy/cubbyhole       |
| License:      | MIT                                           |


Departure installs from NPM.

```
npm install cubbyhole
```

## Overview

Extant is an implementation of SQL's COALESCE that I've used for some time to
deal with the fact that JavaScript truthiness will treat `''` and `0` as true so
the `||` operator can't always be used to create given or default one-liner.

```javascript
const { compare, raise, equal } = require('cubbyhole')
```

We use the name "extant" on NPM because we want the first extant argument.

## Living `README.md`

This `README.md` is also a unit test using the
[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the
Proof `okay` function to assert out statements in the readme. A Proof unit test
generally looks like this.

```javascript
require('proof')(4, async okay => {
    okay('always okay')
    okay(true, 'okay if true')
    okay(1, 1, 'okay if equal')
    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')
})
```

You can run this unit test yourself to see the output from the various
code sections of the readme.

```text
git clone git@github.com:bigeasy/cubbyhole.git
cd cubbyhole
npm install --no-package-lock --no-save
node test/readme.t.js
```

## Usage

The `'extant'` module exports a single `coalesce` function.

```javascript
const { compare, raise, equal } = require('depature')
```

Note that Extant is SQL's `COALESCE`. It returns the first non-null-like value,
that is the first value that is not `== null`, which would be `null` or
`undefined`. If there is no such argument it returns `null`.

```javascript
okay('test')
```

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