# conds

> Lisp inspired conditional construct (COND) in Javascript.

Latest version **0.0.1** (published 2015-11-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-11-08 |
| First published | 2015-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Miguel Mota |
| Maintainers | miguelmota |
| Keywords | conditional, expression, predicate, construct, lisp |

## Links

- npm: https://www.npmjs.com/package/conds
- Repository: https://github.com/miguelmota/cond
- Issues: https://github.com/miguelmota/cond/issues
- npm.io page: https://npm.io/package/conds

## Recent versions

- 0.0.1 (latest) — 2015-11-08

## README

# cond

> Lisp inspired conditional construct (COND) in Javascript.

[COND](https://www.cis.upenn.edu/~matuszek/LispText/lisp-cond.html) is a function which takes an arbitrary number clauses. Each clause contains a list of two expressions. First expression is a condition (or predicate) and the second is the result. Each clause is ran in order, immediately returning the result where the condition is truthy.

# Install

```bash
npm install conds
```

```bash
bower install conds
```

# Usage

```javascript
const cond = require('conds');

const fn = cond([
  [t => t === 0, `Water freezes at 0°C`],
  [t => t === 100, `Water boils at 100°C`],
  [true, t => `Nothing special happens at ${t}°C`]
]);

console.log(fn(0)); // 'Water freezes at 0°C'
console.log(fn(50)); // 'Nothing special happens at 50°C'
console.log(fn(100)); // 'Water boils at 100°C'
```

# Test

```bash
npm test
```

# License

MIT

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