randray

2.0.0 • Public • Published

randray

Build Status Coverage Status

Get a random item from an array

Note: randray is only supported on iojs and node v4+. To use with an older version of node, please use randray@1.

Install

$ npm install --save randray

API

var randray = require('randray')
 
// not an array will throw
randray(true)
 
// empty array will return null
randray([])
// => null
 
randray([1, 2, 3, 4])
// => 2

Test

$ npm test

Coverage

$ npm test -- --cov

Author

Evan Lucas

License

MIT (See LICENSE for more info)

Readme

Keywords

none

Package Sidebar

Install

npm i randray

Weekly Downloads

5

Version

2.0.0

License

MIT

Last publish

Collaborators

  • eh
  • evanlucas