UNPKG

586 BJavaScriptView Raw
1var fs = require('fs'),
2 template = fs.readFileSync(__dirname + '/template.js').toString(),
3 types = [
4 'emoticons',
5 'nature',
6 'objects',
7 'people',
8 'places',
9 'symbols'
10 ],
11 all = [];
12
13types.forEach(function (type) {
14 var object = JSON.parse(fs.readFileSync('json/' + type + '.json').toString());
15 all = all.concat(Object.keys(object));
16});
17
18all.forEach(function (item, index) {
19 all[index] = ':' + all[index] + ':';
20});
21
22fs.writeFileSync('emoji-images.js', template.replace("{{data}}", JSON.stringify(all)), 'utf-8');