Hey there!
I've just released a little quirky node-js library. Add badges to your cli apps or npm packages.
nombrekeff / cli-badges
Quirky little node-js library for generating badges for your cli apps.
Table Of Contents
Getting Started
Installing
As usual, you need to install from npm/yarn:
$ npm install cli-badges
Usage
This is a simple example, using badges to display test results:
const { badge } = require('cli-badges');
const failedBadge = badge('failed', '2', { theme: 'red' });
const skippedBadge = badge.yellow('skipped', '2');
const successBadge = badge.green('success', '2');
console.log(failedBadge, successBadge, skippedBadge);
The above would output something similar to the terminal:
You could also create a donate badge with a link (if supported):
const donateBadge = badge.blue('❤️ donate',
…Usage
This is a simple example, using badges to display test results:
const { badge } = require('cli-badges');
const failedBadge = badge('failed', '2', {
messageBg: 'red'
});
const skippedBadge = badge('skipped', '2', {
messageBg: 'yellow',
messageColor: 'white',
});
const successBadge = badge('success', '2', {
messageBg: 'green',
messageColor: 'white',
});
console.log(failedBadge, successBadge, skippedBadge);
The above would output something similar to the terminal:
You could also create a donate badge with a link (if supported):
const { badge } = require('cli-badges');
const donateBadge = badge('donate', 'ko-fi', {
link: 'https://ko-fi.com/logginjs',
});
console.log(donateBadge);
Example output is a mock, console output will vary slightly from terminal to terminal.
cli-badges is now also available for Python, thanks to haideralipunjabi.
haideralipunjabi / cli-badges
Quirky little python package for generating badges for your cli apps.
It would be awesome if you could pass by and give me some feedback. 🥰
Top comments (8)
Cool. It's those nifty little fun things we all love, isn't it?
Yup, not as useful as shields.io, but could have some fun usecases. I'm using it for an experimental testing framework I'm building.
Awesome project!
Thanks man! Just a fun little thingy 😊
This is super cool, I'm going to use it in Express Autodocs
That would be great! 🥰
cli-badges is also available for python now, ported by haideralipunjabi.
github.com/haideralipunjabi/cli-ba...
Made a dart version, and a post for it 😀