# @js-random/all

> A collection of simple and lightweight randomizers for JavaScript (TypeScript friendly)

Latest version **0.3.5** (published 2019-03-28) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.5 |
| Published | 2019-03-28 |
| First published | 2019-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 16.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Raiondesu |
| Maintainers | raiondesu |
| Keywords | js, ts, typescript, javascript, string, number, boolean, array, random, simple, lightweight, es5, JSON, definetly-typed, modular, monorepo, micropackage |

## Links

- npm: https://www.npmjs.com/package/@js-random/all
- Repository: https://github.com/Raiondesu/random-something
- Homepage: https://github.com/Raiondesu/js-random/tree/master/packages/all#readme
- Issues: https://github.com/Raiondesu/random-something/issues
- npm.io page: https://npm.io/package/@js-random/all

## Dependencies (4)

- [@js-random/date](https://npm.io/package/@js-random/date.md) ^0.3.5
- [@js-random/number](https://npm.io/package/@js-random/number.md) ^0.3.5
- [@js-random/string](https://npm.io/package/@js-random/string.md) ^0.3.5
- [@js-random/boolean](https://npm.io/package/@js-random/boolean.md) ^0.3.5

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.3.5 (latest) — 2019-03-28
- 0.3.3 — 2019-03-26
- 0.3.2 — 2019-03-26
- 0.3.1 — 2019-03-26
- 0.3.0 — 2019-03-26
- 0.2.2 — 2019-03-26
- 0.2.1 — 2019-03-26
- 0.2.0 — 2019-03-26
- 0.1.1 — 2019-03-25
- 0.1.0 — 2019-03-25
- 0.0.9 — 2019-03-25
- 0.0.8 — 2019-03-25
- 0.0.7 — 2019-03-25
- 0.0.6 — 2019-03-25
- 0.0.4 — 2019-03-25
- … 3 more at https://npm.io/package/@js-random/all/versions

## README

# @js-random/all

> A collection of simple and lightweight randomizers for JavaScript (TypeScript friendly)

## Packages

Here's a list of packages that are included in this build:

- `@js-random/number` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/number#readme), [NPM](https://www.npmjs.com/@js-random/number)
- `@js-random/string` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/string#readme), [NPM](https://www.npmjs.com/@js-random/string)
- `@js-random/boolean` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/boolean#readme), [NPM](https://www.npmjs.com/@js-random/boolean)
- `@js-random/date` [GitHub repo](https://github.com/Raiondesu/js-random/tree/master/packages/date#readme), [NPM](https://www.npmjs.com/@js-random/date)

## Installation

For each individual package - see links above.

If you want everything at once, just do:
```
npm i -S @js-random/all
```

## Usage

There are two ways to use `@js-random/all`: imported and global.

### Imported

This way you need to import the object containing all the randomizers yourself:

**commonjs**:
```js
// Every @js-random package is contained in this object by their respective name
const random = require('@js-random/all');
```

**TS/ES6+**
```ts
import * as random from '@js-random/all';
```

**`<script>` tag**
```html
<script src="https://unpkg.com/@js-random/all"></script>
```

```ts
// For example - `@js-random/number` and `@js-random/boolean`:
const randomNumber = random.number(0, 10); // random number from 0 to 10 (inclusive)
const randomBoolean = random.boolean();    // half the chance of getting `true` or `false`
const probablyTrue = random.boolean(0.99); // 99% of getting `true`
```

### Global

This setup introduces side-effects: each package's function is inserted into global constructors as `random()` method:

**commonjs**
```js
require('@js-random/all/lib/global');
```

**ES6+**
```js
import '@js-random/all/module/global';
```

**TS**
```ts
import '@js-random/all/global';
```

and then:

```ts
const randomNumber = Number.random(0, 10);
const probablyTrue = Boolean.random(0.99); // 99% of getting `true`
// Same is true for String, Date and etc.
```

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