{"id":16812254,"url":"https://github.com/flet/prettier-bytes","last_synced_at":"2025-04-05T13:08:32.845Z","repository":{"id":57329959,"uuid":"53428157","full_name":"Flet/prettier-bytes","owner":"Flet","description":":gem: augment pretty-bytes to make the output a little more readable (and a little less precise)","archived":false,"fork":false,"pushed_at":"2017-05-15T18:57:41.000Z","size":10,"stargazers_count":98,"open_issues_count":0,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-13T17:20:18.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Flet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-08T16:38:49.000Z","updated_at":"2024-01-09T10:25:51.000Z","dependencies_parsed_at":"2022-09-10T12:51:32.748Z","dependency_job_id":null,"html_url":"https://github.com/Flet/prettier-bytes","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flet%2Fprettier-bytes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flet%2Fprettier-bytes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flet%2Fprettier-bytes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flet%2Fprettier-bytes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Flet","download_url":"https://codeload.github.com/Flet/prettier-bytes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"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":[],"created_at":"2024-10-13T10:21:12.804Z","updated_at":"2025-04-05T13:08:32.822Z","avatar_url":"https://github.com/Flet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prettier-bytes\n\n[![npm][npm-image]][npm-url]\n[![travis][travis-image]][travis-url]\n[![standard][standard-image]][standard-url]\n\n[npm-image]: https://img.shields.io/npm/v/prettier-bytes.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/prettier-bytes\n[travis-image]: https://img.shields.io/travis/Flet/prettier-bytes.svg?style=flat-square\n[travis-url]: https://travis-ci.org/Flet/prettier-bytes\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard-url]: http://npm.im/standard\n\nAugment pretty-bytes to make the output a little more readable (and a little less precise)\n\nDifferences from `pretty-bytes`:\n - The fractional portion is rounded to one digit (ex: `2.1 MB`).\n - If there is more than one digit to the left of the decimal, the fractional portion is rounded off  (ex: `11 KB`).\n - Changed `kB` to `KB`, for more prettiness. Regular users are not likely to care about the technical difference.\n - No dependencies.\n\n## Install\n\n```\nnpm install prettier-bytes\n```\n\n## Usage\n\n```js\nvar prettierBytes = require('prettier-bytes')\n\nvar pretty = prettierBytes(1337)\nconsole.log(pretty)\n// logs 1.3 KB\n```\n\nExamples from test output:\n```bash\n    ✔ bytes: 2 -\u003e 2 B\n    ✔ bytes: 9 -\u003e 9 B\n    ✔ bytes: 25 -\u003e 25 B\n    ✔ bytes: 235 -\u003e 235 B\n    ✔ bytes: 2335 -\u003e 2.3 KB\n    ✔ bytes: 23552 -\u003e 24 KB\n    ✔ bytes: 235520 -\u003e 236 KB\n    ✔ bytes: 2355520 -\u003e 2.4 MB\n    ✔ bytes: 23555520 -\u003e 24 MB\n    ✔ bytes: 235555520 -\u003e 236 MB\n    ✔ bytes: 2355555520 -\u003e 2.4 GB\n    ✔ bytes: 23555555520 -\u003e 24 GB\n    ✔ bytes: 235556555520 -\u003e 236 GB\n    ✔ bytes: 2355556655520 -\u003e 2.4 TB\n    ✔ bytes: 23555566655520 -\u003e 24 TB\n    ✔ bytes: 235555566665520 -\u003e 236 TB\n```\n\n## Contributing\n\nContributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first.\n\n## License\n\n[ISC](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflet%2Fprettier-bytes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflet%2Fprettier-bytes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflet%2Fprettier-bytes/lists"}