Skip to content

skorekm/buyer-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

buyer-picker

Essentially with the given Array it randomly matches people. It can be used during draw lots during the occasions such as christmas.

const arrayOfPeople = ['Mark', 'Sophia', 'Derek', 'Martha'];

Algorithm randomly matches people returning an object with the key of who was assigned and the value to whom.

{
  Mark: 'Sophia',
  Sophia: 'Derek',
  Derek: 'Martha',
  Martha: 'Mark'
}

After that it created a folder with the given directory name and produce .txt files with the name of the object key and puts the value inside. You know, because it's anonymous...

How to start

  1. Clone the repo
  2. In the index.js file change sample array to the names matching your requirements
  3. Change dir name if needed
  4. Run node index.js

Pretty much that's it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published