1.1.1 • Published 2 years ago

secret-santa-draw v1.1.1

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm install secret-santa-draw

How to use

Example of shuffle():

import {shuffle} from "secret-santa-draw";

const array = ["Kevin", "Sara", "John", "Jane", "Bob"];

const shuffledIndices = shuffle(array.length - 1);
const shuffledArray: string[] = [];

for (let i = 0; i < array.length; i++) {
    const shuffledIndex = shuffledIndices[i];
    shuffledArray[i] = array[shuffledIndex];
}

Example of draw():

import {draw} from "secret-santa-draw";

const array = ["Kevin", "Sara", "John", "Jane", "Bob"];
const shuffledArray = draw(array);