@mattythedev01/text-emoji
v1.0.2
Published
Just a useless package to turn text into emojis
Downloads
31
Maintainers
Readme
Usage
const { emojiMap } = require("package"); // Adjust the path as necessary
// Adding the convert method to String prototype
String.prototype.convert = function () {
return this.split("")
.map((char) => emojiMap[char.toLowerCase()] || char)
.join("");
};
// Example usage
const testString1 = "hello";
const testString2 = "123";
const testString3 = "abc";
const testString4 = "Hello World!";
console.log(`"${testString1}" converts to: "${testString1.convert()}"`);
console.log(`"${testString2}" converts to: "${testString2.convert()}"`);
console.log(`"${testString3}" converts to: "${testString3.convert()}"`);
console.log(`"${testString4}" converts to: "${testString4.convert()}"`);