Turn your :emoji_codes: into thier emoji character π
emojizer
is a program filter that turn github emoji codes into associated character.
Wanna try before install? just npx emojizer "Try me :wave:"
,
and if you want to install an standard global install will do it: npm install -g emojizer
As a pipe, just place it between your program, and your eventual pager.
You can use either emojizer
or its alias emojize
.
echo "Something with emojies :upside_down_face:" | emojizer
# πΊ Something with emojies π
echo "Insert before your pager :pager:" | emojizer | less
You can also provide input as argument, either as text, either as file using the -f
/--file
flag
emojizer "Some string" "with or without" "emojies :slightly_smiling_face:"
# πΊ Some string
# with or without
# emojies π
emojizer -f README.md CHANGELOG.md
# πΊ ...README then CHANGELOG with emoji code replaces
Using zsh, you can for instance define a global alias that combine emojizer
and less
or any other pager you use.
alias -g eless="emojizer|less"
# then just
git log --oneline --color | eless
Note that used with git log
you might have to force color output, with --color
flag for instance.
Just provide the -h
or --help
flag and you'll have the help displayed:
Replace your emoji codes with "real" emojies π
Usage:
cat something | emojizer
emojizer "text with :slightly_smiling_face:" ":wink:"
emojizer -f README.md
Options:
--version Show version number [boolean]
-f, --file Treat args as file to read from [boolean] [default: false]
-h, --help Show help [boolean]
Internal replacing logic is exposed and so functionality can be reuse.
Provided API is so far limited, but it expose:
- a function to replace emoji code with corresponding emoji caracter:
replaceEmojiCodes
- a function to create a
Transform
stream:getEmojizerStream
- the
emojiIndex
used internaly and provided by thegemoji
library (emoji/name-to-emoji.json
)
const {replaceEmojiCodes} = require('emojizer');
console.log(replaceEmojiCodes('some text with :symbols:'));
// for getEmojizerStream, see the source or the tests π
Original release was made under the name emojiless
with catchphrase
Less is more with emojies π
Named was changed as less
was misleading, program not being a pager.