1.2.0 ā¢ Published 2 years ago
@ultirequiem/random-item v1.2.0
random_item
Get a random item from an array
Usage
The API is the same on all this platforms āļø
Deno š¦
import {
randomItem,
randomMultipleItems,
} from "https://deno.land/x/random_item/mod.ts";
randomItem(["š“", "š¦", "š"]); //=> 'š¦'
randomMultipleItems(["š“", "š¦", "š"], 2); //=> ['š', 'š¦']
randomItem([...new Set(["š“", "š¦", "š"])]); //=> 'š'
Node.js š¦
import { randomItem, randomMultipleItems } from "@ultirequiem/random-item";
Browser š
You can use any CDN š„
Eg š ESM āļø SkyPack š Script Tag āļø JSDelivr
Documentation
Is hosted on Deno Doc š
CLI
Install
- Deno š
deno install https://deno.land/x/random_item/random_item.ts
- Node.js š¼
npm install -g @ultirequiem/random-item
Usage
random_item --help
A binary for multiple platforms is provided too!
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 ā
Versioning
We use Semantic Versioning. For the versions available, see the tags š·ļø
Authors
Eliaz Bobadilla (a.k.a UltiRequiem) - Creator and Maintainer šŖ
See also the full list of contributors who participated in this project āØ
Licence
Licensed under the MIT License š