You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

random-item

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-item

Get a random item from an Iterable

Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
16K
-9.63%
Maintainers
1
Weekly downloads
 
Created
Source

random-item Build Status

Get a random item from an Iterable

Install

$ npm install random-item

Usage

const randomItem = require('random-item');

randomItem(['🐴', '🦄', '🌈']);
//=> '🦄'

randomItem(new Set(['🐴', '🦄', '🌈']);
//=> '🌈'

License

MIT © Sindre Sorhus

Keywords

random

FAQs

Package last updated on 11 Apr 2019

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