cardamon
Version:
A CLI tool for measuring the carbon footprint and energy consumption of web pages using the Cardamon model
25 lines • 674 B
TypeScript
/**
* utils.ts
* Utility functions for the Cardamon SDK
*/
/**
* Converts bytes to megabytes
*/
export declare function bytesToMB(bytes: number): number;
/**
* Converts milliseconds to seconds
*/
export declare function msToSeconds(ms: number): number;
/**
* Formats a number with a specific number of decimal places
*/
export declare function formatNumber(value: number, decimals?: number): string;
/**
* Converts watt-seconds to watt-hours
*/
export declare function wsToWh(ws: number): number;
/**
* Generates a human-readable summary of the metrics
*/
export declare function generateMetricsSummary(metrics: any): string;
//# sourceMappingURL=utils.d.ts.map