const fs = require ( 'fs' ) ; const path = require ( 'path' ) ; const { gzipSync } = require ( 'zlib' ) ; const { compress } = require ( 'brotli' ) ; export function readFileSizeSync ( filePath ) { if ( ! fs . existsSync ( filePath ) ) { return ; } const file = fs . readFileSync ( filePath ) as string ; const gzipped = gzipSync ( file ) as string ; const compressed = compress ( file ) as string ; return { name : path . basename ( filePath ) as string , size : gzipped . length , brotli : compressed . length , minSize : file . length , } ; }