team-sorter
v0.1.0
Published
A project for randomly and evenly picking teams
Downloads
1
Readme
Small library for sorting people into teams
Example Usage
import { Lista, makeTeams } from 'team-sorter';
const people = new Lista(['Person 1', 'Person 2', 'Person 2']);
// Sort people into 2 teams
console.log(makeTeams(people, 2));
Documentation
The documentation can be found here
Additionaly, if you clone the repository, you can use the following implementations:
Node.js
In order to use the Node.js implementation, you need to build it first:
npm install # Install all the dependencies if you haven't already
npm run build # Will compile all the typescript into the dist directory
You should include a list of all the people you want to sort into teams in the people
file
Then you're ready to run the program:
npm start
Example output:
How many teams? 2
[ [ 'Ernesto Ittig', 'Triana Macedo' ], [ 'Francesca Modena' ] ]
Web
In order to use the web implementation, you need to build it first:
npm install # Install all the dependencies if you haven't already
npm run web:build # Will compile all the typescript into the public directory
Now, the bundle should be in the public directory. You should be able to host this however you want, but
if you want to test it, you can either open the index.html
with your browser, or run npm run web:start
to
start a test web server.