npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

emoji-provider

v1.0.6

Published

Adds a simple way of generating emojis

Downloads

155

Readme

emoji-provider

Adds a simple way of generating emojis to your front-end application. Do you need emojis for a chat application? Maybe you want to convert emoticons to emojis in text? Look no further! Currently supports emojis up to Unicode Version 15.

A zero-dependency library.

Installation

Install with npm:

npm install emoji-provider

ES6

import { emojiProvider } from 'emoji-provider'

Usage example

import { emojiProvider } from 'emoji-provider'

const text = 'I love emojis :D <3'
const emojiText = emojiProvider.replaceEmoticonsWithEmojis(text)

console.log(emojiText)
// => 'I love emojis 😃 ❤️'

API

getEmojis()

Returns a string array with all supported emojis (currently supports emojis up to Unicode Version 15).

const emojis = getEmojis()

console.log(emojis)
/* => [
  '😀', '😃', '😄', '😁', '😆', '😅', '🤣',
  '😂', '🙂', '🙃', '😉', '😊', '😇', '🥰',
  '😍', '🤩', '😘', '😗', '😚', '😙', '😋',
  '😛', '😜', '🤪', '😝', '🤑', '🤗', '🤭',
  '🤫', '🤔', '🤐', '🤨', '😐', '😑', '😶',
  '😏', '😒', '🙄', '😬', '🤥', '😌', '😔', 
  '😪', '🤤', '😴', '😷', '🤒', ... 
]
*/

getEmojisAndTags()

Returns an object array with all supported emojis and corresponding tags (currently supports emojis up to Unicode Version 15).

const emojiObjects = getEmojisAndTags()

console.log(emojiObjects)
/* => [
  { tag: 'happy-face', emoji: '😀' }, 
  { tag: 'happy-face-with-big-eyes', emoji: '😃' } ,
  { tag: 'happy-face-with-smiling-eyes', emoji: '😄' },
  { tag: 'beaming-face-with-smiling-eyes', emoji: '😁' },
  { tag: 'laughing', emoji: '😆' },
  { tag: 'happy-sweat', emoji: '😅' },
  { tag: 'rolling-on-the-floor-laughing', emoji: '🤣' },
  { tag: 'face-with-tears-of-joy', emoji: '😂' },
  { tag: 'slightly-smiling-face', emoji: '🙂' },
  { tag: 'upside-down-face', emoji: '🙃' },
  { tag: 'winking-face', emoji: '😉' },
  { tag: 'smiley-face', emoji: '😊' },
  { ... } 
*/

getEmojisByCategory(...categories)

Returns a string array with emojis of chosen categories.

Allowed input string arguments:

  • activity
  • animalsAndNature
  • flags
  • foodAndDrink
  • objects
  • peopleAndBody
  • smileysAndEmotion
  • symbols
  • travelAndPlaces

OBS! Arguments are case sensitive and need to be exact.

const emojis = getEmojisByCategory('foodAndDrink')

console.log(emojis)
/* => [
  '🍇', '🍈', '🍉', '🍊', '🍋', '🍌', '🍍', '🥭', 
  '🍎', '🍏', '🍐', '🍑', '🍒', '🍓', '🥝', '🍅', 
  '🥥', '🥑', '🍆', '🥔', '🥕', '🌽', '🌶', '🥒', 
  '🥬', '🥦', '🥜', '🍞', '🥐', '🥖', '🥨', '🥯', 
  '🥞', '🧀', '🍖', '🍗', '🥩', '🥓', '🍔', '🍟',
  '🍕', '🌭', '🥪', '🌮', '🌯', '🥙', '🥚', '🍳',
  '🥘', '🍲', '🥣', '🥗', '🍿', '🧂', '🥫', '🍱',
  '🍘', '🍙', '🍚', '🍛', '🍜', '🍝', '🍠', '🍢', 
  '🍣', '🍤', '🍥', '🍮', '🍡', '🥟', '🥠', '🥡', 
  '🍦', '🍧', '🍨', '🍩', ... 
  ]
*/

getEmojisAndTagsByCategory(...categories)

Returns an object array with emojis and tags of chosen categories.

Allowed input string arguments:

  • activity
  • animalsAndNature
  • flags
  • foodAndDrink
  • objects
  • peopleAndBody
  • smileysAndEmotion
  • symbols
  • travelAndPlaces

OBS! Arguments are case sensitive and need to be exact.

const emojiObjects = getEmojisObjectsByCategory('animalAndNature', 'peopleAndBody')

console.log(emojiObjects)
/* => [
  { tag: 'see-no-evil-monkey', emoji: '🙈' },
  { tag: 'hear-no-evil-monkey', emoji: '🙉' },
  { tag: 'speak-no-evil-monkey', emoji: '🙊' },
  { tag: 'monkey-face', emoji: '🐵' },
  { tag: 'monkey', emoji: '🐒' },
  { tag: 'gorilla', emoji: '🦍' },
  { tag: 'dog-face', emoji: '🐶' },
  { tag: 'dog', emoji: '🐕' },
  { tag: 'poodle', emoji: '🐩' },
  { ... }
  { tag: 'waiving-hand', emoji: '👋' },
  { tag: 'raised-back-of-hand', emoji: '🤚' },
  { tag: 'raised-hand', emoji: '✋' },
  { tag: 'vulcan-salute', emoji: '🖖'},
  { tag: 'ok-hand', emoji: '👌' },
  { tag: 'fingers-crossed', emoji: '🤞' },
  { tag: 'i-love-you-hand-sign', emoji: '🤟' },
  { tag: 'heavy-metal-hand-sign', emoji: '🤘' },
  { tag: 'call-me-hand-sign', emoji: '🤙' },
  { ... }
]
*/

getEmojiByTag(tag)

Returns the emoji as a string.

const emoji = getEmojiByTag(piano)

console.log(emoji)
// => '🎹'

replaceEmoticonsWithEmojis(text)

Returns a new string with emoticons replaced with emojis.

const newText = replaceEmoticonsWithEmojis('Hi! :D How Are you? :)')

console.log(newText)
// => 'Hi! 😃 How Are you? 😊'

getMatchingEmojis(text)

Returns an array with emojis matching input.

const emojis = getMatchingEmojis('sad')

console.log(emojis)
// => [ '😢', '😞', '😓', '😿' ]

Want to contribute?

See DEVELOPER.md for project information and contribution details.