{"id":47705165,"url":"https://github.com/adventure-yunfei/package-size-analyzer","last_synced_at":"2026-04-02T17:53:36.513Z","repository":{"id":57317745,"uuid":"60603540","full_name":"adventure-yunfei/package-size-analyzer","owner":"adventure-yunfei","description":"Size analyzer for npm package, webpack bundle ...","archived":false,"fork":false,"pushed_at":"2017-08-15T06:33:43.000Z","size":878,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T21:43:23.620Z","etag":null,"topics":["file-size","size-analyzer","webpack"],"latest_commit_sha":null,"homepage":null,"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/adventure-yunfei.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":"2016-06-07T10:11:19.000Z","updated_at":"2024-06-12T17:39:33.000Z","dependencies_parsed_at":"2022-08-25T21:12:10.688Z","dependency_job_id":null,"html_url":"https://github.com/adventure-yunfei/package-size-analyzer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/adventure-yunfei/package-size-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adventure-yunfei%2Fpackage-size-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adventure-yunfei%2Fpackage-size-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adventure-yunfei%2Fpackage-size-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adventure-yunfei%2Fpackage-size-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adventure-yunfei","download_url":"https://codeload.github.com/adventure-yunfei/package-size-analyzer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adventure-yunfei%2Fpackage-size-analyzer/sbom","scorecard":{"id":168496,"data":{"date":"2025-08-11","repo":{"name":"github.com/adventure-yunfei/package-size-analyzer","commit":"b64ef7103dcdb7a4e5eca4850181f486b1331af5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T15:40:25.269Z","repository_id":57317745,"created_at":"2025-08-16T15:40:25.270Z","updated_at":"2025-08-16T15:40:25.270Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31312744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["file-size","size-analyzer","webpack"],"created_at":"2026-04-02T17:53:35.814Z","updated_at":"2026-04-02T17:53:36.505Z","avatar_url":"https://github.com/adventure-yunfei.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# package-size-analyzer\nSize analyzer for npm package, webpack bundle ...\n\nA handy tool inspired by [webpack-bundle-size-analyzer](https://github.com/robertknight/webpack-bundle-size-analyzer).\n\nWhile webpack itself provide [analyse tool](http://webpack.github.com/analyse), it's really hard to use.\n\nThis package-size-analyzer tool produce something like following:\n\n```\n__ALL__: 744.25 KB\n  \u003cself\u003e: 14.9 KB\n  fbjs: 32.32 KB\n    \u003cself\u003e: 32.32 KB\n  object-assign: 896 B\n    \u003cself\u003e: 896 B\n  react: 581.8 KB\n    \u003cself\u003e: 581.8 KB\n  assert: 11.43 KB\n    \u003cself\u003e: 11.43 KB\n  almin: 56.31 KB\n    \u003cself\u003e: 54.36 KB\n    object-assign: 1.95 KB\n      \u003cself\u003e: 1.95 KB\n  lru-cache: 10.85 KB\n    \u003cself\u003e: 10.85 KB\n  process: 2.01 KB\n    \u003cself\u003e: 2.01 KB\n  util: 15.4 KB\n    \u003cself\u003e: 15.4 KB\n  events: 8 KB\n    \u003cself\u003e: 8 KB\n  inherits: 672 B\n    \u003cself\u003e: 672 B\n  pseudomap: 2.65 KB\n    \u003cself\u003e: 2.65 KB\n  react-dom: 63 B\n    \u003cself\u003e: 63 B\n  yallist: 6.99 KB\n    \u003cself\u003e: 6.99 KB\n```\n\nIt's capable to:\n\n- Analyze for almost any npm packages\n- Analyze for your own project built with webpack\n- Customize package group rulee, so you can:\n  - correct package for vendor files inside your own code base (e.g. group `\"src/vendor/react.js\"` to `\"react\"` package)\n  - separate size groups for your own code (e.g. group `\"src/client/*.js\"` to `\"client\"`)\n\n\n# Install \u0026 Usage\n\n- Install globally by `npm install package-size-analyzer -g`\n- Run `package-size-analyzer` to see usage:\n  - Usage: `package-size-analyzer entry_1 entry_2 ... [options]`\n  - `entry_1 entry_2 ...` could be package name (e.g. \"react\", \"lodash/forEach\"), local file (e.g. \"./src/foo.js\"), anything that used by `require(...)`\n\n### Example Usages:\n\n- `package-size-analyzer lodash`: check lodash size\n- `package-size-analyzer lodash vue -m`: check both lodash and vue minimized size\n- `package-size-analyzer lodash/assign lodash/forEach`: check parts of lodash(@4) size\n- `package-size-analyzer fs-extra --node`: check **node-side** fs-extra package size\n- `package-size-analyzer --webpack-config webpack.config.js`: analyze for your own webpack-building project\n- `package-size-analyzer --stat-json webpack-stat.json`: analyze for your own prebuilt webpack stats json\n\n# Options\n\n- `--minify (-m)` Analyze for minified size\n- `--node` Analyze for **node side** files (like \"yargs\", \"fs-extra\" which may require node.js specific modules like \"path\", \"child_process\", \"fs\")\n- `--webpack-config (-c) \u003cfilepath\u003e` Directly specify webpack config to build and analyze\n- `--stat-json (-j) \u003cfilepath\u003e` Directly specify pre-built webpack stat json file instead of entry files to analyze (stat json may be produced by `webpack --json`, see [webpack](http://webpack.github.io/docs/cli.html#json) doc)\n\n### Advanced options: `package-map`\n\n`package-map` options let you to customize which package a specific file belongs to (**by testing file absolute path**).\n\n- `--package-map-file \u003cfilepath\u003e` Specify a custom package rules js file, which exports:\n  - a map as: `{ \u003cpackage_name\u003e: \u003cfilepath_tester_or_re\u003e }`\n  - or an array as `[ [\u003cpackage_name\u003e, \u003cfilepath_tester_or_re\u003e], ... ]`\n- `--package-map \u003crule\u003e \u003crule\u003e ...` CLI inline rules. Each rule format: `\u003cpackage_name\u003e:\u003cfilepath_regexp\u003e`. (It's parsed directly by `new RegExp(...)`. **Be careful** with backslash `\\` escape in cli)\n\n**NOTE:**\n  - You should take care of path differences between windows and linux (`\"C:\\a\\b\\c\"` and `\"/c/a/b/c\"`)\n  - Only the first matched rule is picked. Matching order: first try cli inline rules, then try rules in file.\n\nWhy need to customize package name that a file belongs to? Well, if you just use the tool to analyze npm packages, you don't need this. But if you want to analyze for your own project (with option `--webpack-config` or `--stat-json`), it's useful when you put some vendor codes somewhere else outsite `node_modules` (in which case their package names cannot be extracted correctly). And it's giving possibility to split size for your own codes.\n\n**Example Usages:** Suppose we have following file structure:\n\n```\n--root\n  --vendor\n    -- react.js\n    -- react.min.js\n    -- rxjs.js\n  -- client\n    -- main.js\n  -- server\n    -- main.js\n```\n\nNow we need to group `\"vendor/react*.js\"` to `\"react\"` package, group `\"vendor/rxjs.js\"` to `\"rxjs\"` package; and we want to analyze sizes for client and server seperately.\n\n```javascript\n// Example usage of \"--package-map-file\"\n// $bash: package-size-analyzer -c webpack.config.js --package-map-file pkg-map.js\n\n// pkg-map.js\n// preferred exporting array (order preserved)\nmodule.exports = [\n    // Define rule with regular expression\n    [ 'react', /vendor[/\\\\]react(\\.min)?\\.js/],\n    \n    // Define rule with func\n    [ 'rxjs', function (moduleAbsPath) {\n        return moduleAbsPath.endsWith('rxjs.js')\n    } ],\n\n    // Define rule to seperate client and server codes\n    [ 'client', /client/ ],\n    [ 'server', /server/ ]\n];\n// or just a map (order careless)\nmodule.exports = {\n    react: /vendor[/\\\\]react(\\.min)?\\.js/,\n    rxjs: function (moduleAbsPath) {\n        return moduleAbsPath.endsWith('rxjs.js')\n    },\n    client: /client/,\n    server: /server/\n};\n\n// Equivalent example usage of \"--package-map\"\n// $bash: ... --package-map react:vendor[/\\\\\\\\]react(\\\\.min)?\\\\.js rxjs:rxjs\\\\.js$ client:client server:server\n\n// You can also combine them together\n```\n\nProduce result like:\n\n```\n__ALL__: 407.36 KB\n  \u003cself\u003e: 0 KB\n  react: 144.36 KB\n    \u003cself\u003e: 144.36 KB\n  rxjs: 137.5 KB\n    \u003cself\u003e: 137.5 KB\n  client: 102.2 KB\n    \u003cself\u003e: 102.2 KB\n  server: 23.3 KB\n    \u003cself\u003e: 23.3 KB\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadventure-yunfei%2Fpackage-size-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadventure-yunfei%2Fpackage-size-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadventure-yunfei%2Fpackage-size-analyzer/lists"}