{"id":17306662,"url":"https://github.com/tcort/deckofcards","last_synced_at":"2026-02-04T08:31:19.646Z","repository":{"id":66155811,"uuid":"58896185","full_name":"tcort/deckofcards","owner":"tcort","description":"a standard deck of playing cards","archived":false,"fork":false,"pushed_at":"2023-04-17T05:44:11.000Z","size":67,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-17T12:33:59.495Z","etag":null,"topics":["cards","deck","deckofcards","playing-cards","shuffle"],"latest_commit_sha":null,"homepage":null,"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/tcort.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2016-05-16T02:03:32.000Z","updated_at":"2022-04-16T20:11:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9c185c7-c9ac-43e5-9e27-2c6e97fdb6a0","html_url":"https://github.com/tcort/deckofcards","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tcort/deckofcards","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcort%2Fdeckofcards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcort%2Fdeckofcards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcort%2Fdeckofcards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcort%2Fdeckofcards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcort","download_url":"https://codeload.github.com/tcort/deckofcards/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcort%2Fdeckofcards/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265617140,"owners_count":23798977,"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":["cards","deck","deckofcards","playing-cards","shuffle"],"created_at":"2024-10-15T11:59:01.907Z","updated_at":"2026-02-04T08:31:14.624Z","avatar_url":"https://github.com/tcort.png","language":"JavaScript","readme":"# deckofcards\n\nA simple implementation of a deck of playing cards.\n\n## API\n\n### Card\n\nCards are a combination of a rank (`2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`,\n`T` (Ten), `J` (Jack), `Q` (Queen), `K` (King), `A` (Ace)) and a suit\n(`S` (Spades), `C` (Clubs), `H` (Hearts), `D` (Diamonds)).\n\n#### constructor(rank, suit)\n\nAccepts a rank (e.g. `4`) and a suit (e.g. `C`). Will throw on invalid input.\n\n#### constructor(rankAndSuit)\n\nAccepts a rank and a suit string (e.g. `4C`). Will throw on invalid input.\n\n#### constructor(Card)\n\nCopy constructor. Accepts a Card. Will throw on invalid input.\n\n#### static parse(s)\n\nParses a card string (e.g. `4C`) and returns a new `Card`.\n\n#### static stringify(c)\n\nReturns a string representation of the card (e.g. `KH`).\n\n#### toString()\n\nReturns a string representation of the card (e.g. `KH`).\n\n#### valueOf()\n\nReturns a string representation of the card (e.g. `KH`).\n\n#### inspect()\n\nReturns a string representation of the card (e.g. `KH`).\n\n#### ranks[]\n\nAn array of valid ranks.\n\n#### suits[]\n\nAn array of valid suits.\n\n### Deck\n\nA Deck is just a set of 52 unique cards made by combining all legal suits and\nranks.\n\n#### constructor()\n\nInitializes a new shuffled deck of cards.\n\n#### shuffle()\n\nRandomizes the order of the cards.\n\n#### draw()\n\nReturns the next card from the deck.\n\n#### reset()\n\nPuts the dealt cards back in the deck and performs a shuffle.\n\n#### toString()\n\nReturns a string representation of the deck.\n\n## Testing\n\n    npm test\n\n## License\n\nSee [LICENSE.md](https://github.com/tcort/deckofcards/blob/master/LICENSE.md)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcort%2Fdeckofcards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcort%2Fdeckofcards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcort%2Fdeckofcards/lists"}