{"id":18338765,"url":"https://github.com/tableflip/scrabble-score-keeper","last_synced_at":"2025-04-09T20:35:52.174Z","repository":{"id":33748070,"uuid":"37403041","full_name":"tableflip/scrabble-score-keeper","owner":"tableflip","description":"Module for keeping track of scrabble scores","archived":false,"fork":false,"pushed_at":"2015-06-17T12:18:08.000Z","size":101,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-15T12:46:45.645Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tableflip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-14T07:15:37.000Z","updated_at":"2016-01-06T13:00:41.000Z","dependencies_parsed_at":"2022-09-13T13:02:41.176Z","dependency_job_id":null,"html_url":"https://github.com/tableflip/scrabble-score-keeper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fscrabble-score-keeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fscrabble-score-keeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fscrabble-score-keeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fscrabble-score-keeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tableflip","download_url":"https://codeload.github.com/tableflip/scrabble-score-keeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248108374,"owners_count":21049124,"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-05T20:15:09.064Z","updated_at":"2025-04-09T20:35:52.153Z","avatar_url":"https://github.com/tableflip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scrabble-score-keeper\n\n```js\nvar ScoreKeeper = require('scrabble-score-keeper')\n\nvar keeper = new ScoreKeeper()\n\nvar points = keeper.play([\n  {char: 'B', x: 0, y: 0},\n  {char: 'I', x: 1, y: 0},\n  {char: 'G', x: 2, y: 0}\n], 'Player1')\n\nconsole.log('Points for word BIG: ', points)\n```\n\n## Options\n\n### points.board\n\n```js\nnew ScoreKeeper({\n  points: {\n    board: [\n      [{LS: 1, WS: 3}, /* ... */],\n      /* ... */\n    ]\n  }\n})\n```\n\nAn array of rows/columns representing the scrabble board. Each item is an object with letter/word scores in [scrabble-board](https://www.npmjs.com/package/scrabble-board) format.\n\n### points.letter\n\n```js\nnew ScoreKeeper({\n  points: {\n    letter: {\n      A: 1,\n      B: 2,\n      /* ... */\n    }\n  }\n})\n```\n\nAn object with letter =\u003e points mapping.\n\n## API\n\n### `ScoreKeeper.play(letters[, player])`\n\nPlace an array of letters on the board. Letters Look like this:\n\n```js\n{char: 'A', x: 0, y, 0}\n```\n\n`char` is the letter to play, `x` is the column, `y` is the row.\n\nIt returns the total points for the letters played and will cause a `play` event to be emitted.\n\n### `ScoreKeeper.undo()`\n\nUndo the last play, returning details of the play that was undone. Play details look like:\n\n```js\n{letters: [{char: 'A', x: 0, y: 0}, /* ... */], points: 13, player: 'team1'}\n```\n\nIt causes a `undo` event to be emitted.\n\n### `ScoreKeeper.score([player])`\n\nGet the total score, or the total score for a particular player if passed.\n\n## Events\n\n### play\n\n```js\nvar ScoreKeeper = require('scrabble-score-keeper')\nvar keeper = new ScoreKeeper()\n\nkeeper.on('play', function (play) {\n  console.log(play.player, 'played', play.letters, 'and scored', play.points, 'points')\n})\n```\n\nThe `play` event is emitted after a play has been made.\n\n### undo\n\nThe `undo` event is emitted after the last play has been undone.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fscrabble-score-keeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftableflip%2Fscrabble-score-keeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fscrabble-score-keeper/lists"}