2018-12-18 21:45:49 +01:00
|
|
|
import path from 'path'
|
|
|
|
import fs from 'fs'
|
2019-01-20 00:06:25 +01:00
|
|
|
import { promisify } from 'util'
|
2020-06-29 08:12:14 +02:00
|
|
|
import trimEmojiData from 'emoji-picker-element/trimEmojiData.cjs'
|
2018-12-18 21:45:49 +01:00
|
|
|
|
2019-01-20 00:06:25 +01:00
|
|
|
const readFile = promisify(fs.readFile)
|
2020-06-29 08:12:14 +02:00
|
|
|
const writeFile = promisify(fs.writeFile)
|
2018-12-18 21:45:49 +01:00
|
|
|
|
|
|
|
async function main () {
|
2020-06-29 08:12:14 +02:00
|
|
|
let json = JSON.parse(await readFile(
|
|
|
|
path.resolve(__dirname, '../node_modules/emojibase-data/en/data.json'),
|
|
|
|
'utf8')
|
|
|
|
)
|
|
|
|
json = trimEmojiData(json)
|
|
|
|
await writeFile(
|
|
|
|
path.resolve(__dirname, '../static/emoji-all-en.json'),
|
|
|
|
JSON.stringify(json),
|
|
|
|
'utf8'
|
|
|
|
)
|
2018-12-18 21:45:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
main().catch(err => {
|
|
|
|
console.error(err)
|
|
|
|
process.exit(1)
|
|
|
|
})
|