{"id":29977444,"url":"https://github.com/mazesec/aveta","last_synced_at":"2025-08-04T10:32:37.816Z","repository":{"id":257788815,"uuid":"452714687","full_name":"mazesec/aveta","owner":"mazesec","description":"Convert long numbers into abbreviated and human-readable strings on an easy way.","archived":false,"fork":false,"pushed_at":"2025-01-05T17:08:33.000Z","size":241,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T02:51:45.995Z","etag":null,"topics":["format","human","million","numbers","readable","thousand"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/aveta","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/mazesec.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"ko_fi":"tal7aouy"}},"created_at":"2022-01-27T14:28:11.000Z","updated_at":"2025-01-05T17:08:14.000Z","dependencies_parsed_at":"2025-01-04T23:16:58.309Z","dependency_job_id":"1fa2f32a-28fd-4b72-b3bd-77510c31fb96","html_url":"https://github.com/mazesec/aveta","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":0.2692307692307693,"last_synced_commit":"f50a34ebd7f5e6ab9010b991207827b8cbc56be7"},"previous_names":["tal7aouy/aveta","mazesec/aveta"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/mazesec/aveta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazesec%2Faveta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazesec%2Faveta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazesec%2Faveta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazesec%2Faveta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mazesec","download_url":"https://codeload.github.com/mazesec/aveta/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazesec%2Faveta/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268682596,"owners_count":24289667,"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-08-04T02:00:09.867Z","response_time":79,"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":["format","human","million","numbers","readable","thousand"],"created_at":"2025-08-04T10:31:30.746Z","updated_at":"2025-08-04T10:32:37.797Z","avatar_url":"https://github.com/mazesec.png","language":"TypeScript","funding_links":["https://ko-fi.com/tal7aouy"],"categories":[],"sub_categories":[],"readme":"# Aveta\n\n\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n    \u003cimg src=\"icon.png\" alt=\"logo\" width=\"200\"\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eConvert large numbers into concise, human-readable formats easily.\u003c/h4\u003e\n\n| Input :disappointed: | Output :joy: |\n| -------------------- | ------------ |\n| `6000`               | `'6K'`       |\n| `10000`              | `'10K'`      |\n| `42500`              | `'42.5K'`    |\n| `1250000`            | `'1.25M'`    |\n\n## Installation\n\n### With npm:\n\n```bash\nnpm install aveta\n```\n\n### With Yarn:\n\n```bash\nyarn add aveta\n```\n\n## Usage\n\n```typescript\naveta(value: number, options?: Partial\u003cIOptions\u003e): string;\n```\n\n```js\nimport aveta from 'aveta';\n\n// For CommonJS: `const { aveta } = require('aveta');`\n\naveta(8700); // '8.7K'\n\naveta(123456, {\n  digits: 3,\n  lowercase: true,\n});\n// '123k'\n\naveta(4567, {\n  digits: 3,\n  lowercase: true,\n});\n// '4.57k'\n\naveta(2048000, {\n  precision: 2,\n  lowercase: true,\n});\n// '2.48m'\n\naveta(45500, {\n  precision: 3,\n  separator: ',',\n});\n// '45,500K'\n\naveta(1440000, {\n  units: ['B', 'KB', 'MB', 'GB', 'TB'],\n  space: true,\n});\n// '1.44 MB'\n```\n\n### AvetaReverse\n\nAveta also supports reversing the human-readable format back to a numeric value using the `avetaReverse` function.\n\n```typescript\navetaReverse(value: string): number;\n```\n\n```js\nimport { avetaReverse } from 'aveta';\n\n// For CommonJS: `const { avetaReverse } = require('aveta');`\n\navetaReverse('8.7K'); // 8700\n\navetaReverse('123k'); // 123000\n\navetaReverse('4.57k'); // 4570\n\navetaReverse('2.48m'); // 2480000\n```\n\n### Command Line Usage\n\nYou can also use `aveta` directly in the terminal.\n\n```bash\n$ aveta 234000\n# or\n$ npx aveta 234000\n234K\n```\n\nFor more options, run:\n\n```bash\naveta --help\n```\n\n## Default Options\n\n## Default Options\n\n| Name           | Type                          | Default                              | Description                                                         |\n| -------------- | ----------------------------- | ------------------------------------ | ------------------------------------------------------------------- |\n| `precision`    | `number`                      | `1`                                  | Number of decimal places to round to                                |\n| `digits`       | `number`                      | `0`                                  | Number of significant digits to display                             |\n| `separator`    | `string`                      | `'.'`                                | Decimal separator (e.g. `.` or `,`)                                 |\n| `lowercase`    | `boolean`                     | `false`                              | Output unit abbreviations in lowercase                              |\n| `space`        | `boolean`                     | `false`                              | Insert a space between the number and unit abbreviation             |\n| `units`        | `Array\u003cstring\u003e`               | `['', 'K', 'M', 'B', 'T', 'P', 'E']` | Units to use for thousand, million, billion, etc.                   |\n| `base`         | `number`                      | `1000`                               | Base to scale numbers (default is 1000 for K, M, etc.)              |\n| `roundingMode` | `'up' \\| 'down' \\| 'nearest'` | `'nearest'`                          | How numbers are rounded: nearest, always up, or always down |\n| `threshold`    | `number`                      | `0`                                  | Minimum value before unit conversion is applied (coming)            |\n\n---\n\n## License\n\nAveta is available under the [MIT License](LICENSE).\n\n## Authors\n\nCreated by [Mhammed Talhaouy](https://github.com/tal7aouy).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazesec%2Faveta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmazesec%2Faveta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazesec%2Faveta/lists"}