Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

equipator

jfresco13MIT0.0.2

Build the fairest team based on each player score

soccer, football, fulbo, futbol, team

readme

Equipator

How to use it

Run this in a terminal:

npm install --save equipator

Then in your Node app run:

const { getBestCombinations } = require('equipator')
const best = getBestCombinations(players)

The first item in the best array contains the teams for the fairest match.

Data

The players variable should be an array with the following structure:

const players = [
  { nick: 'alvaro', name: 'Álvaro Crespo', score: 3.5, gk: false },
  { nick: 'chalo', name: 'Gonzalo García', score: 4.0, gk: true },
  { nick: 'claudio', name: 'Claudio Graiño', score: 4.0, gk: false },
  ...
]

Contributing

Issues and PRs are welcomed!

Credits

This is a port of @alejandrodumas' equipator Ruby library.