MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / formatBytes

Function formatBytes

packages/cli/src/ui/format.ts:3–7  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

1import { c } from "./colors.js";
2
3export function formatBytes(bytes: number): string {
4 if (bytes < 1024) return `${bytes} B`;
5 if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
6 return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
7}
8
9export function formatDuration(ms: number): string {
10 const seconds = ms / 1000;

Callers 7

runFunction · 0.50
printRenderCompleteFunction · 0.50
runFunction · 0.50
runEnsureFunction · 0.50
runFunction · 0.50
maybeUploadProjectFunction · 0.50
streamVideoFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected