{"id":13810179,"url":"https://github.com/mulhoon/score.js","last_synced_at":"2025-12-24T15:43:24.126Z","repository":{"id":21123141,"uuid":"24423920","full_name":"mulhoon/score.js","owner":"mulhoon","description":"Scoring, levels, checkpoints and badges in Javascript - Instant gamification","archived":false,"fork":false,"pushed_at":"2024-12-19T14:54:59.000Z","size":93,"stargazers_count":186,"open_issues_count":2,"forks_count":23,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-26T06:41:40.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mulhoon.github.io/score.js/","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/mulhoon.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-24T16:56:20.000Z","updated_at":"2025-04-08T19:32:54.000Z","dependencies_parsed_at":"2024-12-19T12:27:36.329Z","dependency_job_id":"1ab23c30-883f-46ce-a319-5fa3d71c3e80","html_url":"https://github.com/mulhoon/score.js","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/mulhoon%2Fscore.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulhoon%2Fscore.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulhoon%2Fscore.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulhoon%2Fscore.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mulhoon","download_url":"https://codeload.github.com/mulhoon/score.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254120910,"owners_count":22018064,"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-08-04T02:00:47.452Z","updated_at":"2025-12-24T15:43:24.118Z","avatar_url":"https://github.com/mulhoon.png","language":"JavaScript","readme":"# score.js\n\nA small javascript module to add levels, checkpoints and badges to a linear score. \n\nSee the [demo](http://mulhoon.github.io/score.js/) or read an [introduction](https://medium.com/@mulhoon/easy-gamification-in-javascript-with-levelup-js-8ff3b67e7706)\n\n[\u003cimg src='http://img.shields.io/badge/Download-4.46kb-green.svg' /\u003e](https://raw.githubusercontent.com/mulhoon/score.js/master/lib/score.js)\n[\u003cimg src='http://img.shields.io/badge/Download%20Minified-2.6kb-green.svg' /\u003e](https://raw.githubusercontent.com/mulhoon/score.js/master/lib/score.min.js)\n\n## Installation\nInstall with npm, pnpm or yarn.\n```bash\npnpm i @mulhoon/score.js\n```\n\n## Quick usage\n```javascript\nvar score = new Score();\n\n// set score\nscore.set(123);\n\n// increase score by 1\nscore.increment();\n\n// increase score by 10\nscore.increment(10);\n\n// decrease score by 1\nscore.decrement();\n\n// get scorecard\nscore.scorecard();\n```\nscorecard returns...\n```javascript\n{\n\tscore:123\t\t\t\t\t\t// current total score\n\ttitle:\"Gorilla\",\t\t\t\t// current title\n\tquote:\"You're a true soldier\"\t// current quote\n\tlevel:2,\t\t\t\t\t\t// current level\n\tlevelscore:23,\t\t\t\t\t// current level score\n\tleveltotal:200,\t\t\t\t\t// current level total\n\tlevelprogress:11.51, \t\t\t// percentage %\n\ttotalprogress:34.45, \t\t\t// percentage %\n\tlevelup: false,\t\t\t\t\t// did we just level up?\n\ttotallevels:10 \t\t\t\t\t// total levels\n\tprestige:0 \t\t\t\t\t\t// prestige level see below\n}\n```\n```lib/score.js``` comes with 10 levels as default. ```lib/score-basic.js``` comes with none. The default levels can be replaced with custom levels using the setup below.\n\n## Setup\n\n\n```javascript\nvar score = new Score(\n\t{\n\t\tpersistant:true\t\t\t\t// uses localStorage -  default: true\n\t\tcallback:function(){...}\t// callback when levelling up\n\t\tlevels: \t\t\t\t\t// custom levels\n\t\t[\t\t\t\t\t\t\t\n\t\t\t{\n\t\t\t\t\"checkmark\": 0,\n\t\t\t\t\"status\": \"noob\",\n\t\t\t\t\"quote\": \"You're just a little newbie\"\n\t\t\t}, \n\t\t\t{\n\t\t\t\t\"checkmark\": 500,\n\t\t\t\t\"status\": \"champion\",\n\t\t\t\t\"quote\": \"You're halfway there\"\n\t\t\t}, \n\t\t\t{\n\t\t\t\t\"checkmark\": 1000,\n\t\t\t\t\"status\": \"legend\",\n\t\t\t\t\"quote\": \"You made it!\"\n\t\t\t}\n\t\t]\n\t}\n);\n```\n\n## Multipliers\nHandy when you want to give your user double or triple points for a given duration.\n\n```javascript\n// multiply all increments and decrements by 2 from now on\nscore.multiplier(2);\n\n// multiply all increments and decrements by 3 for the next 5 seconds\nscore.multiplier(3, 5000);\n\n// multiply all increments and decrements by 4 for the next 5 seconds \n// with a callback\nscore.multiplier(4, 5000, function(){ ... });\n```\n\n## Prestige levels\nTo provide an infinite score, you can allow your players to reset their score after completing all levels. \n\n```javascript\nscore.prestige();\n```\nThis resets the score to ```0``` and increments ```scorecard.prestige```. This only works if ```scorecard.totalprogress``` is 100%.\n\n## License\n\nThe MIT License\n\nCopyright (c) 2010-2014 Nic Mulvaney\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\nWritten by Mulhoon 2014.\nPlease report any [issues](https://github.com/mulhoon/score.js/issues) or suggestions.\n","funding_links":[],"categories":["📦 Legacy \u0026 Inactive Projects","JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulhoon%2Fscore.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmulhoon%2Fscore.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulhoon%2Fscore.js/lists"}