![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
retext-emoji
Advanced tools
Emoji and emoticons for retext.
npm:
$ npm install retext-emoji
$ component install wooorm/retext-emoji
$ bower install retext-emoji
Duo:
var emoji = require('wooorm/retext-emoji');
var Retext = require('retext');
var inspect = require('retext-inspect');
var emoji = require('retext-emoji');
var retext = new Retext().use(inspect).use(emoji, {
'convert': 'encode'
});
retext.parse('I’m going to bed. :zzz:', function (err, tree) {
console.log(tree.toString()); // 'I’m going to bed. 💤'
console.log(tree.head.head);
/*
* SentenceNode[10]
* ├─ WordNode[3]
* │ ├─ TextNode: 'I'
* │ ├─ PunctuationNode: '’'
* │ └─ TextNode: 'm'
* ├─ WhiteSpaceNode: ' '
* ├─ WordNode[1]
* │ └─ TextNode: 'going'
* ├─ WhiteSpaceNode: ' '
* ├─ WordNode[1]
* │ └─ TextNode: 'to'
* ├─ WhiteSpaceNode: ' '
* ├─ WordNode[1]
* │ └─ TextNode: 'bed'
* ├─ PunctuationNode: '.'
* ├─ WhiteSpaceNode: ' '
* └─ EmoticonNode: '💤' [data={"names":["zzz"],"description":"sleeping symbol","tags":["sleeping"]}]
*/
});
Parameters:
options
(Object
or null
)options.convert
("encode"
or "decode"
, or null
):
encode
, converts short-codes into their unicode equivalent (e.g., :heart:
and <3
to ❤️
);decode
, converts unicode emoji into their short-code equivalent (e.g., ❤️
and <3
to :heart:
);null
, applies no conversion.All emoticons, whether emoji (❤️
), emoticons (<3
), or gemoji (:heart:
), are classified as EmoticonNode
s. EmoticonNode
subclasses SymbolNode
.
Note that this method has no effect if you’ve specified a
convert
option.
var node = new TextOM.EmoticonNode(':heart:');
console.log(node); // EmoticonNode: ':heart:'
node.toEmoji();
console.log(node); // EmoticonNode: '❤️'
node.fromString('<3').toEmoji(); // EmoticonNode: '❤️'
Transforms a gemoji/emoticon into an emoji.
Note that this method has no effect if you’ve specified a
convert
option.
var node = new TextOM.EmoticonNode('❤️');
console.log(node); // EmoticonNode: '❤️'
node.toGemoji();
console.log(node); // EmoticonNode: ':heart:'
node.fromString('<3').toGemoji();
console.log(node); // EmoticonNode: ':heart:'
Transforms an emoji/emoticon into a gemoji.
retext-emoji supports every wooorm/gemoji and every wooorm/emoticon.
On a MacBook Air. retext works just as fast on content with emoji/gemoji/emoticons, and 2% slower on content without them, when using retext-emoji.
retext w/o retext-emoji
184 op/s » A paragraph (5 sentences, 100 words, 10 emojis)
238 op/s » A paragraph (5 sentences, 100 words, no emojis)
retext w/ retext-emoji
183 op/s » A paragraph (5 sentences, 100 words, 10 emojis)
232 op/s » A paragraph (5 sentences, 100 words, no emojis)
FAQs
retext plugin to support emoji, gemoji, and emoticons
The npm package retext-emoji receives a total of 13,052 weekly downloads. As such, retext-emoji popularity was classified as popular.
We found that retext-emoji demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.