# @writetome51/in-range

> Checks if a given number is within a given range and returns boolean

Latest version **2.0.3** (published 2021-03-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @writetome51/in-range
pnpm add @writetome51/in-range
yarn add @writetome51/in-range
bun add @writetome51/in-range
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2021-03-24 |
| First published | 2018-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Steve Thompson |
| Maintainers | writetome51 |
| Keywords | math, numbers, range, ranges |

## Links

- npm: https://www.npmjs.com/package/@writetome51/in-range
- Homepage: https://github.com/writetome51/in-range#readme
- npm.io page: https://npm.io/package/@writetome51/in-range

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2021-03-24
- 2.0.2 — 2020-08-29
- 2.0.1 — 2020-08-13
- 2.0.0 — 2020-08-02
- 1.0.4 — 2019-04-11
- 1.0.3 — 2019-02-21
- 1.0.2 — 2018-12-06
- 1.0.0 — 2018-10-14

## README

#  inRange(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[min, max], <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num<br>): boolean

Checks if `num` is within range of  `[min,  max]`.   
`min`,`max`, and `num` must all be type "number".


## Examples:
```js
inRange([2.5, 8.5], 8.6); // --> false

inRange([0, 200], 100); // --> true

inRange([-10, 0], -10); // --> true

inRange([-10, 0], -11); // --> false

// The numbers cannot be strings, because this gives unpredictable results.
// For instance, in string comparison, '30' is greater than both '20' and '100'
inRange(['20', '100'], '30');
// 'Error: Input must be of type "number"'

```

## Installation
`npm i  @writetome51/in-range`

## Loading
```js
import { inRange} from '@writetome51/in-range';
```

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