random_item
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
This package is strongly typed 💪
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.