{"id":19240924,"url":"https://github.com/binocarlos/decked","last_synced_at":"2025-02-23T14:27:24.474Z","repository":{"id":17289827,"uuid":"20060119","full_name":"binocarlos/decked","owner":"binocarlos","description":"Generate a list of playing cards based on a configurable pack","archived":false,"fork":false,"pushed_at":"2014-08-20T14:45:19.000Z","size":164,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T06:53:08.089Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/binocarlos.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":"2014-05-22T12:28:21.000Z","updated_at":"2017-06-04T09:50:51.000Z","dependencies_parsed_at":"2022-09-26T21:22:00.801Z","dependency_job_id":null,"html_url":"https://github.com/binocarlos/decked","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fdecked","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fdecked/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fdecked/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binocarlos%2Fdecked/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binocarlos","download_url":"https://codeload.github.com/binocarlos/decked/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240254042,"owners_count":19772387,"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":[],"created_at":"2024-11-09T17:09:36.477Z","updated_at":"2025-02-23T14:27:24.427Z","avatar_url":"https://github.com/binocarlos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"decked\n======\n\n[![Travis](http://img.shields.io/travis/binocarlos/decked.svg?style=flat)](https://travis-ci.org/binocarlos/decked)\n\nGenerate a list of playing cards based on a configurable pack\n\n## installation\n\nnode:\n\n```\n$ npm install decked\n```\n\ncomponent:\n\n```\n$ component install binocarlos/decked\n```\n\n## usage\n\nEach card in a deck is represented by an object:\n\n```js\n{\n\tsuit:'diamond',\n\tnumber:11,\n\tname:'jack'\n}\n```\n\nThe number of a jack is 11, queen is 12, king is 13 and ace is 14 or 1 depending on the 'ace' config option (high or low)\n\nThe suit property is one of:\n\n * heart\n * diamond\n * club\n * spade\n * joker\n\nAn ordered array of cards is returned.\n\n```js\nvar decked = require('decked')\n\nvar deck = decked({\n\n\t// is ace 1 or 14\n\tace:'high',\n\n\t// will the deck have 2 jokers inside (card number 0)\n\tjokers:2\n\n})\n\nvar cards = deck()\n\nconsole.log(cards.length)\n\n// 54 (because we included the jokers)\n```\n\nYou can pass a filter into the cards function to create a deck with only certain cards in:\n\n```js\n\n// a filter that will remove diamonds\nvar noDiamonds = deck(function(card){\n\treturn card.suit != 'diamond'\n})\n\n// a filter that only returns face cards\nvar faceCards = deck(function(card){\n\treturn card.number \u003e= 11\n})\n```\n\n## api\n\n### `var deck = decked(config)`\n\ncreate a new deck of cards with the given config options:\n\n * ace ('low' | 'high') - sets the numeric value of the ace to 1 or 14\n * jokers (true | false) - should the deck contain 2 jokers or not\n\n### `var deck = decked.sequence(config)`\n\ncreate a sequence with each number having 4 cards (1 per suit)\n\nconfig is:\n\n * low - the start of the sequence (0)\n * high - the end of the sequence (10)\n\n### `var cards = deck(filter)`\n\nget an array of card objects with an optional filter (which can be an array of filters)\n\n## license\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinocarlos%2Fdecked","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinocarlos%2Fdecked","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinocarlos%2Fdecked/lists"}