0.2.0 • Published 7 years ago

emoji-print v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

npm npm PayPal Donate

Not all emojis are going to log correctly.

Screenshot

Sample TypeScript with IntellisenseSample Logs
EmojiPrintEmojiLogs

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)

import { Emoji, EmojiSuccess } from 'emoji-print';

public someEvent() {
    console.log(Emoji.Food.eggplant);
}

public anotherEvent() {
  // EmojiSuccess is a utility to console.log with leading/trailing check marks.
  EmojiSuccess("something great happened");
}
const EmojiPrint = require("emoji-print");

function something() {
  console.log(EmojiPrint.Emoji.Smiley.hugging_face);
}

function anyEvent() {
  // EmojiWarn is a utility to console.log with leading/trailing exclamations.
  EmojiPrint.EmojiWarn("some error happened, abort mission");
}

function anotherEvent() {
  // EmojiSuccess is a utility to console.log with leading/trailing check marks.
  EmojiPrint.EmojiSuccess("something great happened");
}

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);
    // or call the utility log functions for emoji-print
    emojiPrint.EmojiWarn('Oh No, this is really bad.');
  }
</script>