Emoji-Print
:heart_eyes: :wink: :sunglasses: :poop: :facepunch: :turtle: :cake: :pizza:
A simple utility to console log with emojis.
Not all emojis are going to log correctly.
Screenshot
Sample TypeScript with Intellisense | Sample Logs |
---|
| |
CodePen Demo
CodePen Demo - open the console and tap the buttons to see the emoji in the console logs.
Installation
npm install emoji-print --save
Usage (Several Options)
TypeScript
import { Emoji, EmojiSuccess } from 'emoji-print';
public someEvent() {
console.log(Emoji.Food.eggplant);
}
public anotherEvent() {
EmojiSuccess("something great happened");
}
Using modules with javascript
const EmojiPrint = require("emoji-print");
function something() {
console.log(EmojiPrint.Emoji.Smiley.hugging_face);
}
function anyEvent() {
EmojiPrint.EmojiWarn("some error happened, abort mission");
}
function anotherEvent() {
EmojiPrint.EmojiSuccess("something great happened");
}
Loading Emoji-Print as a library with a script tag
This will expose a variable emojiPrint
for the library, made possible through bundling with webpack.
<button onclick="doSomething()"></button>
<script src="https://unpkg.com/emoji-print@0.2.0/dist/emoji-print.js"></script>
<script>
function doSomething() {
console.log(emojiPrint.Emoji.Food.tomato);
emojiPrint.EmojiWarn('Oh No, this is really bad.');
}
</script>