0.1.4 • Published 24 days ago

fixture-creator v0.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
24 days ago

Fixture Creator

Node.js CI Publish Package to npmjs

Round-robin tournament based sports fixture creator

Install

npm i fixture-creator

Usage

import { FixtureCreator } from "fixture-creator";

const teams:string[] = ['Barcelona', 'Bayern Munich', 'Galatasaray'];
const fixtureCreator = new FixtureCreator();

console.log(fixtureCreator.createLeagueFixture(teams));

teams should be a array of team names as a string teams must have at least 2 team if teams length is odd, the team that will not play that week is shown to face 'BYE-THIS-WEEK'. If you prefer dash(-) instead of this text, you have to write false after team string

console.log(fixtureCreator.createLeagueFixture(teams, false));

fixtureCreator.createLeagueFixture(teams) returns fixture object. fixture object contains game weeks array.

{
   "weeks":[
      {
         "title":"1. Match Week",
         "matches":[
            {
               "home":"Galatasaray",
               "away":"Barcelona"
            },
            {
               "home":"Bayern Munich",
               "away":"BYE-THIS-WEEK"
            }
         ]
      },
      {
         "title":"2. Match Week",
         "matches":[
            {
               "home":"Galatasaray",
               "away":"BYE-THIS-WEEK"
            },
            {
               "home":"Barcelona",
               "away":"Bayern Munich"
            }
         ]
      },
      {
          ...
          ...
      }
   ]
}

Notes

I developed this package to use in FIFA(FC) tournaments that we play with our friends. We play our FIFA tournament like a classic league so it creates(by default) a fixture that includes the return matches. demo

0.1.4

24 days ago

0.1.3

25 days ago

0.1.2

1 month ago

0.1.0

3 years ago

0.1.1

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago