Socket
Book a DemoInstallSign in
Socket

retext-emoji

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retext-emoji

retext plugin to support emoji, gemoji, and emoticons

5.0.2
Source
npmnpm
Version published
Weekly downloads
16K
0.66%
Maintainers
1
Weekly downloads
 
Created
Source

retext-emoji

Build Coverage Downloads Size Sponsors Backers Chat

retext plugin to support emoji, gemoji, and emoticons.

Install

npm:

npm install retext-emoji

Use

var retext = require('retext')
var emoji = require('retext-emoji')

var file = retext()
  .use(emoji, {convert: 'encode'})
  .processSync('I’m going to bed. :zzz:')

console.log(String(file))

Yields:

I’m going to bed. 💤

API

retext().use(emoji[, options])

Support emoji, gemoji, and emoticons.

options.convert

If, and how to convert ('encode' or 'decode', optional).

When encode is given, converts short-codes and emoticons to their unicode equivalent (:heart: and <3 to ❤️).

When decode is given, converts unicode emoji and emoticons to their short-code equivalent (❤️ and <3 to :heart:).

EmoticonNode

retext-emoji adds a new node to nlcst: Emoticon (Literal).

Whether emoji (❤️), emoticon (<3), or gemoji (:heart:), all are classified as EmoticonNodes.

interface Emoticon < Symbol {
  type: "EmoticonNode"
  data: EmoticonData
}

interface EmoticonData {
  names: [string]
  description: string?
  tags: [string]
}

Support

retext-emoji supports every gemoji and every emoticon.

Contribute

See contributing.md in retextjs/retext for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

See contributing.md in retextjs/.github for ways to get started. See support.md for ways to get help.

This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Keywords

unified

FAQs

Package last updated on 05 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.