https://github.com/simbo/encode-emojis
A javascript library that encodes emojis (only emojis!) to HTML entities.
https://github.com/simbo/encode-emojis
emojis encode html-entities npm-package
Last synced: 2 months ago
JSON representation
A javascript library that encodes emojis (only emojis!) to HTML entities.
- Host: GitHub
- URL: https://github.com/simbo/encode-emojis
- Owner: simbo
- License: mit
- Created: 2023-04-27T12:44:04.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-03T08:12:36.000Z (about 3 years ago)
- Last Synced: 2025-09-30T19:19:51.343Z (9 months ago)
- Topics: emojis, encode, html-entities, npm-package
- Language: Shell
- Homepage:
- Size: 249 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Encode Emojis
[](https://www.npmjs.com/package/encode-emojis)
[](http://simbo.mit-license.org/)
[](https://github.com/simbo/encode-emojis)

[](https://coveralls.io/github/simbo/encode-emojis)
[](https://github.com/simbo/encode-emojis/actions/workflows/ci.yml)
A javascript library that encodes emojis (only emojis!) to HTML entities.
---
## Installation
This library is published to npm registry as
[`encode-emojis`](https://www.npmjs.com/package/encode-emojis).
You can install it:
```sh
# with npm
npm install --save encode-emojis
# with yarn
yarn add encode-emojis
```
ℹ️ **HINT**: This library is a pure ESM package. (You may want to
[read this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).)
## Usage
```ts
import { encodeEmojis } from 'encode-emojis';
let text = 'Hello! 👋';
text = encodeEmojis(text);
console.log(text); // -> 'Hello! 👋'
```
## Why?
Unfortunately, I am forced to use MS Teams for work, which - although it was
working fine since forever - recently decided to fail on webhook event data that
contains emojis.
But as my webhook event data contains not only emojis but also HTML, I needed to
convert only emojis. So here we go…
## License
[MIT © Simon Lepel](http://simbo.mit-license.org/)