Registry / devops / build-stats

build-stats

JSON →
library1.8.0jsnpmunverified

A CLI tool that fetches and analyzes build pipeline history from Travis CI or Bitbucket Pipelines. Current stable version is 1.8.0. It offers commands to download, calculate averages, display history, and show success/failure stats. Designed for continuous integration environments, it supports private repositories via auth tokens, branch filtering, and customizable time periods. The tool caches data locally to avoid repeated API calls.

npm install build-stats
INSTALL
IMPORT
SIG · BUILD-STATS
B
build-stats
devopsjavascriptv1.8.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Install and run build-stats CLI to download and calculate build statistics for a Travis CI repository.

yarn global add build-stats build-stats travis:boltpkg/bolt download --auth $TRAVIS_TOKEN build-stats travis:boltpkg/bolt calculate --period 7 --last 90
build-stats --version
Debug
Known issues
gotchaThe --auth flag is required for private repos but optional for public; missing token on private repo causes authentication errors.
fix
Provide a valid authentication token using --auth <token>.
affects: *
gotchaThe --period flag defaults to 1 day, which may produce noisy data for repos with many builds.
fix
Use a larger period like 7 or 30 for smoother trends.
affects: *
gotchaThe --last flag defaults to 30 periods; if period is 1 day, it fetches only the last 30 days. Combine with --period for longer timeframes.
fix
Set --last to the total number of periods (e.g., --period 30 --last 12 for 1 year).
affects: *
gotchaThe download command saves data to a .data folder in the current working directory; not running from the expected directory may cause confusion.
fix
Run build-stats from the directory where you want the .data cache folder.
affects: *
gotchaBitbucket Pipelines support requires additional setup compared to Travis CI; auth token generation differs.
fix
Refer to GENERATING_AUTH_TOKENS.md for Bitbucket token instructions.
affects: >=1.6.0
Errors
Common errors & fixes
Error: Authentication failed. Please provide a valid token.
Missing or invalid --auth token for a private repository.
fix
Use --auth with a valid token (see GENERATING_AUTH_TOKENS.md).
Error: Cannot download history. Repo not found.
Incorrect repository specifier format (service:user/repo).
fix
Use format like travis:owner/repo or bitbucket:owner/repo.
Error: Cache directory not writable.
Insufficient permissions to create .data folder in current directory.
fix
Run from a directory with write permissions or change directory.
Upgrade
Version history
1.8.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources
build-stats — npm install build-stats · libregistry