web-speed-cli
v1.0.1
Published
A CLI tool to test device system performance like RAM, CPU count, etc.
Readme
Web Speed CLI
A small Node.js CLI to measure basic HTTP response time for one or more websites.
- Main script: webspeed.js (contains the
pingfunction) - Alternative duplicate file: webSpeed.js
- Package metadata / bin entry: package.json
Installation
Install globally via npm:
npm install -g webspeedClone the repo and install (or link) locally:
git clone https://github.com/MuhammadRamshad/web-speed-cli.git
cd web-speed-cli
npm install
# make the `webspeed` command available globally for testing
npm linkOr run directly with Node:
node webspeed.js example.comWhen installed via npm link or published as a package, run:
webspeed example.com google.comUsage
The CLI accepts one or more websites as arguments:
# Test multiple websites
webspeed google.com facebook.com
# Or run directly via Node
node webspeed.js https://example.com
# Or use npx without installing globally
npx webspeed google.comExample output:
- "Testing connection to example.com"
- "Connected to example.com"
- "Response status: 200"
- "Response time: 150ms"
How it works
The CLI measures elapsed time between issuing an HTTP GET and receiving the response using the ping function in webspeed.js. It uses Node's built-in http module and a 3000ms timeout per request.
Notes
- The script currently forces
http://in requests. For HTTPS sites, either pass a hostname that supports HTTP or extend the script to support HTTPS. - The project uses the
webspeedbin defined in package.json.
License
MIT
