@piarre/tsmoji
v1.0.7
Published
🔥 Print ✨ emojis ✨ in TypeScript...
Downloads
1
Readme
TSMoji
🔥 Print ✨ emojis ✨ in TypeScript...
EMOJIS BT GITMOJIS
⬇️ Installation
npm i @piarre/tsmoji
🩹 Known issues
- [x] Git Bash for Windows : Default install of can't handle emoji, you must check out this Gist
🚨 Examples
import { getMojiByCode, getMojiByName, Moji } from "@piarre/tsmoji";
console.log(getMojiByCode(":zap:")); /* return ⚡️ */
console.log(getMojiByCode(":art:")); /* return 🎨 */
console.log(getMojiByName("zap")); /* return ⚡️ */
console.log(getMojiByName("art")); /* return 🎨 */
console.log(Moji("zap", "Hello World")); /* return "⚡️ Hello World" */
console.log(Moji(":art:", "Hello World")); /* return "🎨 Hello World" */
🔧 Availabe functions
/**
* Returns a string with an emoji and a message based on the provided icon and message.
* @param icon - The name or code of the emoji.
* @param message - The message to be displayed with the emoji.
* @returns A string with the emoji and the message, or a red flag emoji if the emoji is unknown.
*/
export function Moji(icon: MojisName | MojisCode, message: string);
/**
* Retrieves the emoji corresponding to the given code.
* @param code - The code of the emoji to retrieve.
* @returns The emoji corresponding to the code, or a red flag emoji if the code is unknown.
*/
export function getMojiByCode(code: MojisCode | string);
/**
* Retrieves the emoji associated with the given name.
* @param name The name of the emoji to retrieve.
* @returns The emoji corresponding to the given name, or a red flag emoji if the name is unknown.
*/
export function getMojiByName(name: MojisName);
/**
* Retrieves the description of a moji based on its name or code.
* @param name The name or code of the moji.
* @returns The description of the moji, or a red flag emoji if the moji is unknown.
*/
export function getMojiDescription(name: MojisCode | MojisName);
🔐 License
MIT