{"id":16531027,"url":"https://github.com/brunnerlivio/deno-pretty-bytes","last_synced_at":"2025-09-06T17:37:45.177Z","repository":{"id":91282580,"uuid":"238788956","full_name":"BrunnerLivio/deno-pretty-bytes","owner":"BrunnerLivio","description":"The Deno implementation of @sindresorhus pretty-bytes package","archived":false,"fork":false,"pushed_at":"2020-02-08T23:04:53.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T19:31:35.245Z","etag":null,"topics":["deno","format","pretty-bytes"],"latest_commit_sha":null,"homepage":null,"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/BrunnerLivio.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":"2020-02-06T21:32:19.000Z","updated_at":"2021-05-19T11:40:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf97d766-ca88-42c2-9a9a-167391e2c41c","html_url":"https://github.com/BrunnerLivio/deno-pretty-bytes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BrunnerLivio/deno-pretty-bytes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunnerLivio%2Fdeno-pretty-bytes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunnerLivio%2Fdeno-pretty-bytes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunnerLivio%2Fdeno-pretty-bytes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunnerLivio%2Fdeno-pretty-bytes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrunnerLivio","download_url":"https://codeload.github.com/BrunnerLivio/deno-pretty-bytes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunnerLivio%2Fdeno-pretty-bytes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273937572,"owners_count":25194468,"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-09-06T02:00:13.247Z","response_time":2576,"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":["deno","format","pretty-bytes"],"created_at":"2024-10-11T18:07:44.274Z","updated_at":"2025-09-06T17:37:45.169Z","avatar_url":"https://github.com/BrunnerLivio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦕 pretty-bytes\n\n\u003e The Deno implementation of **[sindresorhus/pretty-bytes](https://raw.githubusercontent.com/sindresorhus/pretty-bytes).**\n\u003e Convert bytes to a human readable string: `1337` → `1.34 kB`\n\nUseful for displaying file sizes for humans.\n\n*Note that it uses base-10 (e.g. kilobyte).\n[Read about the difference between kilobyte and kibibyte.](https://web.archive.org/web/20150324153922/https://pacoup.com/2009/05/26/kb-kb-kib-whats-up-with-that/)*\n\n## Usage\n\n```js\nimport { prettyBytes } from \"https://raw.githubusercontent.com/brunnerlivio/deno-pretty-bytes/master/mod.ts\"\n\nprettyBytes(1337);\n//=\u003e '1.34 kB'\n\nprettyBytes(100);\n//=\u003e '100 B'\n\n// Display with units of bits\nprettyBytes(1337, {bits: true});\n//=\u003e '1.34 kbit'\n\n// Display file size differences\nprettyBytes(42, {signed: true});\n//=\u003e '+42 B'\n\n// Localized output using German locale\nprettyBytes(1337, {locale: 'de'});\n//=\u003e '1,34 kB'\n```\n\n\n## API\n\n### prettyBytes(number, options?)\n\n#### number\n\nType: `number`\n\nThe number to format.\n\n#### options\n\nType: `object`\n\n##### signed\n\nType: `boolean`\\\nDefault: `false`\n\nInclude plus sign for positive numbers. If the difference is exactly zero a space character will be prepended instead for better alignment.\n\n##### bits\n\nType: `boolean`\\\nDefault: `false`\n\nFormat the number as [bits](https://en.wikipedia.org/wiki/Bit) instead of [bytes](https://en.wikipedia.org/wiki/Byte). This can be useful when, for example, referring to [bit rate](https://en.wikipedia.org/wiki/Bit_rate).\n\n## Related\n\n- [sindresorhus/pretty-bytes](https://github.com/sindresorhus/pretty-bytes) - The original NodeJS implementation of pretty-bytes","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunnerlivio%2Fdeno-pretty-bytes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunnerlivio%2Fdeno-pretty-bytes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunnerlivio%2Fdeno-pretty-bytes/lists"}