# coalescy

> Simple function that return the first non null or undefined argument

Latest version **1.0.0** (published 2015-03-09) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2015-03-09 |
| First published | 2015-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Roy Riojas |
| Maintainers | royriojas |
| Keywords | coalesce, first, not, null, first, not, undefined, utility |

## Links

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

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-03-09

## README

[![NPM Version](http://img.shields.io/npm/v/coalescy.svg?style=flat)](https://npmjs.org/package/coalescy)
[![Build Status](http://img.shields.io/travis/royriojas/coalescy.svg?style=flat)](https://travis-ci.org/royriojas/coalescy)

# coalescy
> Simple function that return the first non null or undefined argument passed to it

## Install

```bash
npm i --save coalescy
```

## Usage

`coalescy` simply return the first non nully of the passed elements. Null if all the values are null

it works the same as

```javascript
a || b
```

but it works on falsie values too

## Example

```javascript 
var clsc = require('coalescy');
var obj = clsc(null, []); // obj = [];
obj = clsc(null, {}); // obj = {};
obj = clsc(null, [], {}); // obj = []; // the first non null
obj = clsc(null, undefined, 0, []) // 0
```

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