{"id":13454968,"url":"https://github.com/izolate/millify","last_synced_at":"2025-04-04T13:13:55.019Z","repository":{"id":39619671,"uuid":"46085880","full_name":"izolate/millify","owner":"izolate","description":"Convert long numbers to pretty, human-readable strings","archived":false,"fork":false,"pushed_at":"2023-07-19T00:52:24.000Z","size":1012,"stargazers_count":179,"open_issues_count":8,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T23:09:02.822Z","etag":null,"topics":["abbreviations","human-readable","human-readable-units","javascript","pretty","units"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/millify","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/izolate.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}},"created_at":"2015-11-12T22:52:15.000Z","updated_at":"2024-09-26T16:34:15.000Z","dependencies_parsed_at":"2024-01-13T17:33:18.076Z","dependency_job_id":"6744cad8-f855-4a10-b545-66cd442530e6","html_url":"https://github.com/izolate/millify","commit_stats":{"total_commits":145,"total_committers":6,"mean_commits":"24.166666666666668","dds":0.3310344827586207,"last_synced_commit":"9b6274f0d5b6765d48e5bef1f668b07964f5b547"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fmillify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fmillify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fmillify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fmillify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/izolate","download_url":"https://codeload.github.com/izolate/millify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182359,"owners_count":20897380,"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":["abbreviations","human-readable","human-readable-units","javascript","pretty","units"],"created_at":"2024-07-31T08:00:59.881Z","updated_at":"2025-04-04T13:13:55.001Z","avatar_url":"https://github.com/izolate.png","language":"TypeScript","readme":"# Millify\n\nConverts long `numbers` into pretty, human-readable `strings`.\n\nBefore :unamused: | After :tada:\n--- | ---\n`2000` | `'2K'`\n`10000` | `'10k'`\n`42500` | `'42.5 kg'`\n`1250000` | `'1.25 MB'`\n`2700000000` | `'2.7 bil'`\n\n\n## Install\n\nGet it on [npm](https://www.npmjs.com/package/millify):\n\n```bash\nnpm install millify\n```\n## Usage\n\n### Command line\n\n```bash\n$ millify 12345\n12.3K\n```\n\nSee `millify --help` for options.\n\n### Programmatically\n\n#### `millify(value: number, options: MillifyOptions)`\n\n```js\nimport millify from \"millify\";\n\n// For CommonJS: `const { millify } = require(\"millify\");`\n\nmillify(2500); // 2.5K\n\nmillify(1024000, {\n  precision: 3,\n  lowercase: true\n});\n// 1.024m\n\nmillify(39500, {\n  precision: 2,  \n  locales: \"de-DE\"\n});\n// 3,95K\n\nmillify(1440000, {\n  units: [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"],\n  space: true,\n});\n// 1.44 MB\n```\n\n## Options\n\nName | Type | Default | Description\n--- | --- | --- | ---\n`precision` | `number` | `1` | Number of decimal places to use\n`locales` | `string \\| Array\u003cstring\u003e` | browser language | Formats the number in different languages\n`lowercase` | `boolean` | `false` | Use lowercase abbreviations\n`space` | `boolean` | `false` | Add a space between number and abbreviation\n`units` | `Array\u003cstring\u003e` | `['', 'K', 'M', 'B', 'T', 'P', 'E']` | Unit abbreviations\n","funding_links":[],"categories":["js library/framework"],"sub_categories":["pure js"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizolate%2Fmillify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fizolate%2Fmillify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizolate%2Fmillify/lists"}