{"id":25793771,"url":"https://github.com/zeusjunior/node-tf2-backpack","last_synced_at":"2026-02-28T18:35:34.036Z","repository":{"id":63592607,"uuid":"566543200","full_name":"ZeusJunior/node-tf2-backpack","owner":"ZeusJunior","description":"Parses the backpack from node-tf2","archived":false,"fork":false,"pushed_at":"2024-08-30T07:56:22.000Z","size":153,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T10:37:43.698Z","etag":null,"topics":["javascript","node-tf2","steam","tf2"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ZeusJunior.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-15T22:27:18.000Z","updated_at":"2024-11-12T00:42:28.000Z","dependencies_parsed_at":"2024-04-11T07:46:25.430Z","dependency_job_id":"ecb66daa-73a6-4801-84ee-76a8272b3be8","html_url":"https://github.com/ZeusJunior/node-tf2-backpack","commit_stats":{"total_commits":77,"total_committers":3,"mean_commits":"25.666666666666668","dds":0.4285714285714286,"last_synced_commit":"7ce6fd0fc2ec648cee239c276742af2d3ab3fe5c"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeusJunior%2Fnode-tf2-backpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeusJunior%2Fnode-tf2-backpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeusJunior%2Fnode-tf2-backpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeusJunior%2Fnode-tf2-backpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZeusJunior","download_url":"https://codeload.github.com/ZeusJunior/node-tf2-backpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241019198,"owners_count":19895212,"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":["javascript","node-tf2","steam","tf2"],"created_at":"2025-02-27T13:38:58.161Z","updated_at":"2026-02-28T18:35:33.966Z","avatar_url":"https://github.com/ZeusJunior.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-tf2-backpack\nTyped module to parse inventory items from [node-tf2](https://github.com/DoctorMcKay/node-tf2)\nUsing this you no longer have to retrieve your own (bots) backpack from the steam API, which has been having issues with increasing ratelimits.  \n\n# Installation\n```\nnpm install tf2-backpack\n```\n\n```ts\nimport { BackpackParser } from 'tf2-backpack';\nconst parser = new BackpackParser(itemsGame);\n// or\nconst tf2backpack = require('tf2-backpack');\nconst parser = new tf2backpack.BackpackParser(itemsGame);\n```\n\n# Docs\n### Constructor(itemsGame)\n- `itemsGame` - `itemSchema` property from node-tf2. See [the docs](https://github.com/DoctorMcKay/node-tf2#itemschema).  \n\nConstructs a new BackpackParser.  \nIt is recommended that you ***save*** the itemSchema. It is not emitted on every connection, as it is cached.  \n\nAlternatively, you can also use any vdf parser module and use `items_game` from `items_game.txt` (you can find this [here](https://raw.githubusercontent.com/SteamDatabase/GameTracking-TF2/master/tf/scripts/items/items_game.txt) or the [schema](https://wiki.teamfortress.com/wiki/WebAPI/GetSchema) as items_game_url) as input.  \nOr [items-game.json](https://raw.githubusercontent.com/danocmx/node-tf2-static-schema/master/static/items-game.json) from [node-tf2-static-schema](https://github.com/danocmx/node-tf2-static-schema)  \nThey're the same  \n\n### parseBackpack\n```ts\nparseBackpack(backpack: NodeTF2Backpack, mapToString = false): Item\u003cstring | number\u003e[] {}\n```\n- `backpack` - `backpack` property from node-tf2. See [the docs](https://github.com/DoctorMcKay/node-tf2#backpack).\n- `mapToString` - set to true to return spells, parts, sheen, killstreaker, killstreakTier and wear as names instead of IDs\n- Returns `Item\u003cstring | number\u003e[]`\n\n### parseItem\n```ts\nparseItem(item: BackpackEntry, mapToString = false): Item\u003cstring | number\u003e {}\n```\n- `item` - `item` from node-tf2's `itemAcquired`/`itemChanged`/`itemRemoved` events. See [the docs](https://github.com/DoctorMcKay/node-tf2#itemacquired).\n- `mapToString` - set to true to return spells, parts, sheen, killstreaker, killstreakTier and wear as names instead of IDs\n- Returns `Item\u003cstring | number\u003e`  \n\nExactly the same as parseBackpack but for a single item for convenience\n\n## Other \n\nSince there are no standardized skus for some properties, this module also provides the following exports:\n- spellNames - spell defindex to name\n- sheens\n- killstreakers\n- parts - strange parts\n\n### mapHexToPaintName\n```ts\nmapHexToPaintName(primaryColor?: string, secondaryColor?: string): string {}\n```\n\n- `primaryColor` - Primary color of the paint can, the `paint` property from parseBackpack output\n- `secondaryColor` - Secondary color of the paint can, the `paint_other` property from parseBackpack output\n\n- Returns `string` - Name of the paint\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeusjunior%2Fnode-tf2-backpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeusjunior%2Fnode-tf2-backpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeusjunior%2Fnode-tf2-backpack/lists"}