https://github.com/mvicens/sporscor
TypeScript API to manage sport data getting scoreboards and statistics
https://github.com/mvicens/sporscor
api-client data score scoreboards sport statistics typescript
Last synced: 4 months ago
JSON representation
TypeScript API to manage sport data getting scoreboards and statistics
- Host: GitHub
- URL: https://github.com/mvicens/sporscor
- Owner: mvicens
- Created: 2025-04-30T17:33:37.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-06T22:27:32.000Z (5 months ago)
- Last Synced: 2026-02-07T08:45:35.296Z (5 months ago)
- Topics: api-client, data, score, scoreboards, sport, statistics, typescript
- Language: TypeScript
- Homepage:
- Size: 219 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SporScor
TypeScript API to manage sports data, including scoreboards and statistics.
Implemented matches (for now):
- Basketball
- Tennis (only players, not pairs)
- Volleyball
## Demo
[Here](https://mvicens.github.io/sporscor/) you have to try it out.
## Get started
```sh
npm install sporscor
```
This is a sample with tennis:
```ts
import { Player, TennisMatch } from 'sporscor';
const
playerOne = new Player('R. Federer'),
playerTwo = new Player('R. Nadal'),
// Obviously, you can use any HTML elements you want
scoreboard = document.getElementById('scoreboard'),
stats = document.getElementById('stats'),
match = new TennisMatch(playerOne, playerTwo, () => {
scoreboard!.innerHTML = match.getScoreboard();
stats!.innerHTML = match.getStats();
});
```
And then, proceed like e.g.:
```ts
match.start();
// match.play(); // It would failed (due to someone should be the opening server)
match.grantOpeningServeTo(playerTwo);
match.play();
match.logPointWonBy(playerOne);
match.logServeAsFault();
match.logPointWonBy(playerTwo);
match.logServeAsFault();
match.logServeAsFault();
match.logServeAsAce();
match.logPointWonBy(playerOne);
```
Now look at current content. What about it?
To speed it up, you can use the panel, obtained from `.getPanel()`.