# @dorianb/random-js

> A random js library for a quite simple usage

Latest version **0.0.7** (published 2021-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dorianb/random-js
pnpm add @dorianb/random-js
yarn add @dorianb/random-js
bun add @dorianb/random-js
```

## 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.0.7 |
| Published | 2021-06-11 |
| First published | 2020-07-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | D0rian |
| Maintainers | dorianb |
| Keywords | simple, random, library |

## Links

- npm: https://www.npmjs.com/package/@dorianb/random-js
- npm.io page: https://npm.io/package/@dorianb/random-js

## Recent versions

- 0.0.7 (latest) — 2021-06-11
- 0.0.6 — 2021-06-11
- 0.0.5 — 2021-03-20
- 0.0.4 — 2021-03-20
- 0.0.3 — 2020-10-23
- 0.0.2 — 2020-07-29
- 0.0.1 — 2020-07-29

## README

## Documentation

<a name="Random"></a>

## Random
<!-- Empty to hide the `**Kind**` tag in documentation -->

* [Random](#Random)
    * [.random()](#Random.random) ⇒ <code>number</code>
    * [.randint(a, b)](#Random.randint) ⇒ <code>number</code>
    * [.choice(array)](#Random.choice) ⇒ <code>any</code>
    * [.bool()](#Random.bool) ⇒ <code>boolean</code>
    * [.sign()](#Random.sign) ⇒ <code>number</code>
    * [.percent(percentage)](#Random.percent) ⇒ <code>boolean</code>

<a name="Random.random"></a>

### Random.random() ⇒ <code>number</code>
<!-- Empty to hide the `**Kind**` tag in documentation -->
**Returns**: <code>number</code> - Random number between 0 and 1  
<a name="Random.randint"></a>

### Random.randint(a, b) ⇒ <code>number</code>
<!-- Empty to hide the `**Kind**` tag in documentation -->
**Returns**: <code>number</code> - A random integer in the interval [a, b]  

| Param | Type | Description |
| --- | --- | --- |
| a | <code>number</code> | The lower band of the interval |
| b | <code>number</code> | The upper band of the interval |

<a name="Random.choice"></a>

### Random.choice(array) ⇒ <code>any</code>
<!-- Empty to hide the `**Kind**` tag in documentation -->
**Returns**: <code>any</code> - The element randomly choosen  

| Param | Type | Description |
| --- | --- | --- |
| array | <code>Array</code> | An array of elements |

<a name="Random.bool"></a>

### Random.bool() ⇒ <code>boolean</code>
<!-- Empty to hide the `**Kind**` tag in documentation -->
**Returns**: <code>boolean</code> - A random boolean  
<a name="Random.sign"></a>

### Random.sign() ⇒ <code>number</code>
<!-- Empty to hide the `**Kind**` tag in documentation -->
**Returns**: <code>number</code> - Return +1 or -1 with a probability of 0.5  
<a name="Random.percent"></a>

### Random.percent(percentage) ⇒ <code>boolean</code>
<!-- Empty to hide the `**Kind**` tag in documentation -->

| Param | Type | Description |
| --- | --- | --- |
| percentage | <code>number</code> | A percentage between 0 and 100 |


* * *

2020 &copy; Dorian Beauchesne

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