{"id":13507960,"url":"https://github.com/arvidkahl/sizeable","last_synced_at":"2025-04-09T19:21:13.274Z","repository":{"id":52857873,"uuid":"65909980","full_name":"arvidkahl/sizeable","owner":"arvidkahl","description":"An Elixir library to make File Sizes human-readable","archived":false,"fork":false,"pushed_at":"2024-08-19T15:49:19.000Z","size":32,"stargazers_count":39,"open_issues_count":4,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-14T02:44:56.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/arvidkahl.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-17T13:31:17.000Z","updated_at":"2024-05-01T23:22:54.000Z","dependencies_parsed_at":"2024-05-01T16:19:51.572Z","dependency_job_id":"7909e52b-2fd1-418d-94e3-e1427f032f27","html_url":"https://github.com/arvidkahl/sizeable","commit_stats":{"total_commits":24,"total_committers":8,"mean_commits":3.0,"dds":0.375,"last_synced_commit":"89559fa44692ba0988147cb93a88b70c2cc6f672"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arvidkahl%2Fsizeable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arvidkahl%2Fsizeable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arvidkahl%2Fsizeable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arvidkahl%2Fsizeable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arvidkahl","download_url":"https://codeload.github.com/arvidkahl/sizeable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248095156,"owners_count":21046799,"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-08-01T02:00:44.232Z","updated_at":"2025-04-09T19:21:13.243Z","avatar_url":"https://github.com/arvidkahl.png","language":"Elixir","funding_links":[],"categories":["Files and Directories"],"sub_categories":[],"readme":"# Sizeable\n\n\u003c!-- MDOC !--\u003e\n\n[![Module Version](https://img.shields.io/hexpm/v/sizeable.svg)](https://hex.pm/packages/sizeable)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/sizeable/)\n[![Total Download](https://img.shields.io/hexpm/dt/sizeable.svg)](https://hex.pm/packages/sizeable)\n[![License](https://img.shields.io/hexpm/l/sizeable.svg)](https://github.com/arvidkahl/sizeable/blob/master/LICENSE)\n[![Last Updated](https://img.shields.io/github/last-commit/arvidkahl/sizeable.svg)](https://github.com/arvidkahl/sizeable/commits/master)\n\nAn Elixir library to make file sizes human-readable.\n\n## Installation\n\nThe package can be installed as:\n\n1.  Add `:sizeable` to your list of dependencies in `mix.exs`:\n\n    ```elixir\n    def deps do\n      [\n        {:sizeable, \"~\u003e 1.0\"}\n      ]\n    end\n    ```\n\n2.  Ensure `sizeable` is started before your application if you're using Elixir 1.3 or lower:\n\n    ```elixir\n    def application do\n      [\n        applications: [:sizeable]\n      ]\n    end\n    ```\n\n## Usage\n\n### Get file size for 1024 bytes\n\n```elixir\nSizeable.filesize(1024)\n\"1 KB\"\n```\n\n### Get bit-sized file size for 1024 bytes\n\n```elixir\nSizeable.filesize(1024, bits: true)\n\"8 Kb\"\n```\n\n### Get output format as list\n\n```elixir\nSizeable.filesize(1024, output: :list)\n[1, \"KB\"]\n```\n\n### Get output format as map\n\n```elixir\nSizeable.filesize(1024, output: :map)\n%{result: 1, unit: \"KB\"}\n```\n\nRead [Sizeable.filesize/2](https://hexdocs.pm/sizeable) for further usage details.\n\n\u003c!-- MDOC !--\u003e\n\n## Copyright and License\n\nCopyright (c) 2016 Arvid Kahl\n\nThis software is licensed under [the MIT license](https://github.com/arvidkahl/sizeable/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farvidkahl%2Fsizeable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farvidkahl%2Fsizeable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farvidkahl%2Fsizeable/lists"}