CLI tool for calculating size of files on disk. Can optionally display sizes after gzip and brotli.
npm install -g tiny-file-size
# or
yarn add -g tiny-file-size
# or
pnpm add -g tiny-file-size
file-size --gzip --brotli foo.js README.md example.json
You can run file-size --help
to get a help message:
Usage:
file-size [options] [globs...]
Options:
-h, --help Show help
-g, --gzip Include gzip size in output
-b, --brotli Include brotli size in output
--total Include total size in output
--json Print result as json
-v, --version Print the current version and exit
Examples:
# Show sizes of files foo.js and bar.json
file-size foo.js bar.json
# Include sizes after gzip and brotli
file-size --gzip --brotli foo.js bar.json
# Print output as JSON
file-size --json foo.js bar.json