Git Product home page Git Product logo

commandbox-emoji's Introduction

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`

commandbox-emoji's People

Contributors

lmajano avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.