@marekbarela/scoreboard
Version:
A minimal TypeScript scoreboard library for managing live football match data.
48 lines (34 loc) โข 898 B
Markdown
# Scoreboard Library
Simple TypeScript library for managing football matches in memory.
Built with TDD, tested with Jest, and ready to be reused or extended.
## ๐ Usage
```ts
const scoreboard = new Scoreboard();
scoreboard.startMatch("Poland", "Germany");
scoreboard.updateScore("Poland", "Germany", 2, 1);
scoreboard.finishMatch("Poland", "Germany");
const summary = scoreboard.getSummary();
console.log(summary);
```
## ๐งช Development
```bash
npm install
npm test
```
To run tests with coverage:
```bash
npm run test:coverage
```
## ๐ Structure
```
/src โ Scoreboard logic
/tests โ Unit tests
/utils โ Shared helpers (e.g., delay)
README.md
tsconfig.json
jest.config.js
```
## ๐ Notes
- Designed using test-driven development (TDD)
- Sorted summary logic: total score desc, then recency
- Commit history reflects incremental development