(filePath)
| 159 | } |
| 160 | |
| 161 | async function formatSize(filePath) { |
| 162 | const { size } = await stat(filePath); |
| 163 | if (size < 1024) return `${size} B`; |
| 164 | if (size < 1024 * 1024) return `${(size / 1024).toFixed(1)} KB`; |
| 165 | return `${(size / 1024 / 1024).toFixed(1)} MB`; |
| 166 | } |
| 167 | |
| 168 | run().catch(err => { |
| 169 | console.error(err.stack || err.message); |