@ce1pers/random-helpers
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

@ce1pers/random-helpers

Simple random helpers.

Installation

npm

npm i @ce1pers/random-helpers

yarn

yarn add @ce1pers/random-helpers

Usage

// Import helper.
import { generate, pick } from "@ce1pers/random-helpers";

const key = generate({ length: 15 });
console.log(key); // lj8xh4wb3bfyj7y (Example value).

// Picking one of them(1, 2, 3, 4, 5).
const [ok, picked] = pick([1, 2, 3, 4, 5]);

// Is success?
if (ok) {
  console.log(picked); // 3 (Selected value)
}

Package Sidebar

Install

npm i @ce1pers/random-helpers

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

18.1 kB

Total Files

16

Last publish

Collaborators

  • __coma__