{"id":27079208,"url":"https://github.com/seavleu/khmer-utils","last_synced_at":"2026-03-06T19:06:38.247Z","repository":{"id":286078388,"uuid":"960296197","full_name":"Seavleu/khmer-utils","owner":"Seavleu","description":"A 🇰🇭 utility library for number formatting, currency display, date localization, text normalization, and script transliteration, built for Cambodian developers.","archived":false,"fork":false,"pushed_at":"2025-04-04T07:50:45.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-27T15:48:14.179Z","etag":null,"topics":["currency-conversion","date-localization","khmer-language","locale","number-formatting","text-normalization","transliteration"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/khmer-utils","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/Seavleu.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":"2025-04-04T07:30:10.000Z","updated_at":"2025-05-06T10:38:50.000Z","dependencies_parsed_at":"2025-04-04T08:38:21.504Z","dependency_job_id":null,"html_url":"https://github.com/Seavleu/khmer-utils","commit_stats":null,"previous_names":["seavleu/khmer-utils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Seavleu/khmer-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seavleu%2Fkhmer-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seavleu%2Fkhmer-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seavleu%2Fkhmer-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seavleu%2Fkhmer-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seavleu","download_url":"https://codeload.github.com/Seavleu/khmer-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seavleu%2Fkhmer-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30192433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T18:54:55.862Z","status":"ssl_error","status_checked_at":"2026-03-06T18:53:04.013Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["currency-conversion","date-localization","khmer-language","locale","number-formatting","text-normalization","transliteration"],"created_at":"2025-04-06T01:32:56.750Z","updated_at":"2026-03-06T19:06:38.213Z","avatar_url":"https://github.com/Seavleu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Khmer Number \u0026 Currency Formatter 🛠🇰🇭\n\nA lightweight utility library to help developers format numbers, currencies, and dates using **Khmer Unicode**, along with utilities for transliteration, normalization, and Khmer-specific input validation.\n\n## 📦 Installation\n\nInstall via [npm](https://www.npmjs.com/):\n\n```bash\nnpm install khmer-utils\n```\n\n## 📚 Features\n\n- ✅ Convert Arabic numbers to Khmer numerals\n- ✅ Format currency into Khmer Riel (`៛`) or `រៀល`\n- ✅ Format `Date` objects using Khmer digits\n- ✅ Normalize Khmer text (trim, reduce spaces, normalize Unicode)\n- ✅ Transliterate Khmer script to Latin phonetics\n- ✅ Validate Khmer phone numbers \u0026 national IDs\n\n## 🛠 Usage\n\n### 1. Importing\n\n```js\nconst {\n  formatNumber,\n  formatCurrency,\n  formatDate,\n  normalizeText,\n  khmerToLatin,\n  validateMobile,\n  validateLandline,\n  validateNationalID,\n} = require(\"khmer-utils\");\n```\n\n## 🔢 formatNumber\n\nConvert Arabic numbers to Khmer numerals.\n\n```js\nformatNumber(12345); // \"១២៣៤៥\"\nformatNumber(\"123,456.78\"); // \"១២៣,៤៥៦.៧៨\"\n```\n\n## 💵 formatCurrency\n\nFormat numbers as Khmer Riel currency.\n\n```js\nformatCurrency(12345);\n// Output: \"១២,៣៤៥៛\"\n\nformatCurrency(12345.678, {\n  minimumFractionDigits: 2,\n  maximumFractionDigits: 2,\n  currencySymbol: \" រៀល\",\n});\n// Output: \"១២,៣៤៥.៦៨ រៀល\"\n```\n\n## 📅 formatDate\n\nFormat JavaScript `Date` objects into `DD/MM/YYYY` using Khmer digits.\n\n```js\nformatDate(new Date(2023, 2, 15));\n// Output: \"១៥/៣/២០២៣\"\n\nformatDate(new Date(2025, 0, 1), { delimiter: \"-\" });\n// Output: \"១-១-២០២៥\"\n```\n\n## 🧹 normalizeText\n\nNormalize Khmer or mixed-language text by:\n\n- Removing extra spaces\n- Lowercasing\n- Unicode NFC normalization\n\n```js\nnormalizeText(\"   សួស្តី   ពិភពលោក   \");\n// Output: \"សួស្តី ពិភពលោក\"\n```\n\n## 🔤 khmerToLatin\n\nTransliterate basic Khmer script to Latin characters.\n\n```js\nkhmerToLatin(\"កខគឃង\");\n// Output: \"kkhggng\"\n```\n\n## ✅ Validators\n\n### validateMobile\n\n```js\nvalidateMobile(\"+855-12-3456789\"); // true\nvalidateMobile(\"+855-123-456789\"); // false\n```\n\n### validateLandline\n\n```js\nvalidateLandline(\"+855-23-123456\"); // true\nvalidateLandline(\"+855-23-12345\"); // false\n```\n\n### validateNationalID\n\n```js\nvalidateNationalID(\"1234567890\"); // true\nvalidateNationalID(\"123456789\"); // false\n```\n\n## 🔒 License\n\nMIT License\n\n## 📝 Others\nFeel free to reach out if you want to \u003ca href=\"https://github.com/Seavleu/khmer-utils\"\u003econtribute\u003c/a\u003e or report \u003ca href=\"https://github.com/Seavleu/khmer-utils/issues\"\u003eissues\u003c/a\u003e!\n\n1. Fork this repo\n2. Create a new branch: `git checkout -b my-change`\n3. Make your changes\n4. Submit a pull request\n\n## 🌐 Support \u0026 Community\n\nIf you find this useful for Khmer development or localization, please ⭐️ the repo and share it!\n\nCreated with ❤️ by Seavleu Heang\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseavleu%2Fkhmer-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseavleu%2Fkhmer-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseavleu%2Fkhmer-utils/lists"}