{"_id":"@daimaozid/bloat","_rev":"2-05071a9f5b72b13d6df4f73f204ffa5b","name":"@daimaozid/bloat","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@daimaozid/bloat","version":"1.0.0","author":{"name":"Hongji Dai"},"license":"GPL-2.0-or-later","_id":"@daimaozid/bloat@1.0.0","maintainers":[{"name":"daimaozid","email":"daimaozid@gmail.com"}],"homepage":"https://github.com/daimaozid/Bloat#readme","bugs":{"url":"https://github.com/daimaozid/Bloat/issues"},"bin":{"blt":"bin/bloat.mjs","bloat":"bin/bloat.mjs"},"url":"https://github.com/daimaozid","dist":{"shasum":"768d9ae37f213478a02624b2f2f5a94cbe7a8a0e","tarball":"https://registry.npmjs.org/@daimaozid/bloat/-/bloat-1.0.0.tgz","fileCount":4,"integrity":"sha512-NIodGjeKrwFD7feMPau+v0Y09lkcrDJiHX9tCNh8xDovfyPPFWiLQkEu8ZkEST/Hnv67YnBxgZ/cL/3mIxc1JA==","signatures":[{"sig":"MEYCIQDgHDufqpZyq5TsGr1T7UkUphVQEPtT2qYati6hpi89pAIhAPQXa4sGWgIbQgSY6Mg1S0rYZfTpAUqDDcffq1a0DIoQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45095},"main":"bloat.mjs","type":"module","email":"daimaozid@gmail.com","engines":{"node":">=20.0.0"},"gitHead":"ebd637e034ed298ed890ea61317b65bc7fee5302","_npmUser":{"name":"daimaozid","email":"daimaozid@gmail.com"},"repository":{"url":"git+https://github.com/daimaozid/Bloat.git","type":"git"},"_npmVersion":"11.6.2","description":"A CLI tool for checking bloat for websites","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@playwright/test":"^1.57.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.39.2","globals":"^16.5.0","@eslint/js":"^9.39.2","@types/node":"^25.0.3"},"_npmOperationalInternal":{"tmp":"tmp/bloat_1.0.0_1767661857541_0.7673816580040946","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@daimaozid/bloat","version":"1.0.1","description":"A CLI tool for checking bloat for websites","main":"bloat.mjs","bin":{"bloat":"bin/bloat.mjs","blt":"bin/bloat.mjs"},"author":{"name":"Hongji Dai"},"email":"daimaozid@gmail.com","url":"https://github.com/daimaozid","license":"GPL-2.0-or-later","type":"module","repository":{"type":"git","url":"git+https://github.com/daimaozid/Bloat.git"},"engines":{"node":">=20.0.0"},"dependencies":{"@playwright/test":"^1.57.0"},"devDependencies":{"@eslint/js":"^9.39.2","@types/node":"^25.0.3","eslint":"^9.39.2","globals":"^16.5.0"},"keywords":["bloat","bloat-detector","size-analyzer","dependency-cleaner","bundle-size","node-modules","cli","optimization","lightweight","performance"],"gitHead":"06d3fc78bf3e88b7b820f086e9669ec15cdf4cd9","_id":"@daimaozid/bloat@1.0.1","bugs":{"url":"https://github.com/daimaozid/Bloat/issues"},"homepage":"https://github.com/daimaozid/Bloat#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-otguYzhWrvTQxDMVWLY20LvnSM5cAK0N59R8eS9+3nxuUgGvY8+Qt7ejsl/SY/qU4SAAlHBYU5nNgN7vnnZj4g==","shasum":"1041a4023945b08d0b39619d930fe0fe8b67d6e7","tarball":"https://registry.npmjs.org/@daimaozid/bloat/-/bloat-1.0.1.tgz","fileCount":4,"unpackedSize":48830,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDoDP7XWEeLUZ+p9TDQ5Ith+PNoPj40eIVTr4zhXMOtZgIhAKdIl9B66uX2taodmnuZEoT9P/3xF5YyP1yQqExSthpb"}]},"_npmUser":{"name":"daimaozid","email":"daimaozid@gmail.com"},"directories":{},"maintainers":[{"name":"daimaozid","email":"daimaozid@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bloat_1.0.1_1767665790889_0.8533341053692691"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-06T01:10:57.401Z","modified":"2026-01-06T02:16:31.269Z","1.0.0":"2026-01-06T01:10:57.695Z","1.0.1":"2026-01-06T02:16:31.057Z"},"bugs":{"url":"https://github.com/daimaozid/Bloat/issues"},"author":{"name":"Hongji Dai"},"license":"GPL-2.0-or-later","homepage":"https://github.com/daimaozid/Bloat#readme","repository":{"type":"git","url":"git+https://github.com/daimaozid/Bloat.git"},"description":"A CLI tool for checking bloat for websites","maintainers":[{"name":"daimaozid","email":"daimaozid@gmail.com"}],"readme":"# Bloat (Blt) 🥪\n\nSimple Node.js CLI tool to test and display ram usage of websites.\n\n[![License: GPL v2](https://img.shields.io/badge/License-GPL_v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)\n\n## Getting Started\n\n### Prerequisites\n\n* Node.js **v20+**\n* npm\n* Playwright\n\n### Installation Options\n\n#### 1. Use npm (Easiest)\n\nInstall the tool globally via **npm**:\n```bash\nnpm install -g @daimaozid/bloat\n```\nThen install the Playwright browser using:\n```bash\nnpx playwright install chromium\n```\n\n>Note: If it fails to launch, you may need to install system dependencies with:  \n>```npx playwright install-deps chromium```\n\n#### 2. Direct installation via git\n\nInstall the tool by grabbing the code directly:\n```bash\ngit clone https://github.com/daimaozid/Bloat.git\ncd bloat\nnpm install\nnpm link\nnpx playwright install chromium --with-deps\n```\n\n### Usage\n\nYou can run the tool with:\n```bloat``` or ```blt```\n\nThe structure is as follows:\n```\nbloat [options] [URLs (https://example.com)]\n```\n>Note: You must include the protocol for it to work.\n\n#### Example Usage\n\n```\nEx. format, sorted, headless, output to file,\n    batching URLs in groups of 10 to avoid fork bombing\n\nbloat -fsh -o output.txt --batch 10 https://google.com https://en.wikipedia.org... \n\nSample output:\nLogged on: Mon Jan 05 2026 16:28:15 GMT-0800 (Pacific Standard Time)\nAvg Mem/Word: ~577 KiB/Word\nURL List                        Mem/Word        Bloated?\nen.wikipedia.org                ~4 KiB/Word     No      \ngoogle.com                      ~210 KiB/Word   No      \nyoutube.com                     ~1 MiB/Word     Yes     \n# of bloated sites: 1\n# of good sites: 2\n```\n\n## Commands\nFor a full list of options, type:\n```bash\nbloat --help\n```\n\n### Common Options\n\n```\n--version\n    Show Bloat version\n--license\n    Displays the license for Bloat\n--batch\n    Sets the max number of tabs that can be concurrently opened\n    Default is 5\n    WARNING: Setting this too high will fork bomb yourself\n    If the last line is confusing, it's a good sign that you\n    shouldn't change this.\n-h --headless\n    Run Bloat in headless mode (no browser window)\n-v --verbose\n    Logs more information and error messages\n    Useful for debugging how Bloat is running\n-o --output\n    Logs output to a specified file\n    Ex. bloat --output output.txt\n    Bloat will write to output.txt, which includes\n    both the final result and error messages\n-f --format\n    Logs output in human readable format\n    Also sets default decimal place to 0\n    Use --decimal to set decimal place explicitly in this mode\n-p --pretty\n    Logs output with colored lines\n    Only works if stdout and stderr supports colors\n    Green: Non-bloated sites\n    Red: Bloated sites / Error\n    Cyan: Info\n    DOES NOT corrupt file generated by --output with color codes\n-w --wait\n    Set the max amount of time in ms\n    Bloat waits for a page to load before measuring memory usage\n-s --sort\n    Sorts the result in ascending order of RAM usage\n```\n\n## Uninstallation\n\nTo remove the tool and the browser binary it installed:\n\n1. Remove the browser binary:\n    ```bash\n    npx playwright uninstall chromium\n    ```\n\n#### If installed with npm:\n2. Uninstall the tool globally:\n    ```bash\n    npm uninstall -g @daimaozid/bloat\n    ```\n\n#### If installed manually with git:\n2. Unlink Bloat\n    ```bash\n    npm unlink\n    ```\n3. Delete Bloat folder\n    ```bash\n    cd .. && rm -rf Bloat/\n    ```\n\n## FAQ\n\n#### Q: Your code *SUCKS!!!*\nA: Not a question. But you have hurt my feelings \\*sniffle\\*\n\n#### Q: Why did you make this?\nA: The funny answer is because blt is a funny acronym. The serious answer is that I just find it interesting to see RAM usage of websites and figure out which ones run best on my potato.\n\n#### Q: It's not accurate for [insert site with foreign language]!\nA: It's likely because the word counter regex used only considers characters seperated by space as \"words.\" Which unfortunately means it will not parse languages like Chinese or Japanese with no spaces between characters correctly. I may or may not fix this in the future and add an option to address this.\n\n#### Q: Why a metric like memory usage / word?\nA: A few reasons why I picked such a metric:\n1. It's stupid simple to implement the logic.\n2. I think it's an intuitive metric. If you page uses 10GiB / word, it's probably not that efficient with memory usage.\n3. It requires the least amount of \"opinion\" from the tool. Most people can agree on what a \"word\" is in English instinctively. It's a lot harder to design a *consistent* tool that needs to decide if it should include \\<img\\> or \\<iframe\\> as something it should consider depending on the site.\n\n#### Q: What is a KiB, MiB, GiB, etc?\nA: It's the units for memory that is actually based in binary. 1 KiB = 1024 bytes. Units like KB and MB and GB technically only refer to base 10. 1 KB = 1000 bytes exactly. Incredibly pedantic, I know.\n\n#### Q: Will this ever be updated?\nA: Probably not. If something breaks, you can\n1. Use ```bloat --blame``` to vent.\n2. Fork the repo and fix it yourself, but you have to share the src with me per GPLv2.\n3. Open an issue.\n4. Shoot me an angry email that I may or may not see.\n\n#### Q: Why do I have to install Chromium separately?\nA: Bloat does not come with browser to keep the package small (in other words, non-bloated).\n\n#### Q: Is my data safe?\nA: Yes. Everything runs locally on your machine in an isolated browser instance. And you don't have to trust my word. Read through the src.\n\n#### Q: OK, I read your code. Why is your code littered with global variables?\nA: It's makes coding easier and in a short script like this that will likely never be updated, it actually helps with readability. Writing everything with something like ```config.isVerbose``` would just boilerplate for my functions. IMHO.\n\n#### Q: It's running slow, what gives?\nA: Many confounding factors. Internet connection speed is the obvious culprit. But it could also be due to:\n1. Bad code from my part. Sorry.\n2. Your setting for --batch is too low. Try setting it higher if your machine can handle more tabs concurrently opening.\n3. The website is simply heavy and takes a long time to load. Try adjusting --wait to set a timeout that works for you. Use --verbose for extra logs in debugging.\n\n#### Q: Your grammar is bad.\nA: Yesn't.\n\n## Contributors\n* **Hongji Dai** - *Author* - [GitHub](https://github.com/daimaozid) \n* **Michael Hum** - *Testing* - [GitHub](https://github.com/mhum633)\n\n## License\n\nThis project is licensed under the **GNU General Public License v2.0 or later** - see the [LICENSE](https://github.com/daimaozid/Bloat/blob/main/LICENSE) file for details.\n\n## Acknowledgments\n\n* README.md template by [PurpleBooth](https://github.com/PurpleBooth)\n* Playwright for the browser automation engine\n","readmeFilename":"README.md","keywords":["bloat","bloat-detector","size-analyzer","dependency-cleaner","bundle-size","node-modules","cli","optimization","lightweight","performance"]}