{"id":42117,"library":"treeshake-cli","title":"treeshake-cli","description":"treeshake-cli is a command-line tool that analyzes JavaScript bundles to determine how effectively Rollup, Webpack, and ESBuild tree-shake unused code. Version 0.2.6 is stable with monthly releases. It provides a unified interface to run multiple bundlers on the same input and compare outputs, highlighting dead code elimination differences. Unlike manual bundler configuration, it offers an out-of-the-box comparison with clear metrics.","status":"active","version":"0.2.6","language":"javascript","source_language":"en","source_url":"https://github.com/CodyJasonBennett/treeshake-cli","tags":["javascript","rollup","webpack","esbuild","bundlers","modules","esm","treeshaking"],"install":[{"cmd":"npm install treeshake-cli","lang":"bash","label":"npm"},{"cmd":"yarn add treeshake-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add treeshake-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Bundler used for tree-shaking analysis","package":"rollup","optional":true},{"reason":"Bundler used for tree-shaking analysis","package":"webpack","optional":true},{"reason":"Bundler used for tree-shaking analysis","package":"esbuild","optional":true}],"imports":[{"note":"CLI tool, not imported in code; run via npx or global install.","symbol":"treeshake-cli","correct":"npx treeshake-cli@latest <file>"}],"quickstart":{"code":"npx treeshake-cli@latest bundle.js\n# or install globally:\nnpm install -g treeshake-cli\ntreeshake-cli bundle.js","lang":"javascript","description":"Analyzes bundle.js for tree-shaking efficiency using Rollup, Webpack, and ESBuild."},"warnings":[{"fix":"Update Node.js to 12+ or use npx which manages version automatically.","message":"The tool requires Node.js 12+ and may not work with older versions.","severity":"gotcha","affected_versions":"<0.2.0"},{"fix":"Convert CommonJS to ESM or use a different tool for CJS analysis.","message":"Only JavaScript/ES module inputs supported; CommonJS inputs are not analyzed.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure input is a bundled output (not raw source code).","message":"The file must be a valid ES module bundle; non-bundle files may produce misleading results.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.2.6':31 'analyz':14 'box':69 'bundl':16 'bundler':45,60,78 'clear':72 'cli':3,6 'code':29,55 'command':10 'command-lin':9 'compar':51 'comparison':70 'configur':61 'dead':54 'determin':18 'differ':57 'effect':20 'elimin':56 'esbuild':24,77 'esm':80 'highlight':53 'input':49 'interfac':41 'javascript':15,74 'line':11 'manual':59 'metric':73 'modul':79 'month':35 'multipl':44 'offer':63 'out-of-the-box':65 'output':52 'provid':38 'releas':36 'rollup':21,75 'run':43 'shake':27 'stabl':33 'tool':12 'tree':26 'tree-shak':25 'treeshak':2,5,81 'treeshake-c':1,4 'unifi':40 'unlik':58 'unus':28 'version':30 'webpack':22,76","created_at":"2026-06-04T18:55:42.319460+00:00","updated_at":"2026-06-04T18:55:42.319460+00:00","problems":[{"fix":"Install rollup: npm install rollup -D","cause":"Rollup is not installed or not found in node_modules.","error":"Error: Cannot find module 'rollup'"},{"fix":"Provide a .js or .mjs file that is an ES module bundle.","cause":"The input file is not recognized as JavaScript (e.g., .ts or .json).","error":"Error: Expected a JavaScript file"},{"fix":"Ensure the input bundle is an ES module (use import/export) or transpile to ESM.","cause":"The input bundle uses CommonJS syntax (require, module.exports).","error":"Error: Bundle must be an ES module"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/CodyJasonBennett/treeshake-cli","github":"https://github.com/CodyJasonBennett/treeshake-cli","docs":null,"changelog":null,"pypi":null,"npm":"treeshake-cli","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}