{"id":18928145,"url":"https://github.com/hearthsim/hearthstone-deckstrings","last_synced_at":"2025-04-15T14:31:12.881Z","repository":{"id":54106055,"uuid":"92292708","full_name":"HearthSim/hearthstone-deckstrings","owner":"HearthSim","description":"🔗 Decode and encode Hearthstone Deckstrings.","archived":false,"fork":false,"pushed_at":"2024-04-02T11:41:30.000Z","size":128,"stargazers_count":55,"open_issues_count":2,"forks_count":11,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-11T15:36:13.721Z","etag":null,"topics":["deckstrings","hearthstone"],"latest_commit_sha":null,"homepage":"https://hearthsim.info/docs/deckstrings/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HearthSim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2017-05-24T13:00:52.000Z","updated_at":"2025-02-18T15:29:34.000Z","dependencies_parsed_at":"2024-04-02T12:46:29.118Z","dependency_job_id":"4451ee70-d382-467b-8148-253d35966814","html_url":"https://github.com/HearthSim/hearthstone-deckstrings","commit_stats":null,"previous_names":["hearthsim/npm-deckstrings"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HearthSim%2Fhearthstone-deckstrings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HearthSim%2Fhearthstone-deckstrings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HearthSim%2Fhearthstone-deckstrings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HearthSim%2Fhearthstone-deckstrings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HearthSim","download_url":"https://codeload.github.com/HearthSim/hearthstone-deckstrings/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249088720,"owners_count":21210853,"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":["deckstrings","hearthstone"],"created_at":"2024-11-08T11:23:09.290Z","updated_at":"2025-04-15T14:31:12.557Z","avatar_url":"https://github.com/HearthSim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `deckstrings` for Hearthstone\n[![npm](https://img.shields.io/npm/v/deckstrings.svg)](http://npmjs.com/package/deckstrings)\n\nDecode and encode Hearthstone [deckstrings](https://hearthsim.info/docs/deckstrings/).\n\nA mapping between DBF ids and cards can be found at [HearthstoneJSON](https://hearthstonejson.com/).\n\nAny deckstring or deck definition returned by this library will be \"canonical\": The cards and heroes are sorted by DBF id in ascending order.\n\n## Install\n\nInstall the package from npm using your favourite package manager:\n\n```\n$ yarn add deckstrings\n```\n\n## Usage\n\n```javascript\nimport { encode, decode, FormatType } from \"deckstrings\";\n\nconst deck = {\n\tcards: [[1, 2], [2, 2], [3, 2], [4, 1]], // [dbfId, count] pairs\n\tsideboardCards: [[5, 1, 90749]], // [dbfId, count, sideboardOwnerDbfId] triplets\n\theroes: [7], // Garrosh Hellscream\n\tformat: FormatType.FT_WILD, // or FT_STANDARD or FT_CLASSIC\n};\n\nconst deckstring = encode(deck);\nconsole.log(deckstring); // AAEBAQcBBAMBAgMAAQEF/cQFAAA=\n\nconst decoded = decode(deckstring);\nconsole.log(JSON.stringify(deck) === JSON.stringify(decoded)); // true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhearthsim%2Fhearthstone-deckstrings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhearthsim%2Fhearthstone-deckstrings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhearthsim%2Fhearthstone-deckstrings/lists"}