{"id":13547962,"url":"https://github.com/ngryman/badge-size","last_synced_at":"2025-05-15T18:02:26.272Z","repository":{"id":35120937,"uuid":"39315192","full_name":"ngryman/badge-size","owner":"ngryman","description":":beers: Displays the size of a given file in your repository.","archived":false,"fork":false,"pushed_at":"2024-11-20T08:34:03.000Z","size":1225,"stargazers_count":310,"open_issues_count":6,"forks_count":56,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-15T18:02:01.452Z","etag":null,"topics":["badge","gzip","minify","size"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngryman.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2015-07-18T22:50:42.000Z","updated_at":"2025-04-09T10:55:27.000Z","dependencies_parsed_at":"2024-12-14T10:02:17.228Z","dependency_job_id":"bb5226e5-888e-4063-9395-4a42ef149fd7","html_url":"https://github.com/ngryman/badge-size","commit_stats":{"total_commits":105,"total_committers":14,"mean_commits":7.5,"dds":"0.35238095238095235","last_synced_commit":"fe06420f8f90710a7655efb6fb0d4ac2f712e10c"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngryman%2Fbadge-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngryman%2Fbadge-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngryman%2Fbadge-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngryman%2Fbadge-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngryman","download_url":"https://codeload.github.com/ngryman/badge-size/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394719,"owners_count":22063984,"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":["badge","gzip","minify","size"],"created_at":"2024-08-01T12:01:03.826Z","updated_at":"2025-05-15T18:02:26.212Z","avatar_url":"https://github.com/ngryman.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# badgesize.io [now has a new home](https://github.com/nevware21/badgesize)\n\nThis project `img.badgesize.io` is no longer maintained or supported from this repo, please use [@nevware21/badgesize](https://github.com/nevware21/badgesize) for all status, feature and support requests.\n\n## badge-size (previous)\n\n\u003e Displays the size of a given file in your repository.\n\n`badge-size` allows you to display in real time the size of a given file which lives in your repository.\nThe size is always the one of your last pushed commit.\n\nIt is mainly designed for front-end library authors that want to advertise the weight of\ntheir builds to their users. But you can use it for any other purpose of course :v:.\n\n\n## Examples\n\n Badge       | URL\n:------------|:---------------------------------------------------------------------------------|\nNormal size  | ![](https://img.badgesize.io/ngryman/badge-size/master/api/index.js.svg)\nGzipped size | ![](https://img.badgesize.io/ngryman/badge-size/master/api/index.js.svg?compression=gzip)\nBrotli size  | ![](https://img.badgesize.io/ngryman/badge-size/master/api/index.js.svg?compression=brotli)\nCustom label | ![](https://img.badgesize.io/ngryman/badge-size/master/api/index.js.svg?label=As_tiny_as)\nPNG format   | ![](https://img.badgesize.io/ngryman/badge-size/master/api/index.js.png)\n\n\n## Usage\n\nIt works like any other badge service you may know and it's configurable in the image url itself.\nHere is the general pattern of a typical `badge-size` url:\n\n```\nhttps://img.badgesize.io/:filepath[.svg|png|jpg][?compression=gzip|brotli][\u0026label=string][\u0026max=string][\u0026softmax=string]\n```\n\n#### `:filepath`\n\nRelative URL of file on GitHub of any absolute URL if hosted elsewhere.\n\nThe format of the GitHub URL is the same as when you browse it in the source explorer, minus `blob/` part.\nHere is its typical form:\n\n```md\n:user/:repo/:branch/:path\n```\n\nFor example if I want to point to this repository `index.js`, it would be:\n\n`https://github.com/`**`ngryman/badge-size/master/index.js`**\n\nNote that the branch name is mandatory.\n\n#### `[.svg|png|json]`\n\nOptional image format. By default `svg` is used.\n\nWhen `json` is used, the response is a JSON object of the following shape:\n\n```json\n{\n  \"color\": \"44cc11\",\n  \"originalSize\": 997,\n  \"prettySize\": \"997 B\",\n  \"size\": 997\n}\n```\n\n#### `[?compression=gzip|brotli]`\n\nOptional compression format to measure. It's useful if you want to advertise the *true* size your\nfile would take on the wire, assuming the server has `gzip` or `brotli` compression enabled.\n\n#### `[\u0026label=string]`\n\nOptional text to display in the badge instead of *size* / *gzip size* / *brotli size*.\n\n#### `[\u0026color=string]`\n\nOptional background color. By default it's `brightgreen`.\u003cbr\u003e\nYou can specify hexadecimal colors, without the dash (i.e `bada55`) or one of the following named\ncolors:\n\n![](https://img.shields.io/badge/color-brightgreen-brightgreen.svg)\n![](https://img.shields.io/badge/color-green-green.svg)\n![](https://img.shields.io/badge/color-yellowgreen-yellowgreen.svg)\n![](https://img.shields.io/badge/color-yellow-yellow.svg)\n![](https://img.shields.io/badge/color-orange-orange.svg)\n![](https://img.shields.io/badge/color-red-red.svg)\n![](https://img.shields.io/badge/color-lightgrey-lightgrey.svg)\n![](https://img.shields.io/badge/color-blue-blue.svg)\n\n#### `[\u0026style=string]`\n\nOptional style. By default it's `flat`.\u003cbr\u003e\nYou can specify one of the following:\n\n![](https://img.shields.io/badge/style-plastic-brightgreen.svg?style=plastic)\n![](https://img.shields.io/badge/style-flat-brightgreen.svg?style=flat)\n![](https://img.shields.io/badge/style-flat--square-brightgreen.svg?style=flat-square)\n![](https://img.shields.io/badge/style-social-brightgreen.svg?style=social)\n\n#### `[\u0026max=string] [\u0026softmax=string]`\n\nOptional size limits in bytes.\u003cbr\u003e\nMax is a hard limit. Exceeding this will generate a red badge. \u003cbr\u003e\nIf softlimit is provided (in addition to max) and the file size falls within the range of max and softmax, a yellow badge will be generated.\u003cbr\u003e\nThis setting will override the color option in the above two scenarios.\n\n```\nhttps://img.badgesize.io/:filepath?max=100000\u0026softmax=200000\n```\n\n![](https://img.shields.io/badge/size-50%20kB-brightgreen.svg)\n![](https://img.shields.io/badge/size-150%20kB-yellow.svg)\n![](https://img.shields.io/badge/size-250%20kB-red.svg)\n\n\n## Contributors\n\n[//]: contributor-faces\n\u003ca href=\"https://github.com/ngryman\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/892048?v=4\" title=\"ngryman\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/apps/dependabot\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/in/29110?v=4\" title=\"dependabot[bot]\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/bfred-it\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/53252526?v=4\" title=\"bfred-it\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/nathancahill\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1383872?v=4\" title=\"nathancahill\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/apps/greenkeeper\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/in/505?v=4\" title=\"greenkeeper[bot]\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/FezVrasta\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/5382443?v=4\" title=\"FezVrasta\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/OliverJAsh\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/921609?v=4\" title=\"OliverJAsh\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/hairmot\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/8102124?v=4\" title=\"hairmot\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/styfle\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/229881?v=4\" title=\"styfle\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/XhmikosR\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/349621?v=4\" title=\"XhmikosR\" width=\"80\" height=\"80\"\u003e\u003c/a\u003e\n\n[//]: contributor-faces\n\n\u003csup\u003eGenerated with [contributors-faces](https://github.com/ngryman/contributor-faces).\u003c/sup\u003e\n\n\n## Other projects\n\n- [Fauda](https://github.com/ngryman/fauda): configuration made simple.\n- [Reading Time](https://github.com/ngryman/reading-time): Medium's like reading time estimation.\n- [Commitizen Emoji](https://github.com/ngryman/cz-emoji): Commitizen adapter formatting commit messages using emojis.\n\n\n## License\n\nMIT © [Nicolas Gryman](https://ngryman.sh)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngryman%2Fbadge-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngryman%2Fbadge-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngryman%2Fbadge-size/lists"}