# fixture-creator

> Round-robin tournament based sports fixture creator

Latest version **0.1.4** (published 2024-10-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install fixture-creator
pnpm add fixture-creator
yarn add fixture-creator
bun add fixture-creator
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2024-10-24 |
| First published | 2022-02-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Cankat Abacı |
| Maintainers | cankatabaci |
| Keywords | fixture, sport fixture, football fixture, league schedule, fifa league fixture |

## Links

- npm: https://www.npmjs.com/package/fixture-creator
- Repository: https://github.com/cankatabaci/fixture-creator
- Issues: https://github.com/cankatabaci/fixture-creator/issues
- npm.io page: https://npm.io/package/fixture-creator

## Recent versions

- 0.1.4 (latest) — 2024-10-24
- 0.1.3 — 2024-10-23
- 0.1.2 — 2024-10-18
- 0.1.1 — 2022-02-26
- 0.1.0 — 2022-02-26
- 0.0.7 — 2022-02-10
- 0.0.6 — 2022-02-10
- 0.0.5 — 2022-02-10
- 0.0.4 — 2022-02-09
- 0.0.3 — 2022-02-09
- 0.0.2 — 2022-02-09
- 0.0.1 — 2022-02-09

## README

# Fixture Creator
[![Node.js CI](https://github.com/cankatabaci/fixture-creator/actions/workflows/node.js.yml/badge.svg)](https://github.com/cankatabaci/fixture-creator/actions/workflows/node.js.yml)
[![Publish Package to npmjs](https://github.com/cankatabaci/fixture-creator/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/cankatabaci/fixture-creator/actions/workflows/npm-publish.yml)

_Round-robin tournament based sports fixture creator_<br />
 
## **Install**
```
npm i fixture-creator
```
### **Usage**
```ts
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<br />
`teams` must have at least 2 team<br />
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<br />
```ts
console.log(fixtureCreator.createLeagueFixture(teams, false));
```
`fixtureCreator.createLeagueFixture(teams)` returns fixture object. fixture object contains game weeks array.<br />

```
{
   "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<br />
> FIFA(FC) tournaments that we play with our friends.<br />
> We play our FIFA tournament like a classic league<br />
> so it creates(by default) a fixture that includes the return matches.<br />
demo

---
_Source: https://npm.io/package/fixture-creator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
