Install
Install StyleStats
StyleStats is a Node.js package. It runs on macOS, Linux, and Windows wherever a recent Node runtime is available.
Requirements
- Node.js 18.x or newer (LTS recommended).
- npm 9+ or any compatible package manager (pnpm, yarn, bun).
- A target document — an HTML page URL, a local CSS file, or a glob.
Install the CLI
$ npm install -g stylestats Installs a global stylestats binary on your PATH.
Install as a project dependency
$ npm install --save-dev stylestats Use this when you want StyleStats to run as part of your CI pipeline against the project's compiled stylesheet.
First run
$ stylestats https://example.com
$ stylestats path/to/file.css
$ stylestats "src/**/*.css" --type json > report.json Common flags
| Flag | Description |
|---|---|
| --type, -t | Output format: json, html, md, or csv. |
| --config, -c | Path to a config file controlling which metrics are reported. |
| --ua, -u | User-agent string when fetching a remote URL. |
| --help, -h | Print usage and exit. |
Next steps
Once you've got a report on the screen, head over to the docs for a tour of every metric and how to read it. Or browse sample results to compare your numbers to popular sites.