{"id":21076111,"url":"https://github.com/shaack/cm-web-modules","last_synced_at":"2025-07-27T11:33:17.797Z","repository":{"id":57201052,"uuid":"124377893","full_name":"shaack/cm-web-modules","owner":"shaack","description":"Collection of clean and small ES6 modules for the web","archived":false,"fork":false,"pushed_at":"2025-01-15T12:52:51.000Z","size":597,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-20T10:08:18.122Z","etag":null,"topics":["chessmail","es6","javascript","released"],"latest_commit_sha":null,"homepage":"","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/shaack.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-08T10:48:47.000Z","updated_at":"2025-01-15T12:52:53.000Z","dependencies_parsed_at":"2024-04-18T23:27:08.274Z","dependency_job_id":"ec4d5af5-f7c7-4494-9b2c-cd44e887f01b","html_url":"https://github.com/shaack/cm-web-modules","commit_stats":{"total_commits":320,"total_committers":1,"mean_commits":320.0,"dds":0.0,"last_synced_commit":"c1517179cb6ddace5489cc205e408790de3942c4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shaack/cm-web-modules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Fcm-web-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Fcm-web-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Fcm-web-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Fcm-web-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaack","download_url":"https://codeload.github.com/shaack/cm-web-modules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Fcm-web-modules/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267349518,"owners_count":24073103,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chessmail","es6","javascript","released"],"created_at":"2024-11-19T19:26:42.544Z","updated_at":"2025-07-27T11:33:17.776Z","avatar_url":"https://github.com/shaack.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cm-web-modules \n\nA library of JavaScript ES6 (ECMAScript 6) modules, used for coding [chessmail.de](https://www.chessmail.de).\n\nThe main purpose of `cm-web-modules` is, to prevent the usage of large libraries, and to provide needed functionality with the smallest and cleanest amount of code possible.\n\nThe `cm-web-modules` modules have no external dependencies, they don't use jQuery or other frameworks. They are written with modern vanilla JavaScript in ECMAScript 6 syntax.\n\nThe `cm-web-modules` modules are:\n\n## Modules\n\n### Audio\n\nModule for the [Web Audio API](https://developer.mozilla.org/de/docs/Web/API/Web_Audio_API). For playing audio samples in a web page.\n\n### Cache\n\nCache data on client site.\n\n### Cookie\n\nModule to read, write and delete cookies.\n\n### I18n\n\nModule to handle the internationalisation of frontend text.\n\n```js\nconst i18n = new I18n(props)\n```\n\ndefault props:\n\n```js\nthis.props = {\n    locale: null,\n    fallbackLang: \"en\" // used, when the translation was not found for locale\n}\n```\n\nload language files:\n\n```js\ni18n.load(\"translations.json\").then(() =\u003e {\n    // do this after loading\n})\n```\n\nwhere the json file has the form\n\n```json\n{\n  \"de\": {\n    \"start_game\": \"Ein neues Spiel starten\",\n    \"undo_move\": \"Zug zurück nehmen\"\n  },\n  \"en\": {\n    \"start_game\": \"Start a new game\",\n    \"undo_move\": \"Undo move\"\n  }\n}\n```\n\nor directly add the translations in your js code\n\n```js\ni18n.load({\n    de: {\n        \"0_starts_game\": \"$0 startet ein neues Spiel\",\n        \"undo_move\": \"Zug zurück nehmen\"\n    },\n    en: {\n        \"0_starts_game\": \"$0 starts a new game\",\n        \"undo_move\": \"Undo move\"\n    }\n})\n```\n\nUse placeholder $n [0-9] to replace them when using.  \n\nTo handle the translations in your frontend code use\n\n```js\ni18n.t(\"0_starts_game\", [\"John Doe\"])\ni18n.t(\"undo_move\")\n```\nto render the needed text in the needed language. You can specify\nthe language in the `props` when calling new or it uses the browser\npreferences.\n\n### MessageBroker\n\nTODO documentation\n\n### Observe\n\nModule to observe object properties used for reactive coding the simple way.\n\n### Observed\n\nTODO documentation, replaces \"Observe\"\n\n### Promise Queue\n\nTODO documentation\n\n### Stopwatch\n\n```js\nconst stopwatch = new Stopwatch({\n    onStateChanged: (running) =\u003e {\n        stateOutput.innerText = running\n    },\n    onTimeChanged: (seconds) =\u003e {\n        secondsOutput.innerText = seconds.toFixed(1)\n    }\n})\nbuttonStart.addEventListener(\"click\", () =\u003e {\n    stopwatch.start()\n})\nbuttonStop.addEventListener(\"click\", () =\u003e {\n    stopwatch.stop()\n})\nbuttonReset.addEventListener(\"click\", () =\u003e {\n    stopwatch.reset()\n})\n```\n\n### SVG\n\nModule to render SVG elements and load sprites.\n\n### Template\n\nTODO documentation\n\n### Utils\n\nArrayUtils, ColorUtils, CoreUtils, DateUtils, DomUtils, EncryptionUtils,\nEventUtils, TextUtils\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaack%2Fcm-web-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaack%2Fcm-web-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaack%2Fcm-web-modules/lists"}