{"id":29275872,"url":"https://github.com/peterroe/count-webpack-plugin","last_synced_at":"2025-07-05T07:11:27.841Z","repository":{"id":43071541,"uuid":"456228299","full_name":"peterroe/count-webpack-plugin","owner":"peterroe","description":"Count the number of chars in file.","archived":false,"fork":false,"pushed_at":"2023-12-15T14:40:37.000Z","size":12,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-12-15T15:53:17.533Z","etag":null,"topics":["plugin","webpack"],"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/peterroe.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}},"created_at":"2022-02-06T17:56:13.000Z","updated_at":"2023-12-15T15:53:17.534Z","dependencies_parsed_at":"2022-08-22T20:50:45.256Z","dependency_job_id":null,"html_url":"https://github.com/peterroe/count-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/peterroe/count-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterroe%2Fcount-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterroe%2Fcount-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterroe%2Fcount-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterroe%2Fcount-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterroe","download_url":"https://codeload.github.com/peterroe/count-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterroe%2Fcount-webpack-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263699785,"owners_count":23497963,"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":["plugin","webpack"],"created_at":"2025-07-05T07:11:23.278Z","updated_at":"2025-07-05T07:11:27.832Z","avatar_url":"https://github.com/peterroe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## What is it?\n\nA example of plugin of [`webpack`](https://webpack.js.org), and it's used to count the number of chars in file.\n\n## Core Code \n\n```js\nclass CountWebpackPlugin {\n  apply(compiler) {\n    compiler.hooks.emit.tap('CountWebpackPlugin', (\n      compilation\n    ) =\u003e {\n      let str = ''\n      for (let filename in compilation.assets) {\n        const { _value } = compilation.assets[filename]\n        str += `Number of chars in \\`${filename}\\`: \\`${_value.length}\\` \\n`\n      }\n      //write file\n      compilation.assets['fileSize.md'] = {\n        source() {\n          return str\n        }\n      }\n    })\n  }\n}\n\nmodule.exports = CountWebpackPlugin;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterroe%2Fcount-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterroe%2Fcount-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterroe%2Fcount-webpack-plugin/lists"}