This package has been deprecated

Author message:

this package has been deprecated

console-badge
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

🎨 console-badge

Create simple badges in the browser console.

Tiny, easy-to-use package. No dependencies.


Version Downloads npm bundle size License

Build Status JavaScript Standard Code Style



Features

  • Tiny: Less than 1kB (minified and gzipped). No dependencies. ES5-compliant code.
  • Customizable: Change the font colors, background colors and texts. Tip: You can use the popular shields.io badge style. 😎
  • Flexible: Support for console.log / .warn / .error / .info.

Installation

$ npm install console-badge
# OR 
$ yarn add console-badge

Usage

Edit on CodeSandbox

import * as consoleBadge from 'console-badge';
 
consoleBadge.log({
  mode: 'shields.io',
  leftText: 'console-badge',
  rightText: 'hello world 🚀',
  rightBgColor: '#ffc107',
  rightTextColor: '#1a1a1a'
});
 
consoleBadge.log({
  leftText: '😎 Check out our code here:',
  leftTextColor: '#000',
  leftBgColor: '#ddd',
  rightText: 'https://example.com/oss',
  rightBgColor: '#000'
});

💡 Please take a look at the API documentation to find out what the different options do and which other console types are supported.

Output:

CDN jsDelivr Hits

For prototyping or learning purposes, you can use the latest version with:

<script src="https://cdn.jsdelivr.net/npm/console-badge"></script>

For production, we recommend linking to a specific version number and build to avoid unexpected breakage from newer versions:

<script src="https://cdn.jsdelivr.net/npm/console-badge@1/dist/console-badge.umd.min.js"></script>
// Global variable
consoleBadge.log();
// Property in the window object
window.consoleBadge.log();

⚠ NPM is the recommended installation method. It pairs nicely with module bundlers such as webpack.

Documentation

Show your support

Please ⭐️ this repository if this project helped you!

Issues

Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

Changelog

Detailed changes for each release are documented in the release notes.

Contribution

Please make sure to read the Contributing Guide before making a pull request.

Thank you to all the people who have already contributed to this project!

License

MIT

Copyright (c) 2019-present, Dennis Herzberg

Package Sidebar

Install

npm i console-badge

Weekly Downloads

34

Version

1.3.1

License

MIT

Unpacked Size

17.1 kB

Total Files

8

Last publish

Collaborators

  • dennishzg