shufflefy

1.0.4 • Public • Published

Build Status Coverage Status license

shufflefy

A Node.js package to shuffle an array.

Usage

Install the package using npm:

npm install shufflefy

Require the package:

const shufflefy = require('shufflefy');

Feed it with an array:

const numberArr = [1, 2, 3, 4, 5, 6, 7];
console.log(shufflefy(numberArr));

Arguments list:

shufflefy(input_arr[, iteration[, starting_seed[, randomizer]]])
  • input_arr - input array

  • iteration - number of iterations over the output array

  • starting_seed - same starting_seed and iteration combination would always generate the same result

  • randomizer - a function that takes in a seed(optional) and returns a number between 0 (inclusive) and 1 (exclusive)

Test:

npm test

Examples:

node example.js

Benchmarking:

node benchmark.js

License

MIT

Package Sidebar

Install

npm i shufflefy

Weekly Downloads

5

Version

1.0.4

License

MIT

Unpacked Size

9.71 kB

Total Files

8

Last publish

Collaborators

  • elinfta