{"_id":"array-shuffle","_rev":"17-e6e61dba4a9fbb017551b90437c7a47b","name":"array-shuffle","dist-tags":{"latest":"4.1.0"},"versions":{"0.1.0":{"name":"array-shuffle","version":"0.1.0","keywords":["array","arr","list","shuffle","sort","random","rand","fisher","yates"],"author":{"url":"http://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"array-shuffle@0.1.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/array-shuffle","bugs":{"url":"https://github.com/sindresorhus/array-shuffle/issues"},"dist":{"shasum":"228486aba98864241725bb24ae69871824ad4753","tarball":"https://registry.npmjs.org/array-shuffle/-/array-shuffle-0.1.0.tgz","integrity":"sha512-ruOnRQsn1iIrvtm6oVDDTdo6yDSh2eF3+M2JoT/6I1J4BmTV0eJtPCRmIGaBBlTZh3RN7jov6QuxHg4A/qUuUg==","signatures":[{"sig":"MEYCIQDAzcAujO1O41z+m/9NDNXBlkGO32Vwohnbn/VrPl6qpgIhANVkeckvkcQlb8Miuv6k4Sgjf4xfK3ZAh6GzZNj9yM0/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"228486aba98864241725bb24ae69871824ad4753","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha","browser":"browserify -s $npm_package_name -o browser.js ."},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git://github.com/sindresorhus/array-shuffle","type":"git"},"_npmVersion":"1.4.9","description":"Randomize the order of items in an array","directories":{},"devDependencies":{"mocha":"*","browserify":"*"}},"1.0.0":{"name":"array-shuffle","version":"1.0.0","keywords":["array","arr","list","shuffle","sort","random","rand","fisher","yates"],"author":{"url":"http://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"array-shuffle@1.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/array-shuffle","bugs":{"url":"https://github.com/sindresorhus/array-shuffle/issues"},"dist":{"shasum":"c133fa73587099bd77ad17cb762dd7ee44d9415b","tarball":"https://registry.npmjs.org/array-shuffle/-/array-shuffle-1.0.0.tgz","integrity":"sha512-q8iN5P3sXMg7dFPymwPdHpvP9SwdfwCaSfg5eUHsNZkzE4aliCzicRW8sP7zQM7FboHo/xUK9HhmlFa/uun4IA==","signatures":[{"sig":"MEYCIQD5aD79u9ZgUzjHCBmahYdZZwoqUKMNl5J4EI+wJwZ5cAIhAM2E2ELT02PcAiNQiKH9g4rqvK4w7uGCIWIU43/pIN2f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"c133fa73587099bd77ad17cb762dd7ee44d9415b","engines":{"node":">=0.10.0"},"gitHead":"62c3030d199601c644392dbce3ac822b222d1b4b","scripts":{"test":"mocha"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git://github.com/sindresorhus/array-shuffle","type":"git"},"_npmVersion":"1.4.14","description":"Randomize the order of items in an array","directories":{},"devDependencies":{"mocha":"*"}},"1.0.1":{"name":"array-shuffle","version":"1.0.1","keywords":["array","arr","list","shuffle","sort","random","rand","fisher","yates"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"array-shuffle@1.0.1","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/array-shuffle#readme","bugs":{"url":"https://github.com/sindresorhus/array-shuffle/issues"},"dist":{"shasum":"7ea4882a356b4bca5f545e0b6e52eaf6d971557a","tarball":"https://registry.npmjs.org/array-shuffle/-/array-shuffle-1.0.1.tgz","integrity":"sha512-PBqgo1Y2XWSksBzq3GFPEb798ZrW2snAcmr4drbVeF/6MT/5aBlkGJEvu5A/CzXHf4EjbHOj/ZowatjlIiVidA==","signatures":[{"sig":"MEYCIQCYT4K0E8EjDysfLN8M67ZtmsckEwYpflpRSk5FGWM06wIhAORAK2i+N7AKBwTdCBiI/CIr3VPc3DEroo3TVnlXyIRo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","files":["index.js"],"_shasum":"7ea4882a356b4bca5f545e0b6e52eaf6d971557a","engines":{"node":">=0.10.0"},"gitHead":"4fb28db5732f8e39ae91e7b59b44bd4a189d5fab","scripts":{"test":"xo && ava"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/array-shuffle.git","type":"git"},"_npmVersion":"2.15.0","description":"Randomize the order of items in an array","directories":{},"_nodeVersion":"4.4.2","devDependencies":{"xo":"*","ava":"*"},"_npmOperationalInternal":{"tmp":"tmp/array-shuffle-1.0.1.tgz_1466079203271_0.5538289665710181","host":"packages-16-east.internal.npmjs.com"}},"2.0.0":{"name":"array-shuffle","version":"2.0.0","keywords":["array","list","shuffle","sort","random","rand","fisher","yates","durstenfeld"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"array-shuffle@2.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/array-shuffle#readme","bugs":{"url":"https://github.com/sindresorhus/array-shuffle/issues"},"dist":{"shasum":"fd36437cd7997d557055283c946e46379a7cd343","tarball":"https://registry.npmjs.org/array-shuffle/-/array-shuffle-2.0.0.tgz","fileCount":5,"integrity":"sha512-rJTchCppiO6QsQnN51KDH1cgMYm13B+ybxFS5GgdBdTTHpZcrq3M7SOBgzp+L9fqqnjkFDiwdEVcX1wINgl9DQ==","signatures":[{"sig":"MEUCIQCq929Pdj0C/chQKDYditmskXngJy13LR+V88hSP6R8TAIgPnzBdNgWNi6+Lui7WVmaCkfGkCJhpbcgM6yDeM1FeHg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyHF4CRA9TVsSAnZWagAAQRUP/3+kvfTYoo6B/fpupjOB\ntERXolYj33rT7zTppKt12H1QNHsn61MG5AnAUNHfjpv9EdIG9esaQ5HpZ/9g\nl0nJGYhPuXVZIUvunRiSJG3AvqBvVWA6jLjhG+dr0X34LvShE0l3zYDTwBG9\nYD6zscJ/tK0PjFo7RG1l6fwY/Y4CRbxIOvkrWrqkU7a8aeRd0G5mAsFyRtDJ\nc+BdPKX93gcUaiM/PJ+Mi++kiqitJQFNJEJD6qvajPkzgC+3vBUjTLRN61U5\n84RRqdRNtYPkfbvQAZDPuGnXkJljfzqmzkOU2rI8lHdLLt6MiQrxltbe8Wmc\nbwrBL2SauKtVPIxFgk47r7/CB/ahH+7UWiOs8EcOZqJyovbOBU9s9U1oEQWk\ns4gYdWK5956ObRVP7OScAUMmjNziXfgQvIn/B4nzlq581nOGiTSPQqCFE3VS\nyMDiLt4P10DUcLNNW7UNusDdRLlV9j9g1xOsTwDCEewOFxhwxrndZsqXiz5w\nN8/UwZkU7yEG1kOm3H/9p9GDdK7cEMxAwCEerbU+y/xzBkbgPBsJr4Lcl+A4\nfi0LIpKaiabvE+vVgEq0ZrSILIwHphEF+ToHT5d7UvaUKQo9flJZ7uEFAPko\nwUHEBG/EiRI4YWfPg0kxnZMm3WkvxKlSbjptx4YSqHCSFw3igXpW7nVVSGPE\nb89C\r\n=koXU\r\n-----END PGP SIGNATURE-----\r\n"},"engines":{"node":">=10"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"c5c93bfb2c68deb04790f33deb1864392ab24be2","scripts":{"test":"xo && ava && tsd"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/array-shuffle.git","type":"git"},"_npmVersion":"6.14.9","description":"Randomize the order of items in an array","directories":{},"_nodeVersion":"10.22.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.35.0","ava":"^3.13.0","tsd":"^0.13.1"},"_npmOperationalInternal":{"tmp":"tmp/array-shuffle_2.0.0_1606971767556_0.5324534133108823","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"array-shuffle","version":"3.0.0","keywords":["array","list","shuffle","sort","random","rand","fisher","yates","durstenfeld"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"array-shuffle@3.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/array-shuffle#readme","bugs":{"url":"https://github.com/sindresorhus/array-shuffle/issues"},"dist":{"shasum":"9a927cc2ca4c8ef4d71cddef7c9ee7b3b733d54b","tarball":"https://registry.npmjs.org/array-shuffle/-/array-shuffle-3.0.0.tgz","fileCount":5,"integrity":"sha512-rogEGxHOQPhslOhpg12LJkB+bbAl484/s2AJq0BxtzQDQfKl76fS2u9zWgg3p3b9ENcuvE7K8A7l5ddiPjCRnw==","signatures":[{"sig":"MEUCIFiJSmpjaPjeF2IT00HaYU7IYFTQkB+mJlN72P+nOVOeAiEAkuwW/PQtZpm6aqNOl1r0liwX4VF5nDmw3NHf4/Ud3E8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3098,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/qJ7CRA9TVsSAnZWagAAbdQP/0Mkm3k3BUKs7ybnPzFZ\nk4zcNrjGFaUZ0bOPjFhpcSH3ijFMHoOvOENgRvra4260IvsodQWdvFdXGYq5\nyManpUWdUD/FHBV6jRCW0WgISv1IXpy6YYBP5dQd4AECYh/kw75eJYEEzuy1\naDcZZgtZ6fImtSqauKYEULpaP/0szRURMxw5hQODXC3hlhxVBDloq8jyZeDs\nXzfF1N/aBV7yxopmLRwV2sVMb1KlDlwJy2ETcUoiNkED8Aq3RdXR8b2TOXjO\nErakGI16C8noFOcb2420jqlFy5uXIwk6hvniRPOEvX+qHiqQeS99KyeKD9gY\nsuEl/y5ewUgOwmK7f+r15DqN/0tMFwC0+lgxQakMINtLiEaC9i0XPHjzh/FM\nAYpcGQzQ0q7NsGOWFJzf8ZKGSAAUZ7Q3HelFdrchSpijMgpnwGxyiBUFnFX0\nZDJANfXCCrYqunxqG/AnfJgNThtAzwgEsjFHIIPXLupXa4a154YOoMj6ovBF\nB4I6N2mE1XBV3DYBzWRlyq6uzYc+9HCrSpLIN/6f/8qDbFhAHlJcg+QrGa0t\ninl/P9ag1VmpuBWZqmP1azEMJ9URwpb3PEO9718PJZuRPQUE7UB0GMiZY0/F\nVOvTp7D3957+jtGNZRfyF0sbYqOVtiRMPDFZkk5+nxGgt0dpNwFL3Lhcy8ba\nD3fb\r\n=WIqB\r\n-----END PGP SIGNATURE-----\r\n"},"type":"module","engines":{"node":">=12.20"},"exports":"./index.js","funding":"https://github.com/sponsors/sindresorhus","gitHead":"9841c176ad383ed165d7fe32c41de45a946af35a","scripts":{"test":"xo && ava && tsd"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/array-shuffle.git","type":"git"},"_npmVersion":"7.10.0","description":"Randomize the order of items in an array","directories":{},"_nodeVersion":"12.22.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.42.0","ava":"^3.15.0","tsd":"^0.17.0"},"_npmOperationalInternal":{"tmp":"tmp/array-shuffle_3.0.0_1627300475369_0.9803009004663987","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"array-shuffle","version":"4.0.0","keywords":["array","list","shuffle","sort","random","rand","fisher","yates","durstenfeld"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"array-shuffle@4.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/array-shuffle#readme","bugs":{"url":"https://github.com/sindresorhus/array-shuffle/issues"},"dist":{"shasum":"50e2985cb34f8283da13645098ab7a1770cfaa89","tarball":"https://registry.npmjs.org/array-shuffle/-/array-shuffle-4.0.0.tgz","fileCount":5,"integrity":"sha512-C7U1jQYpMCCQcjhPNtngE3Fki2+wFTaPzc5K4jJPY9Wwce9aQp8BwAkgyMhG6WIQEaE1qnrtkT6XoYkatxXTSQ==","signatures":[{"sig":"MEUCIBMgGnMnSRVY6xv3DjFMm234Feu6beFJ/n6+3+NG+jp2AiEA6wtfvFFFERcsDopYlfbVnLeLSg6E836E8EhlE97IVZk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4529},"type":"module","types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"0b7a90367e53e0a427ffd43c923a2f06f7895f1e","scripts":{"test":"xo && ava"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/array-shuffle.git","type":"git"},"_npmVersion":"10.9.2","description":"Randomize the order of items in an array","directories":{},"sideEffects":false,"_nodeVersion":"20.19.5","_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.2","ava":"^6.4.1"},"_npmOperationalInternal":{"tmp":"tmp/array-shuffle_4.0.0_1758255218669_0.8911482476337291","host":"s3://npm-registry-packages-npm-production"}},"4.1.0":{"name":"array-shuffle","version":"4.1.0","description":"Randomize the order of items in an array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/array-shuffle.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava"},"keywords":["array","list","shuffle","sort","random","rand","fisher","yates","durstenfeld"],"devDependencies":{"ava":"^6.4.1","xo":"^1.2.2"},"gitHead":"7a3bd16755529d8b2caebe357a74d71a7e5f022c","types":"./index.d.ts","_id":"array-shuffle@4.1.0","bugs":{"url":"https://github.com/sindresorhus/array-shuffle/issues"},"homepage":"https://github.com/sindresorhus/array-shuffle#readme","_nodeVersion":"25.3.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-VeSwSNI0y9NojZ/seTJujlyO2xQCwdfn5ujU2ji+VaHos2z4u88aqy6nCVIJhmaMTOQvqNyIWwOJ/pSlYjPhTQ==","shasum":"32a967bc99186c3df40c36efdeb2b4dd504d89fa","tarball":"https://registry.npmjs.org/array-shuffle/-/array-shuffle-4.1.0.tgz","fileCount":5,"unpackedSize":6730,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE6RrAuAy4/vMUp2/y/BUHIgDe5JWv0jDMFoyAUUN4I/AiAv4lyalx8mBZIK74Sm25jO0MoMCGMQ2C7VkjDINdggCg=="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/array-shuffle_4.1.0_1770061102744_0.1322758605929597"},"_hasShrinkwrap":false}},"time":{"created":"2014-05-23T23:05:52.066Z","modified":"2026-02-02T19:38:23.015Z","0.1.0":"2014-05-23T23:05:52.066Z","1.0.0":"2014-08-13T16:36:47.276Z","1.0.1":"2016-06-16T12:13:24.183Z","2.0.0":"2020-12-03T05:02:47.709Z","3.0.0":"2021-07-26T11:54:35.486Z","4.0.0":"2025-09-19T04:13:38.856Z","4.1.0":"2026-02-02T19:38:22.899Z"},"bugs":{"url":"https://github.com/sindresorhus/array-shuffle/issues"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","homepage":"https://github.com/sindresorhus/array-shuffle#readme","keywords":["array","list","shuffle","sort","random","rand","fisher","yates","durstenfeld"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/array-shuffle.git"},"description":"Randomize the order of items in an array","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"readme":"# array-shuffle\n\n> Randomize the order of items in an array\n\nUses the [Durstenfeld algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm) which is based on the [Fisher–Yates algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle).\n\n## Install\n\n```sh\nnpm install array-shuffle\n```\n\n## Usage\n\n```js\nimport {arrayToShuffled, arrayShuffle} from 'array-shuffle';\n\n// Create a new shuffled array\nconst shuffled = arrayToShuffled([1, 2, 3, 4, 5, 6]);\n//=> [3, 5, 4, 1, 2, 6]\n\n// Shuffle in-place\nconst array = [1, 2, 3, 4, 5, 6];\narrayShuffle(array);\nconsole.log(array);\n//=> [3, 5, 4, 1, 2, 6]\n```\n\n## API\n\n### arrayToShuffled(array, options?)\n\nCreate a new array with the items randomized (does not mutate the original array).\n\nReturns a new array with the items randomized.\n\n#### array\n\nType: `Array`\n\nThe array to shuffle.\n\n#### options\n\nType: `object`\n\n##### randomNumberGenerator\n\nType: `() => number`\n\nCustom random number generator that returns a float between 0 (inclusive) and 1 (exclusive). This is useful for deterministic shuffling when you use a seeded generator.\n\n```js\nimport {arrayToShuffled} from 'array-shuffle';\n\nconst randomNumberGenerator = () => 0;\nconst deterministic = arrayToShuffled([1, 2, 3, 4, 5, 6], {randomNumberGenerator});\n//=> [2, 3, 4, 5, 6, 1]\n```\n\n### arrayShuffle(array, options?)\n\nRandomize the order of items in an array, mutating the array in-place.\n\nReturns the input array shuffled.\n\n#### array\n\nType: `Array`\n\nThe array to shuffle.\n\n#### options\n\nType: `object`\n\n##### randomNumberGenerator\n\nType: `() => number`\n\nCustom random number generator that returns a float between 0 (inclusive) and 1 (exclusive). This is useful for deterministic shuffling when you use a seeded generator.\n","readmeFilename":"readme.md","users":{"akiva":true,"gaboo":true,"flumpus-dev":true,"jamescostian":true}}