Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bradmartin/emoji-print
https://github.com/bradmartin/emoji-print
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bradmartin/emoji-print
- Owner: bradmartin
- License: other
- Created: 2018-03-30T19:28:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-03T03:08:20.000Z (over 6 years ago)
- Last Synced: 2024-10-17T07:29:31.509Z (2 months ago)
- Language: TypeScript
- Size: 271 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Emoji-Print
:heart_eyes: :wink: :sunglasses: :poop: :facepunch: :turtle: :cake: :pizza:
A simple utility to console log with emojis.[![npm](https://img.shields.io/npm/v/emoji-print.svg)](https://www.npmjs.com/package/emoji-print)
[![npm](https://img.shields.io/npm/dt/emoji-print.svg?label=npm%20downloads)](https://www.npmjs.com/package/emoji-print)
[![PayPal Donate](https://img.shields.io/badge/Donate-PayPal-ff4081.svg)](https://www.paypal.me/bradwayne88)_Not all emojis are going to log correctly._
### Screenshot
| Sample TypeScript with Intellisense | Sample Logs |
| ------------------------------------- | :-----------------------------------: |
| ![EmojiPrint](screens/emojiPrint.gif) | ![EmojiLogs](screens/emoji-print.png) |## CodePen Demo
[CodePen Demo](https://codepen.io/bradwaynemartin/pen/QmmXKb) - 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
```typescript
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");
}
```Using modules with javascript
```javascript
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");
}
```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](https://webpack.js.org/).
```html
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.');
}```