@tgwf/co2
Version:
Work out the co2 of your digital services
8 lines (7 loc) • 3.04 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/constants/index.js"],
"sourcesContent": ["import fileSize from \"./file-size.js\";\nimport averageIntensity from \"../data/average-intensities.min.js\";\n\n// SUSTAINABLE WEB DESIGN CONSTANTS\n// this refers to the estimated total energy use for the internet around 2000 TWh,\n// divided by the total transfer it enables around 2500 exabytes\nconst KWH_PER_GB = 0.81;\n\n// these constants outline how the energy is attributed to\n// different parts of the system in the SWD model\nconst END_USER_DEVICE_ENERGY = 0.52;\nconst NETWORK_ENERGY = 0.14;\nconst DATACENTER_ENERGY = 0.15;\nconst PRODUCTION_ENERGY = 0.19;\n\n// These carbon intensity figures https://ember-climate.org/data/data-explorer\n// - Global carbon intensity for 2023\nconst GLOBAL_GRID_INTENSITY = averageIntensity.data[\"WORLD\"];\nconst RENEWABLES_GRID_INTENSITY = 50;\n\n// Taken from: https://gitlab.com/wholegrain/carbon-api-2-0/-/blob/master/includes/carbonapi.php\n\nconst FIRST_TIME_VIEWING_PERCENTAGE = 0.75;\nconst RETURNING_VISITOR_PERCENTAGE = 0.25;\nconst PERCENTAGE_OF_DATA_LOADED_ON_SUBSEQUENT_LOAD = 0.02;\n\nconst SWDV4 = {\n OPERATIONAL_KWH_PER_GB_DATACENTER: 0.055,\n OPERATIONAL_KWH_PER_GB_NETWORK: 0.059,\n OPERATIONAL_KWH_PER_GB_DEVICE: 0.08,\n EMBODIED_KWH_PER_GB_DATACENTER: 0.012,\n EMBODIED_KWH_PER_GB_NETWORK: 0.013,\n EMBODIED_KWH_PER_GB_DEVICE: 0.081,\n GLOBAL_GRID_INTENSITY: 494,\n};\n\nconst SWDMV3_RATINGS = {\n FIFTH_PERCENTILE: 0.095,\n TENTH_PERCENTILE: 0.186,\n TWENTIETH_PERCENTILE: 0.341,\n THIRTIETH_PERCENTILE: 0.493,\n FORTIETH_PERCENTILE: 0.656,\n FIFTIETH_PERCENTILE: 0.846,\n};\n\nconst SWDMV4_RATINGS = {\n FIFTH_PERCENTILE: 0.04,\n TENTH_PERCENTILE: 0.079,\n TWENTIETH_PERCENTILE: 0.145,\n THIRTIETH_PERCENTILE: 0.209,\n FORTIETH_PERCENTILE: 0.278,\n FIFTIETH_PERCENTILE: 0.359,\n};\n\nexport {\n fileSize,\n KWH_PER_GB,\n END_USER_DEVICE_ENERGY,\n NETWORK_ENERGY,\n DATACENTER_ENERGY,\n PRODUCTION_ENERGY,\n GLOBAL_GRID_INTENSITY,\n RENEWABLES_GRID_INTENSITY,\n FIRST_TIME_VIEWING_PERCENTAGE,\n RETURNING_VISITOR_PERCENTAGE,\n PERCENTAGE_OF_DATA_LOADED_ON_SUBSEQUENT_LOAD,\n SWDV4,\n SWDMV3_RATINGS,\n SWDMV4_RATINGS,\n};\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAAAA;AAAA;AAAA;AAAA,uBAAqB;AACrB,qCAA6B;AAK7B,MAAM,aAAa;AAInB,MAAM,yBAAyB;AAC/B,MAAM,iBAAiB;AACvB,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAI1B,MAAM,wBAAwB,+BAAAC,QAAiB,KAAK;AACpD,MAAM,4BAA4B;AAIlC,MAAM,gCAAgC;AACtC,MAAM,+BAA+B;AACrC,MAAM,+CAA+C;AAErD,MAAM,QAAQ;AAAA,EACZ,mCAAmC;AAAA,EACnC,gCAAgC;AAAA,EAChC,+BAA+B;AAAA,EAC/B,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,4BAA4B;AAAA,EAC5B,uBAAuB;AACzB;AAEA,MAAM,iBAAiB;AAAA,EACrB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,qBAAqB;AACvB;AAEA,MAAM,iBAAiB;AAAA,EACrB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,qBAAqB;AACvB;",
"names": ["fileSize", "averageIntensity"]
}