Skip to content

commandbox-modules/commandbox-emoji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

commandbox-emoji

simple emoji support for CommandBox projects

Installation

To install commandbox-emoji, you need CommandBox πŸš€

Once you have that set-up, just run box install commandbox-emoji in your shell and πŸ’₯

You're now ready to use emoji in your CFML projects! Awesome! πŸš€

Usage

You can use this module as a set of commands or as a library to enhance your CLI Applications.

Commands

The following are the commands registered for you:

  • emoji - Pass in a name for the emoji to render: emoji heart, emoji :heart:
  • emojify - Pass in a string with github flavored emoji markdown to translate it: I :heart: my :coffee:!
  • unemojify - Convert an emoji enabled string to github flavored emoji markdown: I ❀️ you
  • emojimap - Prints out all the emoji's supported in this library.

Emoji Service

If you want to leverage this module as an emoji service, you can leverage the following injection: EmojiService@commandbox-emoji into your CommandBox Tasks, Modules, Commands, etc. Then leverage tons of helper methods for Emoji goodness! πŸš€

// Inject the emoji service
property name="emoji" inject="emojiService@commandbox-emoji";

// Use it

emoji.get( 'coffee' ) // returns the emoji code for coffee (displays emoji on terminals that support it)

emoji.which(emoji.get( 'coffee' )) // returns the string "coffee"

emoji.get( ':fast_forward:' ) // `.get` also supports github flavored markdown emoji (http://www.emoji-cheat-sheet.com/)

emoji.emojify( 'I :heart: :coffee:!' ) // replaces all :emoji: with the actual emoji, in this case: returns "I ❀️ β˜•οΈ!"

emoji.random() // returns a random emoji + key, e.g. `{ emoji: '❀️', key: 'heart' }`

emoji.search( 'cof' ) // returns an array of objects with matching emoji's. `[{ emoji: 'β˜•οΈ', key: 'coffee' }, { emoji: ⚰', key: 'coffin'}]`

emoji.unemojify( 'I ❀️ πŸ•' ) // replaces the actual emoji with :emoji:, in this case: returns "I :heart: :pizza:"

emoji.hasEmoji( 'πŸ•' ) // Validate if this library knows an emoji like `πŸ•`

emoji.hasEmoji( 'pizza' ) // Validate if this library knowns a emoji with the name `pizza`

About

😏 simple emoji support for CommandBox projects

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published