{"id":13633786,"url":"https://github.com/codechecks/build-size-watcher","last_synced_at":"2025-04-18T14:33:12.955Z","repository":{"id":57102986,"uuid":"165534249","full_name":"codechecks/build-size-watcher","owner":"codechecks","description":"Keep your bundle size in check and detect when it gets too big.","archived":false,"fork":false,"pushed_at":"2021-11-28T07:16:58.000Z","size":752,"stargazers_count":17,"open_issues_count":5,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T03:28:13.747Z","etag":null,"topics":["build","build-size","codecheck","size","watcher"],"latest_commit_sha":null,"homepage":"https://codechecks.io","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/codechecks.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":"2019-01-13T17:33:08.000Z","updated_at":"2023-06-15T08:20:21.000Z","dependencies_parsed_at":"2022-08-20T23:20:34.179Z","dependency_job_id":null,"html_url":"https://github.com/codechecks/build-size-watcher","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codechecks%2Fbuild-size-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codechecks%2Fbuild-size-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codechecks%2Fbuild-size-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codechecks%2Fbuild-size-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codechecks","download_url":"https://codeload.github.com/codechecks/build-size-watcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249505465,"owners_count":21282882,"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":["build","build-size","codecheck","size","watcher"],"created_at":"2024-08-01T23:00:51.706Z","updated_at":"2025-04-18T14:33:12.688Z","avatar_url":"https://github.com/codechecks.png","language":"TypeScript","funding_links":[],"categories":["Frontend development"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./meta/check.png\" width=\"700\" alt=\"codechecks.io\"\u003e\n  \u003ch3 align=\"center\"\u003eBuild Size Watcher\u003c/h3\u003e\n  \u003cp align=\"center\"\u003eKeep your build size in check and detect when it gets too big\u003c/p\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://circleci.com/gh/codechecks/build-size-watcher\"\u003e\u003cimg alt=\"Build Status\" src=\"https://circleci.com/gh/codechecks/build-size-watcher/tree/master.svg?style=svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"/package.json\"\u003e\u003cimg alt=\"Software License\" src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## Install\n\n```sh\nnpm add --save-dev @codechecks/build-size-watcher\n```\n\nor\n\n```sh\nyarn add --dev @codechecks/build-size-watcher\n```\n\n## Usage\n\nAdd to your `codechecks.yml` file:\n\n```yml\nchecks:\n  - name: build-size-watcher\n    options:\n      files:\n        - path: \"./build/static/js/*.js\"\n          maxSize: 1MB\n        - path: \"./build/static/css/*.css\"\n        - path: \"./build/static/images/*.jpg\"\n  # ...\n```\n\nWith each pull request you will get a summary like `Change +3 KB(+1%) Total 300KB` and detailed size\nbreakdown for each path in check's details.\n\n## API\n\n### buildSizeWatcher(options: BuildSizeWatcherOptions): Promise\\\u003cvoid\u003e\n\n#### BuildSizeWatcherOptions\n\n```typescript\ninterface BuildSizeWatcherOptions {\n  gzip?: boolean; // defaults to true\n  files: {\n    path: string; // supports globs\n    maxSize?: number | string;\n  }[];\n  name?: string; // defaults to \"Build Size\"\n}\n```\n\n##### gzip\n\noptional `boolean`\u003cbr\u003e\\\nDefault: `true`\u003cbr\u003e\\\nSpecify if files should be gzipped before size calculation\n\n##### files\n\n```typescript\ninterface FileDescription {\n  path: string; // supports glob\n  maxSize?: number | string;\n}\n```\n\nList of files to track.\n\n###### files.path\n\n`string`\u003cbr\u003e\\\nPath specifying files to bundle together while calculating size. Supports globs. It's great when you\nhave to deal with checksums in file names: ex. `\"./build/static/js/*.js\"`\n\n###### files.maxSize\n\noptional `number|string`\u003cbr\u003e\\\nProvide the maximum size of all files matched by `files.path`. It can be a number in bytes or a string\nlike \"1KB\" or \"1MB\". When max size is reached the whole check will report failure.\n\n##### name\n\noptional `string`\u003cbr\u003e\\\nDefault: `Build Size`\u003cbr\u003e\\\nSpecify the name for check. Might be useful when you track multiple builds for example in monorepo.\n\n## Contributing\n\nAll contributions are welcomed. Read more in [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n## Licence\n\nMIT @ [codechecks.io](https://codechecks.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodechecks%2Fbuild-size-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodechecks%2Fbuild-size-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodechecks%2Fbuild-size-watcher/lists"}