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