Socket
Book a DemoInstallSign in
Socket

pick-random

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pick-random

Pick random items from a list

latest
Source
npmnpm
Version
4.0.0
Version published
Weekly downloads
4.8K
125.78%
Maintainers
1
Weekly downloads
 
Created
Source

pick-random

Pick random items from a list

Useful for making decisions, picking a winner, or anything else randomness can help you with.

Install

$ npm install pick-random

Usage

import pickRandom from 'pick-random';

pickRandom(['Sindre', 'Stephen', 'Unicorn', 'Pascal', 'Addy', 'Pony'], {count: 2});
//=> ['Unicorn', 'Pony']

pickRandom(input, options?)

Returns an Array.

input

Type: Array

The list to pick from.

options

Type: object

count

Type: number
Default: 1

The number of picks.

Must be smaller or the same length as input.

  • pick-random-cli - CLI for this module

Keywords

pick

FAQs

Package last updated on 10 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts