node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org ยป

base-emoji

base emoji

You have base 16, base 64, and now, base emoji.

(Output a buffer in emojis.)

example

0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff

becomes

๐Ÿ’ฏ๐Ÿ”ข๐Ÿ‘๐Ÿ‘Ž๐ŸŽฑ๐Ÿ…ฐ๏ธ๐Ÿšกโœˆ๏ธ๐Ÿ‘ฝ๐Ÿš‘โš“๏ธ๐Ÿ‘ผ๐Ÿ’ข๐Ÿ˜ ๐Ÿœ๐ŸŽโฌ‡๏ธโฌ…๏ธโžก๏ธโฌ†๏ธ๐ŸŽจ๐Ÿง๐Ÿ‘ถ๐Ÿผ๐ŸŽˆ๐ŸŽ๐ŸŒโ€ผ๏ธ๐Ÿ“Š๐Ÿ’ˆ๐Ÿ€๐Ÿ›€๐Ÿ”‹๐Ÿป๐Ÿ๐Ÿบ๐Ÿž๐Ÿ””๐Ÿšด๐Ÿ‘™๐ŸŽ‚๐Ÿƒ๐ŸŒผ๐Ÿ“˜๐Ÿš™๐Ÿ’™๐Ÿ—โ›ต๏ธ๐Ÿ’ฃ๐Ÿ“–๐Ÿ“š๐Ÿ’ฅ๐Ÿ‘ข๐Ÿ’๐ŸŽณ๐Ÿ‘ฆ๐Ÿž๐Ÿ‘ฐ๐Ÿ’ผ๐Ÿ’”๐Ÿ›๐Ÿ’ก๐ŸšŒ๐Ÿ‘ค๐ŸŒต๐Ÿฐ๐Ÿ“†๐Ÿซ๐Ÿฌ๐Ÿš—๐Ÿˆ๐Ÿ’ฟ๐Ÿ๐Ÿ’๐Ÿ”๐Ÿซ๐ŸŽ„๐Ÿ‘๐ŸŽฌโ˜๏ธ๐Ÿธโ˜•๏ธ๐Ÿ’ป๐ŸŽŠ๐Ÿšง๐Ÿช๐ŸŒฝ๐Ÿ‘ซ๐Ÿ„๐ŸŠ๐Ÿ‘‘๐Ÿ”ฎ๐Ÿ’˜๐ŸŒ€๐Ÿ’ƒ๐ŸŽฏ๐Ÿ’จ๐ŸŒณ๐Ÿ’ซ๐Ÿ•๐Ÿ’ต๐Ÿฌ๐Ÿฉ๐Ÿšช๐Ÿ’ง๐Ÿ‘‚๐ŸŒ๐Ÿ‘“๐Ÿ‘Š๐Ÿพ๐Ÿ”ฅ๐Ÿ”ฆ๐Ÿ’พ๐Ÿˆ๐Ÿ€๐Ÿค๐ŸŸ๐Ÿธ๐ŸŽฒ๐Ÿ’Ž๐Ÿ‘ป๐ŸŽ๐ŸŒโ›ณ๏ธ๐Ÿ‡๐Ÿ๐ŸŽธ๐Ÿ”ซ๐Ÿ”๐Ÿ”จ๐Ÿ‘œ๐Ÿฃ๐ŸŒฟ๐Ÿ”†๐Ÿ‘ ๐ŸดโŒ›๏ธ๐Ÿจ๐ŸŽƒ๐Ÿ”‘๐Ÿ’‹๐Ÿจ๐Ÿƒ๐Ÿ”—๐Ÿ”’๐Ÿ“ข๐Ÿ”๐Ÿ“ซ๐Ÿ๐Ÿ“ฃ๐Ÿ“๐ŸŽค๐Ÿ”ฌ๐Ÿ’ฐ๐Ÿ’๐ŸŒ”๐Ÿ๐ŸŽฅ๐Ÿ’ช๐Ÿ„๐ŸŽน๐ŸŽต๐Ÿ‘”๐Ÿ“ฐ๐Ÿ”•โ›”๏ธ๐Ÿšซ๐Ÿ‘ƒ๐Ÿ”ฉ๐Ÿ™๐Ÿ‘Œ๐Ÿ‘๐Ÿ‚๐Ÿผโ›…๏ธ๐Ÿพ๐Ÿ‘๐Ÿ๐Ÿง๐ŸŽญโ˜Ž๏ธ๐Ÿ–๐Ÿฝ๐Ÿ’Š๐Ÿ๐Ÿ•๐Ÿ‘‡๐Ÿ‘ˆ๐Ÿ‘‰๐Ÿ‘†๐Ÿš“๐Ÿฉ๐Ÿ’ฉ๐Ÿ“ฏ๐Ÿ—๐Ÿ™๐Ÿ‘›๐Ÿ“Œ๐Ÿ‡๐ŸŽ๐Ÿ“ป๐Ÿ€๐ŸŽ€๐Ÿš๐Ÿ’๐Ÿš€๐Ÿ“๐ŸŒน๐Ÿšจ๐Ÿ“๐Ÿƒ๐ŸŽ…๐Ÿ“ก๐ŸŽทโœ‚๏ธ๐Ÿš๐Ÿ‘•๐Ÿšฟ๐Ÿ’€๐Ÿ˜„๐ŸŒ๐Ÿโ„๏ธโ›„๏ธ๐Ÿ˜ญโšฝ๏ธ๐Ÿ”‰๐Ÿ‘พ๐Ÿ’ฌโญ๏ธ๐Ÿ“๐Ÿ˜Ž๐Ÿ’ฆ๐ŸŠ๐Ÿ’‰๐Ÿ”ญ๐ŸŽพ๐Ÿ’ญ๐Ÿšฝ๐Ÿ‘…๐ŸŽฉ๐Ÿšฅ๐Ÿ†๐ŸŽบ๐Ÿข๐Ÿšฆ๐Ÿ“ผ๐ŸŽฎ๐ŸŽปโŒš๏ธ๐Ÿ‹๐Ÿท๐Ÿบ๐Ÿ”งโšก๏ธ๐Ÿ’ค

api

varย baseEmojiย =ย require('base-emoji')
varย bufย =ย newย Buffer('deadbeef',ย 'hex')
baseEmoji.toUnicode(buf)
//ย =>ย 'โ„๐Ÿผ๐Ÿš“๐Ÿ‘…'ย 
baseEmoji.toNames(buf)
//ย =>ย ':snowflake::panda_face::police_car::tongue:'ย 
baseEmoji.toCustom(buf,ย function(v,ย emoji)ย {
ย ย returnย '<imgย src="/img/emoji/'+emoji.name+'.png"ย alt="'+emoji.char+'"ย title="'+emoji.name+'">'
})
//ย =>ย '<imgย src="/img/emoji/snowflake.png"ย alt="โ„"ย title="snowflake">...'ย 
baseEmoji.fromUnicode(baseEmoji.toUnicode(buf))
//ย =>ย <Bufferย deย adย beย ef>ย 

encoding

The emojis used are in emojis.json. There are 843 emojis there, but the converter reads sequences of 8 bits at a time, and so only maps the value to the first 256 of them. To stay consistent with other renderings, make sure you don't change the order of your emojis.json.