2018-12-18 20:45:49 +00:00
|
|
|
import path from 'path'
|
|
|
|
import fs from 'fs'
|
2019-01-19 23:06:25 +00:00
|
|
|
import { promisify } from 'util'
|
2020-06-29 06:12:14 +00:00
|
|
|
import trimEmojiData from 'emoji-picker-element/trimEmojiData.cjs'
|
2018-12-18 20:45:49 +00:00
|
|
|
|
2019-01-19 23:06:25 +00:00
|
|
|
const readFile = promisify(fs.readFile)
|
2020-06-29 06:12:14 +00:00
|
|
|
const writeFile = promisify(fs.writeFile)
|
2018-12-18 20:45:49 +00:00
|
|
|
|
|
|
|
async function main () {
|
2020-06-29 06:12:14 +00: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 20:45:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
main().catch(err => {
|
|
|
|
console.error(err)
|
|
|
|
process.exit(1)
|
|
|
|
})
|