import { GifsicleModule } from './gifsicle' ; Module . preRun = Module . preRun || [ ] ; Module . preRun . push ( function writeInputFile ( ) { const data = ( Module as GifsicleModule ) . input ; FS . writeFile ( '/input.gif' , data ) ; } ) ; Module . postRun = Module . postRun || [ ] ; Module . postRun . push ( function getOutputFile ( ) { const data = FS . readFile ( '/output.gif' ) ; ( Module as GifsicleModule ) . output ( data ) ; } ) ;