MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / formatSize

Function formatSize

scripts/lighthouse-bundle-and-upload.mjs:161–166  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

159}
160
161async 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
168run().catch(err => {
169 console.error(err.stack || err.message);

Callers 1

prepareCellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected