@daimaozid/bloat
v1.0.1
Published
A CLI tool for checking bloat for websites
Maintainers
Readme
Bloat (Blt) 🥪
Simple Node.js CLI tool to test and display ram usage of websites.
Getting Started
Prerequisites
- Node.js v20+
- npm
- Playwright
Installation Options
1. Use npm (Easiest)
Install the tool globally via npm:
npm install -g @daimaozid/bloatThen install the Playwright browser using:
npx playwright install chromiumNote: If it fails to launch, you may need to install system dependencies with:
npx playwright install-deps chromium
2. Direct installation via git
Install the tool by grabbing the code directly:
git clone https://github.com/daimaozid/Bloat.git
cd bloat
npm install
npm link
npx playwright install chromium --with-depsUsage
You can run the tool with:
bloat or blt
The structure is as follows:
bloat [options] [URLs (https://example.com)]Note: You must include the protocol for it to work.
Example Usage
Ex. format, sorted, headless, output to file,
batching URLs in groups of 10 to avoid fork bombing
bloat -fsh -o output.txt --batch 10 https://google.com https://en.wikipedia.org...
Sample output:
Logged on: Mon Jan 05 2026 16:28:15 GMT-0800 (Pacific Standard Time)
Avg Mem/Word: ~577 KiB/Word
URL List Mem/Word Bloated?
en.wikipedia.org ~4 KiB/Word No
google.com ~210 KiB/Word No
youtube.com ~1 MiB/Word Yes
# of bloated sites: 1
# of good sites: 2Commands
For a full list of options, type:
bloat --helpCommon Options
--version
Show Bloat version
--license
Displays the license for Bloat
--batch
Sets the max number of tabs that can be concurrently opened
Default is 5
WARNING: Setting this too high will fork bomb yourself
If the last line is confusing, it's a good sign that you
shouldn't change this.
-h --headless
Run Bloat in headless mode (no browser window)
-v --verbose
Logs more information and error messages
Useful for debugging how Bloat is running
-o --output
Logs output to a specified file
Ex. bloat --output output.txt
Bloat will write to output.txt, which includes
both the final result and error messages
-f --format
Logs output in human readable format
Also sets default decimal place to 0
Use --decimal to set decimal place explicitly in this mode
-p --pretty
Logs output with colored lines
Only works if stdout and stderr supports colors
Green: Non-bloated sites
Red: Bloated sites / Error
Cyan: Info
DOES NOT corrupt file generated by --output with color codes
-w --wait
Set the max amount of time in ms
Bloat waits for a page to load before measuring memory usage
-s --sort
Sorts the result in ascending order of RAM usageUninstallation
To remove the tool and the browser binary it installed:
- Remove the browser binary:
npx playwright uninstall chromium
If installed with npm:
- Uninstall the tool globally:
npm uninstall -g @daimaozid/bloat
If installed manually with git:
- Unlink Bloat
npm unlink - Delete Bloat folder
cd .. && rm -rf Bloat/
FAQ
Q: Your code SUCKS!!!
A: Not a question. But you have hurt my feelings *sniffle*
Q: Why did you make this?
A: 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.
Q: It's not accurate for [insert site with foreign language]!
A: 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.
Q: Why a metric like memory usage / word?
A: A few reasons why I picked such a metric:
- It's stupid simple to implement the logic.
- I think it's an intuitive metric. If you page uses 10GiB / word, it's probably not that efficient with memory usage.
- 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.
Q: What is a KiB, MiB, GiB, etc?
A: 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.
Q: Will this ever be updated?
A: Probably not. If something breaks, you can
- Use
bloat --blameto vent. - Fork the repo and fix it yourself, but you have to share the src with me per GPLv2.
- Open an issue.
- Shoot me an angry email that I may or may not see.
Q: Why do I have to install Chromium separately?
A: Bloat does not come with browser to keep the package small (in other words, non-bloated).
Q: Is my data safe?
A: 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.
Q: OK, I read your code. Why is your code littered with global variables?
A: 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.
Q: It's running slow, what gives?
A: Many confounding factors. Internet connection speed is the obvious culprit. But it could also be due to:
- Bad code from my part. Sorry.
- Your setting for --batch is too low. Try setting it higher if your machine can handle more tabs concurrently opening.
- 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.
Q: Your grammar is bad.
A: Yesn't.
Contributors
License
This project is licensed under the GNU General Public License v2.0 or later - see the LICENSE file for details.
Acknowledgments
- README.md template by PurpleBooth
- Playwright for the browser automation engine
