{"id":15641352,"url":"https://github.com/andrewda/hltv-livescore","last_synced_at":"2025-06-25T19:03:01.245Z","repository":{"id":57147590,"uuid":"45481601","full_name":"andrewda/hltv-livescore","owner":"andrewda","description":" A Node.js wrapper for the HLTV scorebot","archived":false,"fork":false,"pushed_at":"2021-10-19T22:04:13.000Z","size":118,"stargazers_count":71,"open_issues_count":11,"forks_count":8,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-17T13:19:59.320Z","etag":null,"topics":["csgo","hacktoberfest","hltv","scoreboard"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-03T17:00:02.000Z","updated_at":"2024-06-28T02:18:39.000Z","dependencies_parsed_at":"2022-09-06T15:02:15.057Z","dependency_job_id":null,"html_url":"https://github.com/andrewda/hltv-livescore","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/andrewda/hltv-livescore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewda%2Fhltv-livescore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewda%2Fhltv-livescore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewda%2Fhltv-livescore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewda%2Fhltv-livescore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewda","download_url":"https://codeload.github.com/andrewda/hltv-livescore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewda%2Fhltv-livescore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260495851,"owners_count":23017974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csgo","hacktoberfest","hltv","scoreboard"],"created_at":"2024-10-03T11:42:18.156Z","updated_at":"2025-06-25T19:03:01.224Z","avatar_url":"https://github.com/andrewda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Due to a lack of resources, this project has been mostly abandoned. Please see [gigobyte/HLTV](https://github.com/gigobyte/HLTV) for a popular and more up-to-date HLTV API. If anyone would like to take over maintenance for this project, please contact [me](https://github.com/andrewda).\n\n--- \n\n# HLTV Livescore\n\nA simple Node.js library to interface with HLTV's live scorebot.\n\n[![NPM Version][npm-img]][npm-url]\n[![Downloads][downloads-img]][npm-url]\n[![Build][travis-img]][travis-url]\n[![Codacy][codacy-img]][codacy-url]\n[![Steam Donate][steam-donate-img]][steam-donate-url]\n\n## Contents\n\n- [Introduction](#introduction)\n- [Getting Started](#getting-started)\n- [Methods](#methods)\n- [Events](#events)\n- [Classes](#classes)\n- [Enums](#enums)\n- [Examples](#examples)\n\n## Introduction\n\nThis module is based on [@Nols1000](https://github.com/Nols1000)'s [original version](https://github.com/Nols1000/hltv-scorebot), created back in May of 2015. It is packed full of features, but was never updated to the newest version of HLTV's scorebot. The purpose of this version is to be more of a wrapper for HLTV, and to incorporate all of the features available with the new scorebot.\n\n## Getting Started\n\n**Install with npm:**\n```bash\n$ npm install hltv-livescore\n```\n\n**Usage:**\n```javascript\nvar Livescore = require('hltv-livescore');\nvar live = new Livescore({\n    listid: 2299033\n});\n\nlive.on('kill', function(data) {\n    console.log(data.killer.name, 'killed', data.victim.name, 'with', data.weapon, data.headshot ? '(headshot)' : '');\n});\n```\n\n## Methods\n\n### Constructor([options])\n- `options` - An optional object containing some of the following options\n    - `listid` - The game's listid\n    - `url` - The URL to listen on. Defaults to `http://scorebot2.hltv.org`\n    - `port` - The port to listen on. Defaults to `10022`\n\nConstructs a new `Livescore`. You will be automatically connected to the HLTV scorebot server. The game with the specified `listid` will be automatically started if provided. If not provided, you must specify them using them using the `start()` method.\n\n### start([options][, callback])\n- `options` - An optional object containing some of the following options\n    - `listid` - The game's listid\n- `callback` - An optional callback.\n\nStart the game with the specified `listid`. If provided in the Constructor, the `listid` is not required. An error will be thrown if you are not connected to the HLTV scorebot server before calling this method.\n\n### getPlayers(callback)\n- `callback` - Required. Called with an object of players\n    - `players` - An object containing all the players connected to the server, with their name as the key\n\nRetrieve all players connected to the server.\n\n### getTeams(callback)\n- `callback` - Required. Called with an object of players\n    - `teams` - An object containing both teams connected to the server\n\nRetrieve both teams connected to the server.\n\n### setTime(time)\n- `time` - Required. The time to set the scoreboard to (in seconds)\n\nSet the scoreboard to a new time.\n\n### getTime(callback)\n- `callback` - Required. Called with the remaining time\n    - `time` - The time remaining in seconds as displayed on the scoreboard\n\nRetrieve the time remaining.\n\n## Events\n\nEvents emit an object containing the parameters listed under each event.\n\n### connected\n\nEmitted when we successfully connect to the HLTV Socket.io server.\n\n### started\n\nEmitted immediately before the first `scoreboard` event is emitted.\n\n### log\n- `log` - The log given to us by HLTV since the last log was emitted\n\nEmitted whenever HLTV feels like giving us logs (after kills, round events, etc).\n\n### time\n- `seconds` - The time displayed on the timer in seconds\n\nEmitted every time the timer on the scoreboard is updated.\n\n### scoreboard\n- `teams` - An object containing the two teams' objects\n- `map` - The current map\n- `bombPlanted` - `true` if the bomb is planted\n- `currentRound` - The current round number\n\nEmitted whenever HLTV sends us a scoreboard update. The scoreboard may not be any different from the last update.\n\n### kill\n- `killer` - The player object of the killer\n- `victim` - The player object of the victim\n- `weapon` - The weapon used\n- `headshot` - `true` if the kill was a headshot\n\nEmitted after every kill.\n\n### suicide\n- `player` - The player object of the suicider\n\nEmitted after a player commits suicide.\n\n### bombPlanted\n- `player` - The player object of the bomb planter\n\nEmitted when the bomb is planted.\n\n### bombDefused\n- `player` - The player object of the bomb defuser\n\nEmitted when the bomb is defused.\n\n### roundStart\n- `round` - The round number.\n\nEmitted at the start of every round.\n\n### roundEnd\n- `teams` - The list of teams\n- `winner` - The team that won\n- `winType` - How the team won\n- `knifeRound` - If we think the round was a knife round (\u003e=5 knife kills)\n\nEmitted at the end of every round.\n\n### playerJoin\n- `playerName` - The player's name\n\nEmitted when a player joins the server.\n\n### playerQuit\n- `player` - The player object of the player who quit\n\nEmitted when a player leaves the server.\n\n### mapChange\n- `map` - The new map\n\nEmitted when the map is changed.\n\n### restart\n\nEmitted when the score is restarted\n\n## Classes\n\n### Player\n- `steamid` - A [SteamID](https://github.com/DoctorMcKay/node-steamid) object\n- `hltvid` - The player's HLTV id\n- `name` - The player's username\n- `alive` - `true` if the player is alive\n- `money` - The player's in-game money\n- `rating` - The player's HLTV rating for this game\n- `kills` - The player's total kills\n- `assists` - The player's total assists\n- `deaths` - The player's total deaths\n- `team` - The player's [Team](#team) class\n\nExample:\n\n```\nPlayer {\n    steamid: [Object],\n    hltvid: 11654,\n    name: 'almazer1',\n    alive: true,\n    money: 12300,\n    rating: 1.16,\n    kills: 19,\n    assists: 4,\n    deaths: 17,\n    team: [Object]\n}\n```\n\n### Team\n- `id` - The team's HLTV id\n- `name` - The team's name\n- `score` - The team's score\n- `side` - The team's side (ESide)\n- `players` - An array of the team's [Player](#player) classes\n- `history` - The team's round history\n\nExample:\n\n```\nTeam {\n    id: 6921,\n    name: 'Vesuvius',\n    score: 16,\n    side: 1,\n    players: [Array],\n    history: [Object]\n}\n```\n\n### Round\n- `type` - How the round ended for this team (ERoundType)\n- `round` - The round number\n\nExample:\n\n```\nRound {\n    type: 6\n    round: 12\n}\n```\n\n## Enums\n\nThere are numerous enums available for your use. All enums are located in the `/resources/` directory.\n\n### EOption\n\nPrimarily for internal use. Specifies options about the module.\n\n### ERoundType\n\nSpecifies how a team ended the round.\n\n### ESide\n\nSpecifies team constants.\n\n## Examples\n\n- [CSGOScoreBot (Reddit Live Threads)](https://github.com/andrewda/CSGOScoreBot)\n\n\u003c!-- Badge URLs --\u003e\n\n[codacy-img]:       https://img.shields.io/codacy/grade/2af21149af4445768438cb611c76f310.svg?style=flat-square\n[codacy-url]:       https://www.codacy.com/app/dassonville-andrew/hltv-livescore\n[downloads-img]:    https://img.shields.io/npm/dm/hltv-livescore.svg?style=flat-square\n[downloads-url]:    https://www.npmjs.com/package/hltv-livescore\n[npm-img]:          https://img.shields.io/npm/v/hltv-livescore.svg?style=flat-square\n[npm-url]:          https://www.npmjs.com/package/hltv-livescore\n[travis-img]:       https://img.shields.io/travis/andrewda/hltv-livescore.svg?style=flat-square\n[travis-url]:       https://travis-ci.org/andrewda/hltv-livescore\n[steam-donate-img]: https://img.shields.io/badge/donate-Steam-lightgrey.svg?style=flat-square\n[steam-donate-url]: https://steamcommunity.com/tradeoffer/new/?partner=132224795\u0026token=HuEE9Mk1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewda%2Fhltv-livescore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewda%2Fhltv-livescore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewda%2Fhltv-livescore/lists"}