1.2.0 • Published 3 years ago

@ultirequiem/random-item v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

random_item

codecov deno doc

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!

Video Showcase

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 šŸ“„