# rtil

> 2 simple functions.

Latest version **1.1.1** (published 2022-03-05) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2022-03-05 |
| First published | 2022-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | upsided |
| Maintainers | upsided |
| Keywords | random, math, integer, upsided |

## Links

- npm: https://www.npmjs.com/package/rtil
- Repository: https://github.com/Upsidedly/rtil
- Homepage: https://github.com/Upsidedly/rtil#readme
- Issues: https://github.com/Upsidedly/rtil/issues
- npm.io page: https://npm.io/package/rtil

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2022-03-05
- 1.1.0 — 2022-03-05
- 1.0.0 — 2022-02-21

## README

# rtil
Two simple functions that make my programming easier

## Functions

### int
Returns a random integer from `min` to  `max`
### choice
Chooses a random element of the array provided.

## Example

```js
import { int, choice } from 'rtil'

// Returns random number from min to max

console.log(int(1, 10)) //=> 6
console.log(int(1, 10)) //=> 3
console.log(int(1, 10)) //=> 5

const stuff = ['cow', 'cat', 'duck', 'fish', 'dog']

// Returns random element of array

console.log(choice(stuff)) //=> 'duck'
console.log(choice(stuff)) //=> 'cow'
console.log(choice(stuff)) //=> 'dog'

```

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