{"_id":"shuffle-array","_rev":"37-994c4f000e690bc4956cea5f8486a1d3","name":"shuffle-array","time":{"modified":"2022-06-26T19:11:52.655Z","created":"2014-01-24T08:23:18.545Z","0.0.0":"2014-01-24T08:23:19.322Z","0.0.2":"2014-08-20T12:09:13.736Z","0.1.0":"2014-12-30T18:03:42.288Z","0.1.1":"2015-11-30T20:55:37.006Z","0.1.2":"2015-12-29T13:39:02.606Z","2.0.0":"2016-03-22T23:51:36.310Z","0.0.1-security":"2016-03-23T22:22:04.178Z","1.0.0":"2016-04-09T22:14:26.943Z","1.0.1":"2017-02-16T11:40:36.406Z"},"maintainers":[{"name":"pazguille","email":"guille87paz@gmail.com"}],"dist-tags":{"latest":"1.0.1"},"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","versions":{"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","tarball":"https://registry.npmjs.org/shuffle-array/-/shuffle-array-2.0.0.tgz","integrity":"sha512-OBmXbQ1iOZyTegdC1fXf8WtLZZzLegxzPw1HufrwL8XQ/0i6wf+niVwYELvxoS1JXDt7vOSqfmLoEyil3y1KTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4Bat8Ll5aVL5Wk+2LTXaI6SpAyzWxM0V9OtTbMTR0TgIgcc+Eqn1auA+3iXledbt2shjpQl0virNUbIH3sAAvByI="}]},"maintainers":[{"name":"nj48","email":"spam@njohnson.me"}],"directories":{}},"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","tarball":"https://registry.npmjs.org/shuffle-array/-/shuffle-array-0.0.1-security.tgz","integrity":"sha512-BmAYlP6K/2uu/W0LwdTTWAOkbabDmmsgsQbASuV8kUSVCqqa/FfJhwFlHrMlEkU0G3rnMW5c+QoA3mjKrOlT7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiZ46eK6ypAsetBJTilZ1OKLSM83Ufr0ZKcfh/gnUexAIhAOfPJIqlP+dNObdK5kbc3+SSSVbnKnQtqg+w2H/fVl3U"}]},"maintainers":[{"name":"nj48","email":"spam@njohnson.me"}],"directories":{}},"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","tarball":"https://registry.npmjs.org/shuffle-array/-/shuffle-array-0.0.0.tgz","integrity":"sha512-Yxk6o95RQjtPhbzGr4pgUJyzWtRrFqMUoSsLV1o3Sp1FX9TjlzVCfoJYPMapVnxGvAApUlCnvMj7gOAxFg1vQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAg2JjCMgNfcyDMsSIjyOMam/kIJ7iIu3N7JPdvN3HycAiEAne3wueP1fUsn2AMix3FA3h+W1MypoNujPMKSSrhTCac="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"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","tarball":"https://registry.npmjs.org/shuffle-array/-/shuffle-array-0.0.2.tgz","integrity":"sha512-zkdraHJxZ+W79I4UG5oDOssOAt+5fITbRgLrgfe8XBXrPCZ7SqPEuclBYDFjaRf4k5lhqoT3mp4yMd4wLZNhXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGgPqH5P7eBPKZTnPf7U6Wv3bgMEr3Q+Iv32zLagDshEAiEA5WmvyhmTbWH2XqPDeaE/VbFU3RA5zJkfmDUcvVgvsgg="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}],"directories":{}},"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","tarball":"https://registry.npmjs.org/shuffle-array/-/shuffle-array-0.1.0.tgz","integrity":"sha512-O3QUq8RSUYKeqydRg1OUcWuBW36xittc/EBS8h804nTWUvXf8a2OQXaQzgnTSdS0KHEFJzmC6m6x9cJoWG81lA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrVCSrnC/ir5tfkO7wTZ7crsIufzN1U/r+v+OYUE8BAQIhAOShkZ0cwXlyAnPJ7cX67jK8X1TH+4vyiNtEtbO4ZSYb"}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}],"directories":{}},"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","tarball":"https://registry.npmjs.org/shuffle-array/-/shuffle-array-0.1.1.tgz","integrity":"sha512-/L7OJch8+OLkeZjaAVEQF2KdZI/i7dMy43mWGEUUmZArgZs5LOPNtcJZ8LqOUrOxtAorr0rl3UMhcQ/fvPJEQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/YTuKIFnCQbYiaPK6mn+kOVfaG4B5HgiHndg7WpsuAAiEA8ygLwdZ5qs2uAalqXasTWs/8ZTasUzehQ/IW8P5eZ38="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}],"directories":{}},"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","tarball":"https://registry.npmjs.org/shuffle-array/-/shuffle-array-0.1.2.tgz","integrity":"sha512-MXQ9JU8BxPWamW2eN/BZ3ZGWvRPmJYpE3OMpodAp3BvybxcQ5O9xGjGD2THTrxbln9JeDb0G2DSTXQYIB1uH3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCj9uroiekyHREAOFVvjDZJt3sEtUpovk5Pv5mZX/QZAgIgBm1u86lvdOxstteYwHtmSRFQ5BWc4aCvDozcKSA6I7g="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}],"directories":{}},"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","tarball":"https://registry.npmjs.org/shuffle-array/-/shuffle-array-1.0.0.tgz","integrity":"sha512-xYi2b8HLgTuTzAcCll2holvCfDHNWhd2q0Hi69hS6DbJm959Vy3klZrM97NEeSyTNOvLSNdDdtbKwGIih+GsLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBW3th+tWgZiHcYB7MgAY1x5tDxJqapD/lqHJ1XW6MkyAiAtgbiDqC63jbmwx8lh+U7Vb8Na8ErE5xWwGp8EA3FRZQ=="}]},"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":{}},"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","tarball":"https://registry.npmjs.org/shuffle-array/-/shuffle-array-1.0.1.tgz","integrity":"sha512-0TFRU8zVQaLatWKr0/czo19VyPNgb/a3sBc1GAjVfivfzEGaS54vueNgtAu/8/pW7EM/VF5fwq9zgpLdGyRmVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyrSbvj0zgVSrN6qrcVhh2KGfu++WOHtSFXWaKvsd3AwIgBUEFcc1kuSeN5Q/ZLVpW6wywLNq6uTpCxZEyocRhw/0="}]},"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":{}}},"license":"MIT","readmeFilename":"README.md","description":"Randomize the order of the elements in a given array.","homepage":"https://github.com/pazguille/shuffle-array#readme","keywords":["random","shuffle","array"],"repository":{"type":"git","url":"git+ssh://git@github.com/pazguille/shuffle-array.git"},"bugs":{"url":"https://github.com/pazguille/shuffle-array/issues"},"author":{"name":"Guille Paz","email":"guille87paz@gmail.com"},"users":{"rocket0191":true,"usex":true,"javart":true,"sasquatch":true,"olonam":true,"darrentorpey":true,"eaglex":true,"rparris":true}}