2.0.0 • Published 9 years ago

randray v2.0.0

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

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)

2.0.0

9 years ago

1.0.0

9 years ago