# gates

> Functional logic gates / combinators

Latest version **0.1.2** (published 2015-06-02) · MIT license · 0 weekly downloads

## Install

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

## 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.1.2 |
| Published | 2015-06-02 |
| First published | 2015-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | krambuhl |
| Keywords | gates, logic gates, functional programming, functional combinators, fp |

## Links

- npm: https://www.npmjs.com/package/gates
- Repository: git@github.com:krambuhl/gates
- Homepage: https://github.com/krambuhl/gates
- Issues: https://github.com/krambuhl/gates/issues
- npm.io page: https://npm.io/package/gates

## Dependencies (1)

- [komposit](https://npm.io/package/komposit.md) ^0.1.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.1.2 (latest) — 2015-06-02
- 0.1.1 — 2015-06-02

## README

# Gates

Gates defines logic gates function for composing more complex functions.

## Functions

- Gates.not
- Gates.or
- Gates.and
- Gates.nor
- Gates.nand
- Gates.xor
- Gates.xnor

## Example

```js
var isEven = function(n) { return n % 2 === 0 }
var isNotEven = Gates.not(isEven);

isEven(10); // true
isNotEven(10); // false

var isDivisibleBy3 = function(n) { return n % 3 === 0 }
var isNotEvenAndDivisibleBy3 = Gate.and(isNotEven, isDivisibleBy3)

isNotEvenAndDivisibleBy3(10) // false
isNotEvenAndDivisibleBy3(12) // true
```

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