# tiny-xor

> tiny utility to make it easier to write conditionals

Latest version **1.0.0** (published 2019-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiny-xor
pnpm add tiny-xor
yarn add tiny-xor
bun add tiny-xor
```

## 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 | 2019-03-21 |
| First published | 2019-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Peter Squicciarini |
| Maintainers | twoseventythree |

## Links

- npm: https://www.npmjs.com/package/tiny-xor
- npm.io page: https://npm.io/package/tiny-xor

## Recent versions

- 1.0.0 (latest) — 2019-03-21

## README

# tiny-xor

a lot of times i want to see if one of two or more variables evaluates to true based on some function but not all of them and not none of them. that's xor, but sometimes writing xor logic inline muddies things up.

## install
```bash
npm i tiny-xor
```

## use
```javascript
const xor = require('tiny-xor')

function isTeen (age) {
  return age > 12 && age < 20
}

// wanting to see if one person is a teenager
let bob = 12
let harry = 13
let john = 14
let sarah = 20

console.log(xor([bob, harry, john, sarah], isTeen)) // false

console.log(xor([bob, harry, sarah], isTeen)) // true

console.log(xor([bob, sarah], isTeen)) // false

```

## license
MIT

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