Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more

random_item

CI codecov deno doc

Custom badge Custom badge Custom badge

Get a random item from an array

Usage

Deno πŸš€

import {
  randomItem,
  randomMultipleItems,
} from "https://deno.land/x/random_item/mod.ts";

randomItem(["🐴", "πŸ¦„", "🌈"]);
//=> 'πŸ¦„'

randomMultipleItems(["🐴", "πŸ¦„", "🌈"], 2);
//=> ['🌈', 'πŸ¦„']

Node.js 🐒

import { randomTimeZone, timeZone } from "@ultirequiem/random-item";

Browser

Using type module 🍱

Using a plain script tag πŸ‘‡

You have the same API on all of this platforms.

Documentation

Autogenerated Documentation 😎

Support

Open an Issue, I will check it a soon as possible πŸ‘€

If you want to hurry me up a bit send me a tweet πŸ˜†

Consider supporting me on Patreon if you like my work πŸš€

Don’t forget to start the repo ⭐

Licence

Licensed under the MIT License.