{"id":14965884,"url":"https://github.com/smakss/convert-numbers","last_synced_at":"2025-10-25T13:30:48.867Z","repository":{"id":40705305,"uuid":"259918956","full_name":"SMAKSS/convert-numbers","owner":"SMAKSS","description":"NPM package that converts Arabic and Persian numbers to English equivalent to avoid data inconsistency.","archived":false,"fork":false,"pushed_at":"2024-02-16T17:25:31.000Z","size":431,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T07:11:52.847Z","etag":null,"topics":["arabic-number","arabic-numbers","convert-number-to-english","convert-numbers","digit","hacktoberfest","javascript","npm","npm-install","npm-package","npmjs","persian-number","yarn-package","yarn-packages"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@smakss/convert-numbers","language":"TypeScript","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/SMAKSS.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-04-29T12:27:32.000Z","updated_at":"2023-12-31T21:57:21.000Z","dependencies_parsed_at":"2024-06-21T16:53:23.479Z","dependency_job_id":"b2401b29-2ae7-4df8-92ce-d52f1dd4bdd6","html_url":"https://github.com/SMAKSS/convert-numbers","commit_stats":{"total_commits":81,"total_committers":4,"mean_commits":20.25,"dds":"0.45679012345679015","last_synced_commit":"cecf3b04ad8d6125caf9252f0b02a75a838657c6"},"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAKSS%2Fconvert-numbers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAKSS%2Fconvert-numbers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAKSS%2Fconvert-numbers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAKSS%2Fconvert-numbers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SMAKSS","download_url":"https://codeload.github.com/SMAKSS/convert-numbers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238147552,"owners_count":19424282,"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":["arabic-number","arabic-numbers","convert-number-to-english","convert-numbers","digit","hacktoberfest","javascript","npm","npm-install","npm-package","npmjs","persian-number","yarn-package","yarn-packages"],"created_at":"2024-09-24T13:35:30.935Z","updated_at":"2025-10-25T13:30:48.538Z","avatar_url":"https://github.com/SMAKSS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convert Numbers\n\n![npm](https://img.shields.io/npm/v/@smakss/convert-numbers) ![NPM](https://img.shields.io/npm/l/@smakss/convert-numbers) ![npm](https://img.shields.io/npm/dt/@smakss/convert-numbers) ![npm bundle size (scoped)](https://img.shields.io/bundlephobia/min/@smakss/convert-numbers)\n\nConvert Numbers is a utility package designed to ensure consistency in data transfer by converting Arabic and Persian numerals to English numerals. This tool is essential when user inputs might originate from different keyboard settings, requiring standardization of all digits to English format before further processing or database storage.\n\n## Demo\n\nCheck out the working demo on CodeSandbox:\n\n[![View @smakss/convert-numbers](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/smakss-convert-numbers-bstmfj?fontsize=14\u0026hidenavigation=1\u0026theme=dark)\n\n## Installation\n\nInstall the package using npm or yarn:\n\n```bash\nnpm i @smakss/convert-numbers\n# or\nyarn add @smakss/convert-numbers\n```\n\n## Usage\n\nImport `convertNumbers` into your project as a CommonJS or ECMAScript module:\n\nECMAScript Modules:\n\n```js\nimport ConvertNumbers from '@smakss/convert-numbers';\n```\n\nThen, use the function like this:\n\n```js\n// Converts Persian numbers to '1234567890'\nconsole.log(ConvertNumbers('۱۲۳۴۵۶۷۸۹۰'));\n\n// Converts Arabic numbers to '1234567890'\nconsole.log(ConvertNumbers('١٢٣٤٥٦٧٨٩٠'));\n\n// Returns an empty string for no input\nconsole.log(ConvertNumbers());\n```\n\n## Features\n\n- Robust conversion: Utilizes a mapping approach for efficiency and readability, with a fallback to regular expressions for longer strings.\n- Error resilience: In case of unforeseen errors or compatibility issues, the function gracefully falls back to a basic `for-of` loop iteration.\n- Wide compatibility: Designed to work across a variety of JavaScript environments.\n\n## Documentation\n\nFor more detailed examples and information about the function usage, refer to the JSDoc comments in the source code.\n\n## Contributing\n\nWe welcome contributions! For guidelines on how to contribute, please check [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Code of Conduct\n\nWe are committed to fostering a welcoming and positive community. Please see our [Code of Conduct](./CODE_OF_CONDUCT.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmakss%2Fconvert-numbers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmakss%2Fconvert-numbers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmakss%2Fconvert-numbers/lists"}