Skip to main content

random_item

codecov deno doc

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

You can use any CDN πŸ”₯

Eg. ESM β–Ά SkyPack / script tag β–Ά JSDelivr.

The API is the same on all this platforms.

Documentation

Autogenerated Documentation 😎

This package is strongly typed πŸ’ͺ

image

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.