|
| 1 | +<h1 align="center">🗃<br/>@compactjs/shuffle</h1> |
| 2 | +<h3 align="center">Shuffle arrays</h3> |
| 3 | +<p align="center"> |
| 4 | + <a href="https://www.npmjs.com/package/@compactjs/shuffle" target="_blank"> |
| 5 | + <img alt="Version" src="https://img.shields.io/npm/v/@compactjs/shuffle.svg"> |
| 6 | + </a> |
| 7 | + <a href="https://github.com/CompactJS/shuffle/blob/master/LICENSE" target="_blank"> |
| 8 | + <img alt="License: MIT" src="https://img.shields.io/github/license/compactjs/shuffle" /> |
| 9 | + </a> |
| 10 | +</p> |
| 11 | +<p align="center"> |
| 12 | + · |
| 13 | + <a href="https://github.com/CompactJS/shuffle#readme">Homepage</a> |
| 14 | + · |
| 15 | + <a href="https://github.com/CompactJS/shuffle/issues">Report Bug / Request Feature</a> |
| 16 | + · |
| 17 | +</p> |
| 18 | + |
| 19 | +## Table of Contents |
| 20 | + |
| 21 | +- [Installation](#Install) |
| 22 | +- [Usage](#usage) |
| 23 | +- [Test](#run-tests) |
| 24 | +- [Contact](#contact) |
| 25 | +- [Contributing](#Contributing) |
| 26 | +- [License](#license) |
| 27 | + |
| 28 | +## Install |
| 29 | + |
| 30 | +### NPM: |
| 31 | + |
| 32 | +```sh |
| 33 | +npm install @compactjs/shuffle |
| 34 | +``` |
| 35 | + |
| 36 | +## Usage |
| 37 | + |
| 38 | +```typescript |
| 39 | +/** |
| 40 | + * returns a shuffled array |
| 41 | + */ |
| 42 | +function shuffle(array: any[]): any[]; |
| 43 | +``` |
| 44 | + |
| 45 | +### As module: |
| 46 | + |
| 47 | +```javascript |
| 48 | +import { shuffle } from '@compactjs/shuffle'; |
| 49 | +``` |
| 50 | + |
| 51 | +### Example: |
| 52 | + |
| 53 | +```javascript |
| 54 | +const array = [0, 1, 2, 3]; |
| 55 | +const shuffled = shuffle(array); |
| 56 | + |
| 57 | +console.log(array); // => [0, 1, 2, 3] |
| 58 | +console.log(shuffled); // => e.g. [3, 1, 2, 0] |
| 59 | +``` |
| 60 | + |
| 61 | +## Run tests |
| 62 | + |
| 63 | +```sh |
| 64 | +npm run test |
| 65 | +``` |
| 66 | + |
| 67 | +## Contact |
| 68 | + |
| 69 | +👤 **Timo Bechtel** |
| 70 | + |
| 71 | +- Website: https://timobechtel.com |
| 72 | +- Twitter: [@TimoBechtel](https://twitter.com/TimoBechtel) |
| 73 | +- GitHub: [@TimoBechtel](https://github.com/TimoBechtel) |
| 74 | + |
| 75 | +## 🤝 Contributing |
| 76 | + |
| 77 | +Contributions, issues and feature requests are welcome!<br /> |
| 78 | + |
| 79 | +1. Check [issues](https://github.com/CompactJS/shuffle/issues) |
| 80 | +1. Fork the Project |
| 81 | +1. Create your Feature Branch (`git checkout -b feat/AmazingFeature`) |
| 82 | +1. Test your changes `npm run test` |
| 83 | +1. Commit your Changes (`git commit -m 'feat: add amazingFeature'`) |
| 84 | +1. Push to the Branch (`git push origin feat/AmazingFeature`) |
| 85 | +1. Open a Pull Request |
| 86 | + |
| 87 | +### Commit messages |
| 88 | + |
| 89 | +This project uses semantic-release for automated release versions. So commits in this project follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) guidelines. I recommend using [commitizen](https://github.com/commitizen/cz-cli) for automated commit messages. |
| 90 | + |
| 91 | +## Show your support |
| 92 | + |
| 93 | +Give a ⭐️ if this project helped you! |
| 94 | + |
| 95 | +## 📝 License |
| 96 | + |
| 97 | +Distributed under the [MIT](https://github.com/CompactJS/shuffle/blob/master/LICENSE) License. |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_ |
0 commit comments