https://github.com/coldbox-modules/cbemoji
😏 simple emoji support for ColdBox projects
https://github.com/coldbox-modules/cbemoji
Last synced: 4 months ago
JSON representation
😏 simple emoji support for ColdBox projects
- Host: GitHub
- URL: https://github.com/coldbox-modules/cbemoji
- Owner: coldbox-modules
- Created: 2018-03-22T16:12:55.000Z (about 8 years ago)
- Default Branch: development
- Last Pushed: 2025-02-20T10:19:11.000Z (over 1 year ago)
- Last Synced: 2025-08-14T11:52:39.291Z (10 months ago)
- Language: ColdFusion
- Size: 62.5 KB
- Stars: 1
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- Funding: .github/FUNDING.YML
- Code of conduct: .github/CODE_OF_CONDUCT.MD
- Security: .github/SECURITY.md
- Support: .github/SUPPORT.md
Awesome Lists containing this project
README
Copyright Since 2005 ColdBox Platform by Luis Majano and Ortus Solutions, Corp
www.coldbox.org |
www.ortussolutions.com
----
# :boom: Welcome to the cbemoji module :rocket:
This module allows you to use emojis in your ColdBox applications by using the `emoji` service. This service allows you to get emojis by name, by code, search for emojis, replace emojis in strings, and much more.
## Installation
To install `cbemoji`, you need [CommandBox](https://www.ortussolutions.com/products/commandbox/) :rocket:
Once you have that set-up, just run `box install cbemoji` in your shell and :boom:
You're now ready to use emoji in your CFML projects! Awesome! :rocket:
## Usage : Emoji Service
There is one model library that will be mapped via WireBox as `EmojiService@cbemoji`, which will give you all the methods you might need for emoji goodness :rocket:
```javascript
// Inject the emoji service
property name="emoji" inject="emojiService@cbemoji";
// 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`
```