git ssb

10+

Matt McKegg / patchwork



Tree: 99aead0a4c4797532b2986ba64d8c30f3d3c5993

Files: 99aead0a4c4797532b2986ba64d8c30f3d3c5993 / modules / emoji.js

415 bytesRaw
1var fs = require('fs')
2var Path = require('path')
3
4var emojiPath = Path.join(__dirname, '../assets/img/emoji')
5
6var emojiNames = fs.readdirSync(emojiPath)
7 .filter(name => Path.extname(name) === '.png')
8 .map(name => Path.basename(name, '.png'))
9
10exports.emoji_names = function () {
11 return emojiNames
12}
13
14exports.emoji_url = function (emoji) {
15 return emojiNames.includes(emoji) && `./img/emoji/${emoji}.png`
16}
17

Built with git-ssb-web