emoji-handle

1.0.4 • Public • Published

emoji-handle

The string contains the processor of Emoji

Feature

  • 字符串中emoji替换unicode
  • 修正字符串 只保留 中文 大小写英文字母 阿拉伯数字 小数点 emoji表情

Installation

$ npm i emoji-handle

Useing

字符串中emoji替换unicode示例:

const { emojiToUnicode } = require('emoji-handle');
const result = emojiToUnicode('李大猫😀');
console.log(result);
// output: 李大猫\\u{1F600}

修正字符串

只保留 中文 大小写英文字母 阿拉伯数字 小数点 示例:

const { repair } = require('emoji-handle');
const result = repair('佛系大宝宝🌟𐂂 ☾˚‧º·');
console.log(result);
// output: 佛系大宝宝

只保留 中文 大小写英文字母 阿拉伯数字 小数点 emoji表情 示例:

const { repair } = require('emoji-handle');
const result = repair('佛系大宝宝🌟𐂂 ☾˚‧º·', true);
console.log(result);
// output: 佛系大宝宝🌟

𝙂𝙡𝙤𝙧𝙞𝙖𝘿☺︎ 全部是特殊符号返回空字符串 长度为0 需要人工处理

/emoji-handle/

    Package Sidebar

    Install

    npm i emoji-handle

    Weekly Downloads

    1

    Version

    1.0.4

    License

    ISC

    Unpacked Size

    23.3 kB

    Total Files

    8

    Last publish

    Collaborators

    • jiangwei1995