UNPKG

cardamon

Version:

A CLI tool for measuring the carbon footprint and energy consumption of web pages using the Cardamon model

1 lines 860 B
'use strict';Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['bytesToMB']=bytesToMB,exports['msToSeconds']=msToSeconds,exports['formatNumber']=formatNumber,exports['wsToWh']=wsToWh,exports['generateMetricsSummary']=generateMetricsSummary;function bytesToMB(_0x41639e){return _0x41639e/(0x400*0x400);}function msToSeconds(_0x1ec010){return _0x1ec010/0x3e8;}function formatNumber(_0x292901,_0x335511=0x2){return _0x292901['toFixed'](_0x335511);}function wsToWh(_0x1f588f){return _0x1f588f/0xe10;}function generateMetricsSummary(_0x4679af){return Object['entries'](_0x4679af)['map'](([_0x59c57a,_0x5f0b1f])=>{if(typeof _0x5f0b1f==='object')return _0x59c57a+':\x0a'+generateMetricsSummary(_0x5f0b1f)['split']('\x0a')['map'](_0x331836=>'\x20\x20'+_0x331836)['join']('\x0a');return _0x59c57a+':\x20'+formatNumber(_0x5f0b1f);})['join']('\x0a');}