Install

Install StyleStats

StyleStats is a Node.js package. It runs on macOS, Linux, and Windows wherever a recent Node runtime is available.

Requirements

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, -tOutput format: json, html, md, or csv.
--config, -cPath to a config file controlling which metrics are reported.
--ua, -uUser-agent string when fetching a remote URL.
--help, -hPrint 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.