{"id":29131873,"url":"https://github.com/leroyanders/unimoji","last_synced_at":"2025-06-30T06:09:21.058Z","repository":{"id":300635095,"uuid":"1006686687","full_name":"leroyanders/unimoji","owner":"leroyanders","description":"Universal Emoji Toolkit for TypeScript — parse, clean, count, extract, and manipulate emojis in text with ease.","archived":false,"fork":false,"pushed_at":"2025-06-22T19:54:35.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-22T20:36:22.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leroyanders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-22T19:47:32.000Z","updated_at":"2025-06-22T20:00:30.000Z","dependencies_parsed_at":"2025-06-22T20:36:25.312Z","dependency_job_id":"ab4bc27e-cafd-4dec-9fde-b4cb9c8cd6f9","html_url":"https://github.com/leroyanders/unimoji","commit_stats":null,"previous_names":["leroyanders/unimoji"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leroyanders/unimoji","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leroyanders%2Funimoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leroyanders%2Funimoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leroyanders%2Funimoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leroyanders%2Funimoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leroyanders","download_url":"https://codeload.github.com/leroyanders/unimoji/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leroyanders%2Funimoji/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262720676,"owners_count":23353451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-30T06:09:20.445Z","updated_at":"2025-06-30T06:09:21.044Z","avatar_url":"https://github.com/leroyanders.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unimoji\n\n**Universal Emoji Toolkit** for TypeScript — parse, clean, count, extract, and manipulate emojis in text with ease.\n\n---\n\n## ✨ Features\n\n- Extract emojis with position info\n- Remove or replace emojis\n- Count, filter, and sort emoji usage\n- Restore emojis into cleaned text\n- Handle skin tone modifiers\n- Works in Node.js environments\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install unimoji\n```\n\n---\n\n## 🛠 Usage\n\n```ts\nimport {\n    extractEmoji,\n    removeFromText,\n    textLength,\n    format,\n    lengthWithEmojis,\n    hasEmoji,\n    replaceEmojis,\n    countUnique,\n    onlyEmojis,\n    stripAllButEmojis,\n    normalizeSkinTones,\n    emojiFrequencySorted,\n    filterByEmojiSet,\n    annotateText,\n    isOnlyEmoji,\n    getFirstEmoji,\n    removeDuplicates\n} from 'unimoji';\n\nconst input = 'Hello 👋 world 🌍!';\n\nconsole.log(extractEmoji(input));\n// =\u003e [ { emoji: '👋', indices: [6, 7] }, { emoji: '🌍', indices: [14, 15] } ]\n\nconsole.log(removeFromText(input));\n// =\u003e 'Hello  world !'\n\nconsole.log(textLength(input));\n// =\u003e 13\n\nconsole.log(format([{ emoji: '🌍', indices: [5, 6] }], 'Hello !'));\n// =\u003e 'Hello🌍!'\n\nconsole.log(lengthWithEmojis(input));\n// =\u003e 15\n\nconsole.log(hasEmoji('One 😊 here'));\n// =\u003e true\n\nconsole.log(replaceEmojis(input, (e) =\u003e `[${e}]`));\n// =\u003e 'Hello [👋] world [🌍]!'\n\nconsole.log(countUnique('😊😊😊😄'));\n// =\u003e { '😊': 3, '😄': 1 }\n\nconsole.log(onlyEmojis(input));\n// =\u003e ['👋', '🌍']\n\nconsole.log(stripAllButEmojis(input));\n// =\u003e '👋🌍'\n\nconsole.log(normalizeSkinTones('👍🏽'));\n// =\u003e '👍'\n\nconsole.log(emojiFrequencySorted('🔥🔥💧💧💧'));\n// =\u003e [ { emoji: '💧', count: 3 }, { emoji: '🔥', count: 2 } ]\n\nconsole.log(filterByEmojiSet('👋🌍✨👍', new Set(['🌍', '👍'])));\n// =\u003e [ { emoji: '🌍', indices: [1, 2] }, { emoji: '👍', indices: [3, 4] } ]\n\nconsole.log(annotateText('Go 🚗 now'));\n// =\u003e 'Go \u003cemoji\u003e🚗\u003c/emoji\u003e now'\n\nconsole.log(isOnlyEmoji('😊👍'));\n// =\u003e true\n\nconsole.log(getFirstEmoji('Some 🎯 emoji'));\n// =\u003e '🎯'\n\nconsole.log(removeDuplicates('😄😄😃😄'));\n// =\u003e '😄😃'\n```\n\n---\n\n## 📚 API\n\nAll methods are fully typed with JSDoc and available as named exports.\n\n| Function               | Description                           |\n|------------------------|---------------------------------------|\n| `extractEmoji`         | Extract emojis with character indices |\n| `removeFromText`       | Remove all emojis from text           |\n| `textLength`           | Length of text without emojis         |\n| `format`               | Reconstruct emojis into base text     |\n| `lengthWithEmojis`     | Length of full text with emojis       |\n| `hasEmoji`             | Whether any emoji is present          |\n| `replaceEmojis`        | Replace emojis with custom string     |\n| `countUnique`          | Count occurrences of each emoji       |\n| `onlyEmojis`           | Get array of only emojis              |\n| `stripAllButEmojis`    | Keep only emojis in text              |\n| `normalizeSkinTones`   | Remove skin tone modifiers            |\n| `emojiFrequencySorted` | Get emojis sorted by frequency        |\n| `filterByEmojiSet`     | Filter emojis from allowed set        |\n| `annotateText`         | Wrap each emoji in tags               |\n| `isOnlyEmoji`          | Check if text contains only emojis    |\n| `getFirstEmoji`        | Return first emoji (if any)           |\n| `removeDuplicates`     | Remove duplicate emojis               |\n\n---\n\n## 📄 License\n\nMIT © 2025 Vadym Dordiienko\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleroyanders%2Funimoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleroyanders%2Funimoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleroyanders%2Funimoji/lists"}