UNPKG

@marekbarela/scoreboard

Version:

A minimal TypeScript scoreboard library for managing live football match data.

48 lines (34 loc) โ€ข 898 B
# 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