1.0.2 • Published 9 months ago

@mattythedev01/text-emoji v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

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()}"`);