{"_id":"shuffle-array","_rev":"480883","name":"shuffle-array","description":"Randomize the order of the elements in a given array.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"time":{"modified":"2021-08-05T09:35:48.000Z","created":"2014-01-24T08:23:19.322Z","1.0.1":"2017-02-16T11:40:36.406Z","1.0.0":"2016-04-09T22:14:26.943Z","0.0.1-security":"2016-03-23T22:22:04.178Z","2.0.0":"2016-03-22T23:51:36.310Z","0.1.2":"2015-12-29T13:39:02.606Z","0.1.1":"2015-11-30T20:55:37.006Z","0.1.0":"2014-12-30T18:03:42.288Z","0.0.2":"2014-08-20T12:09:13.736Z","0.0.0":"2014-01-24T08:23:19.322Z"},"users":{"pazguille":true,"coleww":true,"kimhoe":true,"rocket0191":true,"usex":true,"javart":true,"sasquatch":true,"olonam":true,"darrentorpey":true,"eaglex":true,"rparris":true},"author":{"name":"Guille Paz","email":"guille87paz@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/pazguille/shuffle-array.git"},"versions":{"1.0.1":{"name":"shuffle-array","repository":{"type":"git","url":"git+ssh://git@github.com/pazguille/shuffle-array.git"},"description":"Randomize the order of the elements in a given array.","author":{"name":"Guille Paz","email":"guille87paz@gmail.com"},"version":"1.0.1","scripts":{"build":"gulp","dist":"gulp && gulp min","test":"gulp && istanbul cover -x Gulpfile.js gulp test"},"devDependencies":{"better-assert":"1.0.2","gulp":"3.9.1","gulp-footer":"1.0.5","gulp-header":"1.8.8","gulp-mocha":"3.0.1","gulp-rename":"1.2.2","gulp-replace":"0.5.4","gulp-uglify":"2.0.1","mkdirp":"0.5.1","coveralls":"2.11.16","istanbul":"0.4.5"},"main":"index.js","keywords":["random","shuffle","array"],"license":"MIT","gitHead":"e68c8013ef58a7ef4938a96033452b7d8df63343","bugs":{"url":"https://github.com/pazguille/shuffle-array/issues"},"homepage":"https://github.com/pazguille/shuffle-array#readme","_id":"shuffle-array@1.0.1","_shasum":"c4ff3cfe74d16f93730592301b25e6577b12898b","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"pazguille","email":"guille87paz@gmail.com"},"dist":{"shasum":"c4ff3cfe74d16f93730592301b25e6577b12898b","size":17819,"noattachment":false,"key":"/shuffle-array/-/shuffle-array-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/shuffle-array/download/shuffle-array-1.0.1.tgz"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/shuffle-array-1.0.1.tgz_1487245236182_0.40693738777190447"},"directories":{},"publish_time":1487245236406,"_cnpm_publish_time":1487245236406,"_hasShrinkwrap":false},"1.0.0":{"name":"shuffle-array","repository":{"type":"git","url":"git+ssh://git@github.com/pazguille/shuffle-array.git"},"description":"Randomize the order of the elements in a given array.","author":{"name":"Guille Paz","email":"guille87paz@gmail.com"},"version":"1.0.0","scripts":{"dist":"gulp","test":"gulp && istanbul cover -x Gulpfile.js gulp test"},"devDependencies":{"better-assert":"1.0.2","gulp":"3.9.0","gulp-footer":"1.0.5","gulp-header":"1.7.1","gulp-mocha":"2.2.0","gulp-rename":"1.2.2","gulp-replace":"0.5.4","gulp-uglify":"1.5.1","mkdirp":"0.5.1","coveralls":"2.11.4","istanbul":"0.4.1"},"main":"index.js","keywords":["random","shuffle","array"],"license":"MIT","gitHead":"50bfa6cb7555c7acd6c1568291785a1cfb736e99","bugs":{"url":"https://github.com/pazguille/shuffle-array/issues"},"homepage":"https://github.com/pazguille/shuffle-array#readme","_id":"shuffle-array@1.0.0","_shasum":"98a13e3cd9b7cc6c3d9b9b8f62c28e3356c7da06","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"pazguille","email":"guille87paz@gmail.com"},"dist":{"shasum":"98a13e3cd9b7cc6c3d9b9b8f62c28e3356c7da06","size":5072,"noattachment":false,"key":"/shuffle-array/-/shuffle-array-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/shuffle-array/download/shuffle-array-1.0.0.tgz"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/shuffle-array-1.0.0.tgz_1460240066461_0.25209311838261783"},"directories":{},"publish_time":1460240066943,"_cnpm_publish_time":1460240066943,"_hasShrinkwrap":false},"0.0.1-security":{"name":"shuffle-array","version":"0.0.1-security","description":"This package name is not currently in use, but was formerly occupied by a popular package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/npm/security-holder.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/npm/security-holder/issues"},"homepage":"https://github.com/npm/security-holder#readme","gitHead":"d1719e2a152734ed854065de56039770c9104d83","_id":"shuffle-array@0.0.1-security","_shasum":"efa10d6da657796da19705678307da9920963ddb","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.1.0","_npmUser":{"name":"npm","email":"npm@npmjs.com"},"dist":{"shasum":"efa10d6da657796da19705678307da9920963ddb","size":581,"noattachment":false,"key":"/shuffle-array/-/shuffle-array-0.0.1-security.tgz","tarball":"http://registry.cnpm.dingdandao.com/shuffle-array/download/shuffle-array-0.0.1-security.tgz"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/shuffle-array-0.0.1-security.tgz_1458771723508_0.5175746360328048"},"directories":{},"publish_time":1458771724178,"_cnpm_publish_time":1458771724178,"_hasShrinkwrap":false},"2.0.0":{"name":"shuffle-array","version":"2.0.0","description":"","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","_id":"shuffle-array@2.0.0","_shasum":"dbb98e89f95f5889d5c8c3dd48da375518684ffe","_from":".","_npmVersion":"3.7.2","_nodeVersion":"4.3.0","_npmUser":{"name":"nj48","email":"spam@njohnson.me"},"dist":{"shasum":"dbb98e89f95f5889d5c8c3dd48da375518684ffe","size":1865,"noattachment":false,"key":"/shuffle-array/-/shuffle-array-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/shuffle-array/download/shuffle-array-2.0.0.tgz"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/shuffle-array-2.0.0.tgz_1458690695794_0.5341861327178776"},"directories":{},"publish_time":1458690696310,"_cnpm_publish_time":1458690696310,"_hasShrinkwrap":false},"0.1.2":{"name":"shuffle-array","repository":"git@github.com:pazguille/shuffle-array.git","description":"Randomize the order of the elements in a given array.","author":"Guille Paz <guille87paz@gmail.com>","version":"0.1.2","scripts":{"dist":"gulp","test":"gulp && istanbul cover -x Gulpfile.js gulp test"},"devDependencies":{"better-assert":"1.0.2","gulp":"3.9.0","gulp-footer":"1.0.5","gulp-header":"1.7.1","gulp-mocha":"2.2.0","gulp-rename":"1.2.2","gulp-replace":"0.5.4","gulp-uglify":"1.5.1","mkdirp":"0.5.1","coveralls":"2.11.4","istanbul":"0.4.1"},"main":"index.js","keywords":["random","shuffle","array"],"license":"MIT","_id":"shuffle-array@0.1.2","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"3f0cf0806641a8c703210eafdb923bd65604aa7a","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"3f0cf0806641a8c703210eafdb923bd65604aa7a","size":5081,"noattachment":false,"key":"/shuffle-array/-/shuffle-array-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/shuffle-array/download/shuffle-array-0.1.2.tgz"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"directories":{},"publish_time":1451396342606,"_cnpm_publish_time":1451396342606,"_hasShrinkwrap":false},"0.1.1":{"name":"shuffle-array","repository":"git@github.com:pazguille/shuffle-array.git","description":"Randomize the order of the elements in a given array.","author":"Guille Paz <guille87paz@gmail.com>","version":"0.1.1","scripts":{"dist":"gulp","test":"gulp test"},"devDependencies":{"better-assert":"^1.0.1","gulp":"^3.6.2","gulp-footer":"^1.0.5","gulp-header":"^1.0.5","gulp-mocha":"^0.5.2","gulp-rename":"^1.2.0","gulp-replace":"^0.4.0","gulp-uglify":"^0.3.1","mkdirp":"^0.3.5"},"main":"index.js","keywords":["random","shuffle","array"],"license":"MIT","_id":"shuffle-array@0.1.1","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"073ca54ec2db78fccf02d3b7dad84694fda78388","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"073ca54ec2db78fccf02d3b7dad84694fda78388","size":4800,"noattachment":false,"key":"/shuffle-array/-/shuffle-array-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/shuffle-array/download/shuffle-array-0.1.1.tgz"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"directories":{},"publish_time":1448916937006,"_cnpm_publish_time":1448916937006,"_hasShrinkwrap":false},"0.1.0":{"name":"shuffle-array","repository":"git@github.com:pazguille/shuffle-array.git","description":"Randomize the order of the elements in a given array.","author":"Guille Paz <guille87paz@gmail.com>","version":"0.1.0","scripts":{"dist":"gulp","test":"gulp test"},"devDependencies":{"better-assert":"^1.0.1","gulp":"^3.6.2","gulp-footer":"^1.0.5","gulp-header":"^1.0.5","gulp-mocha":"^0.5.2","gulp-rename":"^1.2.0","gulp-replace":"^0.4.0","gulp-uglify":"^0.3.1","mkdirp":"^0.3.5"},"main":"index.js","keywords":["random","shuffle","array"],"license":"MIT","_id":"shuffle-array@0.1.0","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"81d2b3da7edb62355d1249eb4e351eedcc514c29","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"81d2b3da7edb62355d1249eb4e351eedcc514c29","size":4795,"noattachment":false,"key":"/shuffle-array/-/shuffle-array-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/shuffle-array/download/shuffle-array-0.1.0.tgz"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"directories":{},"publish_time":1419962622288,"_cnpm_publish_time":1419962622288,"_hasShrinkwrap":false},"0.0.2":{"name":"shuffle-array","repository":"git@github.com:pazguille/shuffle-array.git","description":"Randomize the order of the elements in a given array.","author":"Guille Paz <guille87paz@gmail.com>","version":"0.0.2","scripts":{"start":"gulp","test":"gulp test"},"devDependencies":{"better-assert":"^1.0.1","gulp":"^3.6.2","gulp-footer":"^1.0.5","gulp-header":"^1.0.5","gulp-mocha":"^0.5.2","gulp-rename":"^1.2.0","gulp-replace":"^0.4.0","gulp-uglify":"^0.3.1","mkdirp":"^0.3.5"},"main":"index.js","keywords":["random","shuffle","array"],"license":"MIT","_id":"shuffle-array@0.0.2","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"d4840f0b9a75502c714bc33931541f2acebc914d","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"d4840f0b9a75502c714bc33931541f2acebc914d","size":4510,"noattachment":false,"key":"/shuffle-array/-/shuffle-array-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/shuffle-array/download/shuffle-array-0.0.2.tgz"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"directories":{},"publish_time":1408536553736,"_cnpm_publish_time":1408536553736,"_hasShrinkwrap":false},"0.0.0":{"name":"shuffle-array","version":"0.0.0","description":"Randomize the order of the elements in a given array. ","main":"index.js","directories":{"test":"test"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/pazguille/shuffle-array"},"keywords":["shuffle","array"],"author":"Guille Paz","license":"BSD","bugs":{"url":"https://github.com/pazguille/shuffle-array/issues"},"_id":"shuffle-array@0.0.0","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"185d26047842845fc77e2bc2038580c22f297afd","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"185d26047842845fc77e2bc2038580c22f297afd","size":3968,"noattachment":false,"key":"/shuffle-array/-/shuffle-array-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/shuffle-array/download/shuffle-array-0.0.0.tgz"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"publish_time":1390551799322,"_cnpm_publish_time":1390551799322,"_hasShrinkwrap":false}},"readme":"# shuffle-array\n\n[![NPM version][npm-image]][npm-link] [![License][lic-image]][npm-link] [![Build status][travis-image]][travis-link] [![Coverage Status][coverage-image]][coverage-link] [![devDependency status][devdeps-image]][devdeps-link] [![downloads][dt-image]][npm-link]\n\n> Randomize the order of the elements in a given array using the [Fisher-Yates algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle).\n\n## Installation\n\n    $ npm install shuffle-array\n\n    $ bower install shuffle-array\n\n    $ component install pazguille/shuffle-array\n\n## Usage\n```js\nvar shuffle = require('shuffle-array'),\n    collection = [1,2,3,4,5];\n\nshuffle(collection);\n\nconsole.log(collection); // returns [4, 3, 1, 5, 2]\n```\n\n## API\n\n### shuffle(arr, [options])\nRandomizes the order of the elements in a given `array`.\n- `arr` - The given array.\n- [`options`] {Object} - Optional configuration options.\n- [`options.copy`] {Boolean} - Sets if should return a shuffled copy of the given array. By default it's a falsy value.\n- [`options.rng`] {Function} - Specifies a custom random number generator.\n\n```js\nshuffle([1,2,3,4,5]); // returns [4, 3, 1, 5, 2]\n\n// Return a copy of the given array\nshuffle([1,2,3,4,5], { 'copy': true }); // returns [4, 3, 1, 5, 2] (copied)\n```\n\n### shuffle.pick(arr, [options])\nPick one or more `random` elements from the given `array`.\n- `arr` - The given array.\n- [`options`] {Object} - Optional configuration options.\n- [`options.picks`] {Number} - Specifies how many random elements you want to pick. By default it picks 1.\n- [`options.rng`] {Function} - Specifies a custom random number generator.\n\n```js\nshuffle.pick([1,2,3,4,5]); // returns 5\n\n// Return a random collection with 2 elements\nshuffle.pick([1,2,3,4,5], { 'picks': 2 })); // returns [4, 3]\n```\n\n## Build\n\n    npm run dist\n\n## Test\n\n    npm test\n\n## With :heart: by\n- Guille Paz (Front-end developer | Web standards lover)\n- E-mail: [guille87paz@gmail.com](mailto:guille87paz@gmail.com)\n- Twitter: [@pazguille](http://twitter.com/pazguille)\n- Web: [http://pazguille.me](http://pazguille.me)\n\n## License\nMIT license. Copyright © 2014.\n\n[npm-image]: https://img.shields.io/npm/v/shuffle-array.svg\n[lic-image]: https://img.shields.io/npm/l/shuffle-array.svg\n[npm-link]: https://npmjs.org/package/shuffle-array\n[travis-image]: https://img.shields.io/travis/pazguille/shuffle-array.svg\n[travis-link]: https://travis-ci.org/pazguille/shuffle-array\n[devdeps-image]: https://img.shields.io/david/dev/pazguille/shuffle-array.svg\n[devdeps-link]: https://david-dm.org/pazguille/shuffle-array#info=devDependencies\n[dt-image]: https://img.shields.io/npm/dt/shuffle-array.svg\n[coverage-image]: https://img.shields.io/coveralls/pazguille/shuffle-array.svg\n[coverage-link]: https://coveralls.io/github/pazguille/shuffle-array\n","_attachments":{},"homepage":"https://github.com/pazguille/shuffle-array#readme","bugs":{"url":"https://github.com/pazguille/shuffle-array/issues"},"license":"MIT"}