pengrape

A collection of utilities generating anything random.

Usage no npm install needed!

<script type="module">
  import pengrape from 'https://cdn.skypack.dev/pengrape';
</script>

README

pengrape

A collection of utilities generating anything random.

Installation

$ npm install pengrape

Usage

const random = require("pengrape");

Number

const number = random.number({ min: 0, max: 20 });
console.log(number); // 12

Color

const color = random.color({ format: "hex" });
console.log(color); // "#f28e51"

Password

const password = random.password({ symbol: false });
console.log(password); // "W7q0Va5RY53L63o7U0it"

Spinner

const spinner = random.spinner({ entries: ["Pizza", "Lasagna", "Quesadilla"] });
console.log(spinner); // "Lasagna"

Dice

const dice = random.dice({ notation: "2d10" });
console.log(dice); // { results: [ 4, 9 ], total: 13 }

Text

const text = random.text({ type: "word" });
console.log(text); // "inwitada"

Date

const date = random.date({ dateStart: [2021, 1, 1], dateEnd: [2021, 6, 17] });
console.log(date); // "2021-04-29"

See the full docs for details and examples.

Issues

If any issues are found, they can be reported here.

License

This project is licensed under the MIT license.