1.0.2 • Published 1 year ago

encode-emojis v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Encode Emojis

npm Package Version License MIT GitHub Repo Native Typescript Support Coveralls Coverage GitHub Workflow Status

A javascript library that encodes emojis (only emojis!) to HTML entities.


Installation

This library is published to npm registry as encode-emojis.

You can install it:

# 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.)

Usage

import { encodeEmojis } from 'encode-emojis';

let text = '<strong>Hello!</strong> 👋';

text = encodeEmojis(text);

console.log(text); // -> '<strong>Hello!</strong> &#x1f44b;'

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

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago