# knuth-shuffle-seeded

> The Fisher-Yates (aka Knuth) shuffle for Node.js, with seeding support

Latest version **1.0.6** (published 2015-01-31) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install knuth-shuffle-seeded
pnpm add knuth-shuffle-seeded
yarn add knuth-shuffle-seeded
bun add knuth-shuffle-seeded
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2015-01-31 |
| First published | 2015-01-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | separate (@types/knuth-shuffle-seeded) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | AJ O'Neal |
| Maintainers | timothygu |
| Keywords | ronald, fisher, frank, yates, fisher-yates, donald, knuth, shuffle, random, randomize, unbiased, algorithm |

## Links

- npm: https://www.npmjs.com/package/knuth-shuffle-seeded
- Repository: https://github.com/TimothyGu/knuth-shuffle-seeded
- Issues: https://github.com/TimothyGu/knuth-shuffle-seeded/issues
- npm.io page: https://npm.io/package/knuth-shuffle-seeded

## Dependencies (1)

- [seed-random](https://npm.io/package/seed-random.md) ~2.2.0

## Recent versions

- 1.0.6 (latest) — 2015-01-31
- 1.0.5 — 2015-01-23
- 1.0.4 — 2015-01-23
- 1.0.3 — 2015-01-23
- 1.0.2 — 2015-01-20
- 1.0.1 — 2015-01-20
- 1.0.0 — 2015-01-20
- 0.0.0 — 2015-01-19

## README

# knuth-shuffle-seeded

[![npm](https://img.shields.io/npm/v/knuth-shuffle-seeded.svg?style=flat)](https://www.npmjs.com/package/knuth-shuffle-seeded)
[![Build Status](https://img.shields.io/travis/TimothyGu/knuth-shuffle-seeded/gh-pages.svg?style=flat)](https://travis-ci.org/TimothyGu/knuth-shuffle-seeded)
[![Dependencies](https://img.shields.io/david/TimothyGu/knuth-shuffle-seeded.svg?style=flat)](https://david-dm.org/TimothyGu/knuth-shuffle-seeded#info=dependencies)
[![devDependencies](https://img.shields.io/david/dev/TimothyGu/knuth-shuffle-seeded.svg?style=flat)](https://david-dm.org/TimothyGu/knuth-shuffle-seeded#info=devDependencies)
[![Code Coverage](https://img.shields.io/codecov/c/github/TimothyGu/knuth-shuffle-seeded.svg?style=flat)](https://codecov.io/github/TimothyGu/knuth-shuffle-seeded?branch=gh-pages)

The Fisher-Yates (aka Knuth) shuffle for the browser and Node.js, with seeds
support using [seed-random](https://www.npmjs.com/package/seed-random).

This project is initially forked from
[coolaj86/knuth-shuffle](https://github.com/coolaj86/knuth-shuffle), but is
extended so that it is possible to specify a seed to use in the shuffling, to
ensure test reproducability.

Online demo: https://timothygu.github.io/knuth-shuffle-seeded/

## Getting Started

### Node.js

Installing:

```sh
npm install knuth-shuffle-seeded
```

### The Browser

Put browser.js into your directory for JavaScripts. Then take a look at
index.html.

You can also visit the page at
https://timothygu.github.io/knuth-shuffle-seeded/.

### API

```js
shuffle(inputArray[, seed])
```

See example.js for more examples.

## Why not contribute to the original repo?

I have considered that, but the introduction of an npm dependency makes it
necessary to use Browserify to generate a browser-compatible JavaScript file,
which is too far away from the simple approach of knuth-shuffle.

## Authors

- AJ O'Neal (@coolaj86) -- initial author
- Timothy Gu (@TimothyGu) -- seeding support

## License

Copyright 2013 AJ O'Neal

Copyright 2015 Tiancheng "Timothy" Gu

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this project except in compliance with the License. You may obtain a copy
of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

---
_Source: https://npm.io/package/knuth-shuffle-seeded · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
