{"id":38215855,"url":"https://github.com/fodydev/afrim-js","last_synced_at":"2026-01-17T00:47:40.859Z","repository":{"id":204317793,"uuid":"711570268","full_name":"fodydev/afrim-js","owner":"fodydev","description":"JS binding of the afrim input method engine.","archived":false,"fork":false,"pushed_at":"2025-06-12T17:05:18.000Z","size":41,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T15:39:08.068Z","etag":null,"topics":["afrim","ime","rust","wasm"],"latest_commit_sha":null,"homepage":"https://www.npmjs.org/package/afrim-js","language":"Rust","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/fodydev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-10-29T17:07:07.000Z","updated_at":"2025-06-12T17:04:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"3547de87-7814-49c7-8cc2-922294bcdc6b","html_url":"https://github.com/fodydev/afrim-js","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":"0.19047619047619047","last_synced_commit":"262d4feffaa81a5cce1dfadef14805da7b6b3e67"},"previous_names":["pythonbrad/afrim-js"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fodydev/afrim-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fodydev%2Fafrim-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fodydev%2Fafrim-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fodydev%2Fafrim-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fodydev%2Fafrim-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fodydev","download_url":"https://codeload.github.com/fodydev/afrim-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fodydev%2Fafrim-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28490572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T23:55:29.509Z","status":"ssl_error","status_checked_at":"2026-01-16T23:55:29.108Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["afrim","ime","rust","wasm"],"created_at":"2026-01-17T00:47:40.793Z","updated_at":"2026-01-17T00:47:40.842Z","avatar_url":"https://github.com/fodydev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003ch1\u003e\u003ccode\u003eafrim\u003c/code\u003e\u003c/h1\u003e\n\n  \u003cstrong\u003eA binding of the \u003ca href=\"https://github.com/pythonbrad/afrim\"\u003eafrim ime engine\u003c/a\u003e for the web.\u003c/strong\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/pythonbrad/afrim-js/actions/workflows/ci.yml\"\u003e\u003cimg alt=\"Build Status\" src=\"https://github.com/pythonbrad/afrim-js/actions/workflows/ci.yml/badge.svg?branch=main\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.org/package/afrim\"\u003e\u003cimg alt=\"NPM version\" src=\"https://img.shields.io/npm/v/afrim.svg?style=flat-square\"/\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003ch3\u003e\n    \u003ca href=\"https://github.com/pythonbrad/afrim-web\"\u003eDemo\u003c/a\u003e\n  \u003c/h3\u003e\n\n  \u003csub\u003eBuilt with 🦀🕸 by \u003ca href=\"https://github.com/pythonbrad\"\u003e@pythonbrad\u003c/a\u003e\u003c/sub\u003e\n\u003c/div\u003e\n\n### 🛠️ Build with `wasm-pack build`\n\n```\nwasm-pack build\n```\n\n**Note**: Always use `wasm-pack build --debug` in debug mode.\n\n### 🔋 Features Included\n\n* `strsim` for text similarity.\n* `rhai` for scripting.\n\n### Lite Version\nWe also offer a lite version of this library for those who need a more lightweight solution.\n\nYou can find it here [npm/afrim-lite](https://www.npmjs.com/package/afrim-lite).\n\n**Note:** This version implies the dropped rhai feature.\n\n### Installation\n\n```\nnpm install afrim\n```\n\n### Usage\n\n```javascript\nimport { Preprocessor, Translator } from \"afrim\";\nimport { convertTomlToJson } from \"afrim\";\n\n(async function () {\n  // We execute preprocessor commands in idle.\n  var processCommand = () =\u003e {\n    var cmd = JSON.parse(preprocessor.popQueue());\n    // ...\n    requestAnimationFrame(processCommand);\n  };\n  // ...\n\n  // We config the afrim ime.\n  var preprocessor = new Preprocessor(data, 64);\n  var translator = new Translator(dictionary, false);\n  Object.entries(scripts).forEach((e) =\u003e\n    translator.register(e[0], e[1]),\n  );\n  // ...\n\n  // We listen keyboard events.\n  textFieldElement.addEventListener(\n    \"keyup\",\n    (event) =\u003e {\n      // ...\n      \n      // Commit the predicate.\n      if (event.code == \"Space\") {\n        var predicate = global.memory.predicates[global.memory.predicateId];\n\n        if (predicate) preprocessor.commit(predicate[3]);\n        clearPredicate();\n      }\n\n      var changed = preprocessor.process(event.key, \"keydown\");\n      var input = preprocessor.getInput();\n\n      // We update the predicates\n      if (!changed) return;\n\n      tooltipInputElement.innerText = \"📝 \" + input;\n\n      var predicates = translator.translate(input);\n      loadPredicates(predicates);\n      updatePredicate();\n      // ...\n    },\n    false,\n  );\n  // ...\n\n  // We start the processor.\n  requestAnimationFrame(processCommand);\n})();\n```\n\n### License\n\nLicensed under MIT license ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT).\n\n### Contribution\n\nWe are open for contributions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffodydev%2Fafrim-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffodydev%2Fafrim-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffodydev%2Fafrim-js/lists"}