Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More β†’
Socket
Sign inDemoInstall
Socket

base64-emoji-parser

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64-emoji-parser

Base64 Emoji Parser

  • 0.1.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Base64 Emoji Parser



## Install
yarn add base64-emoji-parser
# or
npm i base64-emoji-parser

Examples

Convert Base64 to Emoji

Base64 strings can be easily converted to Emoji(pictograms)

import { base64ToEmoji } from 'base64-emoji-parser';

const base64String = 'TWVzc2FnZSAhIQ==';

const emojiParsed = base64ToEmoji(base64String);

console.log(emojiParsed);
//😒😠😀πŸ€ͺπŸ˜„πŸ₯ΆπŸ€©πŸ˜‰πŸ€―πŸ₯ΊπŸ€¨πŸ€£πŸ˜’πŸ˜«πŸ€₯πŸ€₯

Convert Emoji to Base64

Emoji can also be set to base64

import { emojiToBase64 } from 'base64-emoji-parser';

const emojiString = '😒😠😀πŸ€ͺπŸ˜„πŸ₯ΆπŸ€©πŸ˜‰πŸ€―πŸ₯ΊπŸ€¨πŸ€£πŸ˜’πŸ˜«πŸ€₯πŸ€₯';

const base64Parsed = emojiToBase64(base64String);

console.log(base64Parsed);
//TWVzc2FnZSAhIQ==

Custom Emoji pattern

It is also possible to convert with the Emoji you want to use

import {
  base64ToEmoji,
  emojiToBase64,
  EmojiPattern,
} from 'base64-emoji-parser';

const base64String = 'TWVzc2FnZSAhIQ==';

const customEmojiPatten: EmojiPattern = {
  T: '🐢',
  W: '🐱',
  V: 'πŸ¦„',
  z: '🐴',
};

const emojiParsed = base64ToEmoji(base64String, customEmojiPatten);
console.log(emojiParsed);
//πŸΆπŸ±πŸ¦„πŸ΄πŸ˜„πŸ₯ΆπŸ€©πŸ˜‰πŸ€―πŸ₯ΊπŸ€¨πŸ€£πŸ˜’πŸ˜«πŸ€₯πŸ€₯

const base64Parsed = emojiToBase64(emojiParsed, customEmojiPatten);
console.log(base64Parsed);
//TWVzc2FnZSAhIQ==

Author

Taishi Naritomi

License

MIT

Keywords

FAQs

Package last updated on 30 Jun 2023

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc