element-web/scripts/emoji-data-strip.js
Luke Barnard 30f80b57f2 Instead of making this part of the build process, let the devs generate stripped-emoji.json
With the expectation that when the file needs to be regenerated to include other keys, the developer will run this script.
2017-06-28 13:28:48 +01:00

18 lines
521 B
JavaScript

#!/usr/bin/env node
const EMOJI_DATA = require('emojione/emoji.json');
const fs = require('fs');
const output = Object.keys(EMOJI_DATA).map(
(key) => {
const datum = EMOJI_DATA[key];
return {
name: datum.name,
shortname: datum.shortname,
category: datum.category,
emoji_order: datum.emoji_order,
};
},
);
// Write to a file in src. Changes should be checked in to git
fs.writeFileSync('./src/stripped-emoji.json', JSON.stringify(output));