https://github.com/collaborne/github-badges
https://github.com/collaborne/github-badges
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/collaborne/github-badges
- Owner: Collaborne
- Created: 2022-12-30T13:15:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-13T11:13:51.000Z (almost 2 years ago)
- Last Synced: 2025-03-21T22:38:51.208Z (2 months ago)
- Language: TypeScript
- Size: 281 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @collaborne/github-badges
Create SVG badges
## Install
```bash
npm install --save @collaborne/github-badges
```## Usage
- import in JS/TS files
```ts
import { createCoverageBadge } from '@collaborne/github-badges'// Using default params
createCoverageBadge();// Using different input path for coverage summary:
const inputPath= path.resolve(__dirname, 'my-other-folder', 'coverage-summary.json');// Using different output file path for coverage badge:
const outputPath = path.resolve(__dirname,'my-other-folder', 'coverage', 'coverage-summary.json');// Creating coverage badge SVG's(get summary from inputPath, and saved SVG's in the output path)
createCoverageBadge(inputPath, outputPath)```
- as a script in **package.json**
```json
...scripts :{
...
"predeploy:coverage-badges": "create-coverage-badges"
...
}
...```
By default uses for coverage report input: **coverage/coverage-summary.json** , and outputs created svg's into the same **coverage** folder.
Flags for input: `--i` or `-inputPath`
Flags for output: `--o`, `--d`, `-outputPath` or `-dist`
## License
(c) 2023 Collaborne B.V. All rights reserved.