Live Football World Cup Scoreboard library that shows all the ongoing matches and their scores.
git clone https://github.com/undg/los
cd los
pnpm i losimport los from "los";
const board = new los.board();
board.add("MEX-CAN", [{ name: "Mexico" }, { name: "Canada" }]); // Start a new match, assuming initial score 0 – 0 and adding it the scoreboard.
board.add("ESP-BRA", [
{ name: "Spain", score: 3 },
{ name: "Brazil", score: 2 },
]); // Start a new match, assuming initial score 3 – 2 and adding it to the scoreboard.
board.update("MEX-CAN", [1, 0]); // Update score as a pair of absolute scores: home team score and away
board.delete("MEX-CAN"); // Finish match currently in progress. This removes a match from the scoreboard.
board.get(); // Get a summary of matches in progress ordered by their total score. The matches with the same total score will be returned ordered by the most recently started match in the scoreboard.
board.render(); // same as get(), but return array of strings if format: "Uruguay 6 - Italy 6"
board.getTeamTotalScore("Mexica");undg 💻 🖋 📖 🤔 🚇 🚧 📆 🔧 |
💙 This package was templated with
create-typescript-app.