Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Replaces emojis in strings or DOM nodes with corresponding images of your choosing. A barebones, mostly drop-in replacement for Twemoji's twemoji.parse()
(and heavily cherry-picked from Twitter's original script to cut some cruft and save a few bytes).
<html>
<head>
<style>
/* All inserted images have class="emoji" */
img.emoji {
width: 30px;
height: 30px;
}
</style>
</head>
<body>
<p>I 💩 emoji!</p>
<script src="https://unpkg.com/imagemoji/dist/imagemoji.min.js"></script>
<script>
imagemoji.parse(document.body);
//=> <p>I <img class="emoji" draggable="false" alt="💩" src="https://twemoji.maxcdn.com/v/latest/svg/1f4a9.svg"/> emoji!</p>
imagemoji.parse(document.body, (icon) => `/assets/emoji/${icon}.png`);
//=> <p>I <img class="emoji" draggable="false" alt="💩" src="/assets/emoji/1f4a9.png"/> emoji!</p>
</script>
</body>
</html>
npm install imagemoji
or yarn add imagemoji
import { parse as parseEmoji } from "imagemoji";
// or...
// const parseEmoji = require("imagemoji").parse;
parseEmoji(document.body);
parseEmoji(document.body, (icon) => `https://cdn.example.com/emoji/${icon}.svg`);
Type: string
or Node
Either a plain string or a DOM node (e.g. document.body
) containing emojis to replace with <img>
s.
Type: function
Default: (icon) => "https://twemoji.maxcdn.com/v/latest/svg/" + icon + ".svg"
A callback function to determine the image source URL of a given emoji codepoint (always lowercase, e.g. 1f4a9
for 💩, and variations are joined with dashes, e.g. 1f468-200d-1f4bb
for 👨💻). Defaults to pulling SVGs from the Twemoji CDN.
MIT
FAQs
🖼️ Replaces emojis in strings or DOM nodes with corresponding images
The npm package imagemoji receives a total of 70 weekly downloads. As such, imagemoji popularity was classified as not popular.
We found that imagemoji 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.