# convenient-methods-of-randomness

> A set of convenience methods for random number generation in Javascript.

Latest version **1.0.4** (published 2022-01-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install convenient-methods-of-randomness
pnpm add convenient-methods-of-randomness
yarn add convenient-methods-of-randomness
bun add convenient-methods-of-randomness
```

## 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.4 |
| Published | 2022-01-15 |
| First published | 2021-07-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jan Zaion |
| Maintainers | jan-zaion |
| Keywords | random |

## Links

- npm: https://www.npmjs.com/package/convenient-methods-of-randomness
- Repository: https://github.com/JanZaion/convenient-methods-of-randomness
- Homepage: https://github.com/JanZaion/convenient-methods-of-randomness#readme
- Issues: https://github.com/JanZaion/convenient-methods-of-randomness/issues
- npm.io page: https://npm.io/package/convenient-methods-of-randomness

## Recent versions

- 1.0.4 (latest) — 2022-01-15
- 1.0.3 — 2022-01-15
- 1.0.2 — 2021-07-10
- 1.0.1 — 2021-07-10
- 1.0.0 — 2021-07-10

## README

# Convenient Methods of Randomness

A set of convenience methods for random number generation in node.js.

## Install

`npm i convenient-methods-of-randomness`

## Example Usage

```
const dice = require('convenient-methods-of-randomness');
const zeroToFour = dice.int(5);
```

## Methods

`int(integer)` returns any integer in the 0 to integer-1 range.  
`boolean(probability)` returns random boolean value based on the probability input. 0.1 means 10% chance of true.  
`range(max, min)` returns any integer in the min to max-1 range. The max integer is excluded, so a roll for 2-8 would look like this: range(9, 2). The same exclusion of max applies to all the methods using max.  
`multiRollUniqueSortedAscending(max, min, rolls)` multiple dice rolls, returns an array of unique ascending different integer that is as long as the 'rolls' input.  
`multiRollSortedAscending(max, min, rolls)` multiple dice rolls, returns an array of ascending different integers that is as long as the 'rolls' input.  
`multiRollUniqueSortedDescending(max, min, rolls)` multiple dice rolls, returns an array of unique descending different integers that is as long as the 'rolls' input.  
`multiRollSortedDescending(max, min, rolls)` multiple dice rolls, returns an array of descending different integers that is as long as the 'rolls' input.  
`multiRollUniqueUnsorted(max, min, rolls)` multiple dice rolls, returns an array of unique unsorted integers that is as long as the 'rolls' input.  
`multiRollUnsorted(max, min, rolls)` multiple dice rolls, returns an array of unsorted integers that is as long as the 'rolls' input.

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