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'
|
2018-12-18 20:45:49 +00:00
|
|
|
|
2019-01-19 23:06:25 +00:00
|
|
|
const readFile = promisify(fs.readFile)
|
2020-06-29 07:12:14 +01:00
|
|
|
const writeFile = promisify(fs.writeFile)
|
2018-12-18 20:45:49 +00:00
|
|
|
|
|
|
|
async function main () {
|
2020-11-14 22:13:22 +00:00
|
|
|
const json = JSON.parse(await readFile(
|
|
|
|
path.resolve(__dirname, '../node_modules/emoji-picker-element-data/en/emojibase-legacy/data.json'),
|
2020-06-29 07:12:14 +01:00
|
|
|
'utf8')
|
|
|
|
)
|
|
|
|
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)
|
|
|
|
})
|