{"id":20006835,"url":"https://github.com/xelzs/code-size","last_synced_at":"2025-10-08T09:18:47.589Z","repository":{"id":56158548,"uuid":"287556214","full_name":"Xelzs/code-size","owner":"Xelzs","description":"Estimates the size of your files in different format (original, minified, gzipped, brotli).","archived":false,"fork":false,"pushed_at":"2020-11-23T16:02:24.000Z","size":53,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T11:59:04.993Z","etag":null,"topics":["brotli","css","estimation","gzip","minify","scss","size-calculation","size-coding","sizes","tool"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Xelzs.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}},"created_at":"2020-08-14T14:48:41.000Z","updated_at":"2020-11-23T16:01:36.000Z","dependencies_parsed_at":"2022-08-15T13:50:28.515Z","dependency_job_id":null,"html_url":"https://github.com/Xelzs/code-size","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xelzs%2Fcode-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xelzs%2Fcode-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xelzs%2Fcode-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xelzs%2Fcode-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xelzs","download_url":"https://codeload.github.com/Xelzs/code-size/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241444196,"owners_count":19963760,"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":["brotli","css","estimation","gzip","minify","scss","size-calculation","size-coding","sizes","tool"],"created_at":"2024-11-13T06:13:52.594Z","updated_at":"2025-10-08T09:18:47.502Z","avatar_url":"https://github.com/Xelzs.png","language":"JavaScript","readme":"# CodeSize\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/0926045450cb16d6e423/maintainability)](https://codeclimate.com/github/Xelzs/code-size/maintainability)\n\nEstimates the size of your files in different format (original, minified, gzipped, brotli).  \n\n## Command-line Usage\n\nInstall code-size package globally with npm :\n\n```\n$ npm install -g @xelzs/code-size\n```\n\nBasic usage :\n```\n$ code-size -f test.css -gbm --language css\n\nCodeSize | Version 1.0.0\n\nOriginal size : 9.11 KB\nMinified size : 7.16 KB\nGzipped size : 140 Bytes\nBrotli size : 82 Bytes\n```\n\nAvailable options :\n```\nUsage: code-size [options]\n\nOptions:\n  -V, --version              output the version number\n  -s, --source \u003ccode\u003e        specify raw source code\n  -f, --file \u003cpath\u003e          specify path to a file\n  -g, --gzip                 show gzipped size\n  -b, --brotli               show brotli size\n  -m, --minify               show minified size | !! Works only with supported language !!\n  -l, --language \u003clanguage\u003e  specifies the language type. Supported: css, sass, scss, js (default: \"css\")\n  -h, --help                 display help for command\n```\n\n## Programmatic Usage \n\nInstall with npm :\n```\n$ npm install --save @xelzs/code-size\n```\n\nGet all sizes : \n```js\nconst {size} = require('code-size');\n\nconst data = size({\n  file: 'test.css',\n  gzip: true,\n  brotli: true,\n  minify: true,\n  language: 'css',\n});\n\nconsole.log(data);\n// {\n//   original: '9.11 KB',\n//   minify: '7.16 KB',\n//   gzip: '140 Bytes',\n//   brotli: '82 Bytes',\n// }\n```\n\n### Options\nAll options availables on command-line are also available here.\n\n- `source` - Raw source code\n- `file` - Path to a file\n- `gzip` - Boolean to enable the gzip estimation\n- `brotli` - Boolean to enable the brotli estimation\n- `minify` - Boolean to enable the minify estimation. **Language option required**\n- `language` - Specify the language type. Supported: `css`, `sass`, `scss`, `js`.\n\n## Changelog\n\nChangelog is accessible in the [CHANGELOG.md](CHANGELOG.md) file or in [the release section](https://github.com/Xelzs/code-size/releases).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxelzs%2Fcode-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxelzs%2Fcode-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxelzs%2Fcode-size/lists"}