badges-ts

@jonloucks/badges-ts

Badges

CI npm version Coverage Badge Typedoc Badge

badges-ts is a TypeScript/Node.js CLI for generating SVG project badges (npm version, coverage, and typedoc) with configurable colors, file paths, and templates.

Installation

npm install @jonloucks/badges-ts

For one-off usage, you can also run with npx.

Quick Start

1) Discover project metadata

npx badges-ts discover

2) Generate badges

npx badges-ts generate --verbose

By default this creates:

3) Apply version artifacts

npx badges-ts apply-version

This updates src/version.ts and creates release notes for the current package version if a release notes file does not already exist.

CLI Commands

Common flags

Configuration

badges-ts supports both environment variables and a project config file (badges-ts.json).

See Configuration Profiles for ready-to-use examples (default, monorepo, and CI-only).

Example:

{
  "kit.badges.folder": "badges",
  "kit.coverage.summary.path": "coverage/coverage-summary.json",
  "kit.coverage.summary.badge.path": "main-coverage.svg",
  "kit.npm.badge.path": "main-npm.svg",
  "kit.typedoc.badge.path": "main-typedoc.svg",
  "kit.template.badge.path": "src/data/badge-template.svg.dat",
  "kit.above.90.percent.color": "#377526",
  "kit.0.percent.color": "#ff0000"
}

The default badge SVG template is custom/original and stored at src/data/badge-template.svg.dat. You can override it with KIT_TEMPLATE_BADGE_PATH:

KIT_TEMPLATE_BADGE_PATH=./my-template.svg npx badges-ts generate

Documentation

Development

npm install
npm run build
npm run test
npm run lint
npm run docs
npm run badges

License

MIT