Created
April 10, 2024 06:11
-
-
Save elsvv/ab3fa83c23713c789e739f32ec3b4767 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { readFileSync, writeFileSync } from 'fs'; | |
| import { join, resolve } from 'path'; | |
| const pako = require('pako'); | |
| function main() { | |
| const fileName = 'some-animoji'; | |
| const tgsFile = readFileSync(resolve(join(__dirname, `${fileName}.tgs`)), null).buffer; | |
| const jsonContent = new TextDecoder('utf-8').decode(pako.inflate(tgsFile)); | |
| // const animationData = JSON.parse(jsonContent); | |
| writeFileSync(join(__dirname, `${fileName}.json`), jsonContent, 'utf-8'); | |
| } | |
| main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment