In open source programs, there are various badges, just like the badges shown above; I hope that such badges can also be displayed in the console to facilitate the display of current program information, such as version number, build time, build status, etc. and other information.
- Supports bilingual annotations in both Chinese and English;
- Low learning cost, chain calling, simple and flexible use;
- Implemented with modern features of ES6;
- Written in TypeScript for type safety;
- Pure script, can depend on any framework, any platform, any environment;
- Supports on-demand import,
esm
modularization, natively supports tree-shaking, no worries about the size after packaging; - Of course, this project also provides a
commonjs
standardcjs
version; - Test coverage of 100%.
npm install @kwooshung/console-badge
yarn add @kwooshung/console-badge
pnpm add @kwooshung/console-badge
import ConsoleBadge from '@kwooshung/console-badge';
const cb = new ConsoleBadge('version', 'v1.2.3');
cb.[various configuration functions, supporting chain calls].print();
Below is a demonstration of some of the functions;
- Initially, I thought of listing them, but considering the simplicity of use and straightforward code, it's better to view the source code directly Click here to view the source code.
- The function names are quite intuitive, so there's no need to worry about understanding them.
- If you're using TypeScript, you'll get prompts, and the comments are in both Chinese and English, making it very simple to use. There's nothing to worry about.