# @code-coaching/random

> This package provides functions to generate random stuff (strings, numbers, uuid). It can be used as a dependency for other packages. It can be used as a CLI tool.

Latest version **1.2.2** (published 2022-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @code-coaching/random
pnpm add @code-coaching/random
yarn add @code-coaching/random
bun add @code-coaching/random
```

Provides the command `random`.

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2022-02-06 |
| First published | 2022-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 18.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Bart Duisters |
| Maintainers | bartduisters |

## Links

- npm: https://www.npmjs.com/package/@code-coaching/random
- npm.io page: https://npm.io/package/@code-coaching/random

## Dependencies (4)

- [meow](https://npm.io/package/meow.md) ^10.1.2
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [chalk](https://npm.io/package/chalk.md) ^5.0.0
- [typescript](https://npm.io/package/typescript.md) ^4.5.5

## Recent versions

- 1.2.2 (latest) — 2022-02-06
- 1.2.1 — 2022-01-25
- 1.2.0 — 2022-01-25
- 1.1.0 — 2022-01-05
- 1.0.5 — 2022-01-05
- 1.0.4 — 2022-01-05
- 1.0.3 — 2022-01-05
- 1.0.2 — 2022-01-05
- 1.0.1 — 2022-01-05

## README

# Code Coaching - Random

This package provides functions to generate random stuff (strings, id, uuid). It can be used as a dependency for other packages. It can be used as a CLI tool.

## Prerequisites

- [Node.js](https://nodejs.org/en/)
- [npm](https://www.npmjs.com/)

## Usage

### As a CLI tool

Using `npx` to print out all possible options:

```sh
npx @code-coaching/random --help
```

### Inside of a project

```sh
npm install @code-coaching/random
```

#### Examples

```js
import { randomUUID } from "../dist/index.js";
// This will be: import { randomUUID } from "@code-coaching/random"; inside of a project.

console.log(randomUUID()); // This will generate a random UUID, e.g. b2c58d7e-f91a-4bc6-a5e6-25aa1ba0f573
```

```js
import { randomID } from "../dist/index.js";
// This will be: import { randomID } from "@code-coaching/random"; inside of a project.

console.log(randomID()); // This will generate a random ID of length 8.
console.log(randomID(4)); // This will generate a random ID of length 4.
console.log(randomID(100)); // This will generate a random ID of length 100.
```

```js
import { randomString } from "../dist/index.js";
// This will be: import { randomString } from "@code-coaching/random"; inside of a project.

console.log(randomString()); // Generates a random string of length 8.
console.log(randomString(4)); // Generates a random string of length 4.
console.log(randomString(100)); // Generates a random string of length 100.
```

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