Giter Club home page Giter Club logo

dillonbaird / consoleswag Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3.83 MB

consoleSwag.js - Console messages, with swag. Lightweight JavaScript library designed to add flair and fun to your console messages. Whether you're looking to display an image banner, prepend emojis to your logs, or just make your debugging sessions a bit more entertaining, consoleSwag has you covered.

Home Page: https://www.npmjs.com/package/consoleswag

License: MIT License

TypeScript 100.00%
console javascript npm-package swag

consoleswag's Introduction

consoleSwag Logo

consoleSwag.js

Console messages, with swag.

npm (scoped) downloads (scoped) npm bundle size (minified) npm bundle size (minified)



๐Ÿ™‰ What's this all about?

Tired of those boring and basic console messages? Ever wanted to express your creativity through your console? Just want to add some hidden easter-eggs into your project? Well, then this is the library for you!

consoleSwag.js helps Javascript developers make console message more fun; making them stand out and pop with style. Whether you want to display an image banner, or just prepend existing console messages with emojis, we've got you covered. The best part? Our library is extremely lightweight and developer friendly- which means it won't take a toll on your project, and it's uber-simple to implement.

This shouldn't need to be said, but just in case: Please DO NOT use this in any enterprise production software! This was made purely for fun, and to maybe make your debugging sessions a little less mundane. You have been warned.

โšก๏ธ Fast implementation

Step 1: Paste the following script tag into the head of your HTML document:

<script src="https://cdn.jsdelivr.net/npm/consoleswag/lib/cjs/index.min.js"></script>
<script type="text/javascript">
  console.swag({
    //options
  });
</script>

Or, use npm:

//Install:
npm i consoleswag

//Then, paste this at the top of your JavaScript file:
const cswag = require("consoleswag");
cswag.swag({
  //options
});

//Note: If your project is a module, you can paste this in your JavaScript file instead:
import cswag from 'consoleswag';
cswag.swag({
  //options
});

Step 2: Use any of the commands explained at below however you like.

Options

{
	theme: "blackandwhite",   //default, blackandwhite, neon
	customStyles: {
		log: ["color:blue","font-size:15px"],
		warn: ["color:orange","font-size:10px"],
		info: ["color:green","font-size:10px"],
		error: ["color:red","font-size:20px"],
	},
	emoji: true,
	customEmoji: {
		log: "๐Ÿš€",
		warn: "๐Ÿ™‰",
		info: "๐Ÿคทโ€โ™‚๏ธ",
		error: "โŒ",
		image: "๐Ÿ•น๏ธ"
	},
	customTagText: {
		log: "My Log",
		warn: "Woah, warning",
		info: "Attention",
		error: "FAILURE",
	},
	memeErrors: true,
	angryErrors: true,
	uncensorAngryErrors: true,
	customAngryText: ["wtf","really???"],
	fileStackApiKey: "xxxxx",		//required for console.asciiImage() & console.screenshot()
}

๐ŸŽ‰ Examples

โŒถ Basic (Big Text)

console.bigText("So much swag!"); //=> Basic default styling

Basic Style


๐ŸŒ† Image Banner

console.imageBanner("https://picsum.photos/200/600", "So Much Swag!"); //=> Image Banner

Basic Style


๐Ÿ‘ Supporters

Stargazers repo roster for @dillonbaird/consoleswag Forkers repo roster for @dillonbaird/consoleswag

Animated footer bars


Back to top

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.