1.2.2 • Published 2 years ago

@code-coaching/random v1.2.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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

Usage

As a CLI tool

Using npx to print out all possible options:

npx @code-coaching/random --help

Inside of a project

npm install @code-coaching/random

Examples

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
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.
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.
1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago