@tgwf/co2 0.13.5 → 0.13.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -18,6 +18,96 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
18
18
 
19
19
  # Released
20
20
 
21
+ ## [0.13.5] - 2023-07-5
22
+
23
+ ### Changed
24
+
25
+ - Automated monthly update of annual average grid intensity data.
26
+
27
+ ## [0.13.4] - 2023-05-24
28
+
29
+ ### Fixed
30
+
31
+ - Fixed an error when try to use global grid intensities in IIFE. (PR #147)
32
+
33
+ ## [0.13.3] - 2023-05-18
34
+
35
+ ### Changed
36
+
37
+ - Updated the global grid intensity constant to use the latest WORLD grid intensity value from Ember. (PR #142)
38
+
39
+ ## [0.13.2] - 2023-04-21
40
+
41
+ - Fix to ensure that region names that are keys in the average annual grid intensity export are capitalised.
42
+
43
+ ## [0.13.1] - 2023-04-20
44
+
45
+ ### Fixed
46
+
47
+ - Fixed the import of average grid intensities in node. (PR #137)
48
+
49
+ ## [0.13.0] - 2023-04-13
50
+
51
+ ### Changed
52
+
53
+ In PR #135 there were significant changes made to how average annual grid intensities are fetched and generated.
54
+
55
+ - Updated average annual grid intensities to include 2022 values from Ember.
56
+ - Changed the functions to generate average grid intensities to:
57
+ - Fetch data directly from Ember's API.
58
+ - Get the *latest* annual average values for each country/region.
59
+ - Renamed the average grid intensities export file.
60
+
61
+ ## [0.12.2] - 2023-03-01
62
+
63
+ ### Added
64
+
65
+ - Add a module declaration for use from typescript (PR #131)
66
+
67
+ ### Changed
68
+
69
+ - Updated 2021 average annual grid intensity values (PR #133)
70
+
71
+ ## [0.12.1] - 2023-02-02
72
+
73
+ ### Fixed
74
+
75
+ - Removed incorrectly imported constants in tests.
76
+
77
+ ## [0.12.0] - 2023-02-02
78
+
79
+ ### Added
80
+
81
+ - Introduced two new functions `perByteTrace` and `perVisitTrace` which allow developers to pass an options object containing customised values for the constants used in the Sustainable Web Design model. (PR #126)
82
+
83
+ ### Changed
84
+
85
+ - Allowed developers now have the option to return a breakdown of carbon emissions estimates by system segment when using the Sustainable Web Design model. (PR #113)
86
+
87
+ ## [0.11.4] - 2022-12-02
88
+
89
+ ### Fixed
90
+
91
+ - Updated the `greenCheckMulti` function to work properly in ESM. (PR #123)
92
+
93
+ ## [0.11.3] - 2022-10-13
94
+
95
+ ### Fixed
96
+
97
+ - Corrected the Node export for the hosting raised in issue #110. (PR #118)
98
+
99
+ ## [0.11.2] - 2022-10-11
100
+
101
+ ### Fixed
102
+
103
+ - v0.11.x updates increased library size to 17MB + when published to NPM. This has been raised in [#108](https://github.com/thegreenwebfoundation/co2.js/issues/108) and it was found data files were being included in the published package. (PR #117)
104
+
105
+ ## [0.11.1] - 2022-10-07
106
+
107
+ ### Changed
108
+
109
+ - We have used generic filenames for data files, to avoid any confusion around the data being provided in this library. (PR #112)
110
+
21
111
  ## [0.11.0] - 2022-10-03
22
112
 
23
113
  ### Added
@@ -33,13 +123,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
123
  - Changed the default model for transfer based CO2 calculations from the _1byte_ model to the _Sustainable Web Design_ model instead. See https://developers.thegreenwebfoundation.org/co2js/models/ for guidance on the differences and how to migrate between them. See [#94 for more](https://github.com/thegreenwebfoundation/co2.js/issues/94).
34
124
  - Updated our release commands to generate and format the carbon intensity data as part of the release process.
35
125
 
36
- ## 0.10.4 2022-08-12
126
+ ## [0.10.4] - 2022-08-12
37
127
 
38
128
  ### Added
39
129
 
40
130
  - Introduced a `release:patch` command, to automate the publishing process. This is designed to make sure we always publish the most recent compiled code, by adding a rebuild step that can be easy to forget.
41
131
 
42
- ## 0.10.3 2022-08-12
132
+ ## [0.10.3] - 2022-08-12
43
133
 
44
134
  ### Added
45
135
 
package/README.md CHANGED
@@ -117,3 +117,14 @@ The average carbon intensity data from Ember is published under the Creative Com
117
117
  The marginal intensity data is published by the Green Web Foundation, under the Creative Commons ShareAlike Attribution Licence ([CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)). ([What does this mean?](https://www.tldrlegal.com/license/creative-commons-attribution-share-alike-cc-sa))
118
118
 
119
119
  See LICENCE for more.
120
+
121
+ ## Contributors
122
+
123
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
124
+ <!-- prettier-ignore-start -->
125
+ <!-- markdownlint-disable -->
126
+
127
+ <!-- markdownlint-restore -->
128
+ <!-- prettier-ignore-end -->
129
+
130
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
@@ -1,225 +1,226 @@
1
1
  const data = {
2
- AFG: 120.482,
3
- AFRICA: 491.69,
4
- ALB: 23.438,
5
- DZA: 498.904,
2
+ AFG: 120.48,
3
+ AFRICA: 510.26,
4
+ ALB: 23.44,
5
+ DZA: 498.9,
6
6
  ASM: 687.5,
7
- AGO: 195.983,
8
- ATG: 657.143,
9
- ARG: 338.275,
10
- ARM: 222.678,
11
- ABW: 591.398,
12
- ASIA: 532.12,
13
- AUS: 503.179,
7
+ AGO: 195.98,
8
+ ATG: 657.14,
9
+ ARG: 344.31,
10
+ ARM: 222.68,
11
+ ABW: 591.4,
12
+ ASEAN: 505.72,
13
+ ASIA: 535.1,
14
+ AUS: 501.7,
14
15
  AUT: 157.52,
15
- AZE: 532.902,
16
- BHS: 698.113,
16
+ AZE: 532.9,
17
+ BHS: 698.11,
17
18
  BHR: 489.77,
18
- BGD: 577.027,
19
+ BGD: 577.03,
19
20
  BRB: 644.86,
20
- BLR: 415.641,
21
- BEL: 165.363,
22
- BLZ: 484.375,
23
- BEN: 666.667,
24
- BTN: 24.444,
25
- BOL: 323.869,
26
- BIH: 517.241,
27
- BWA: 794.521,
28
- BRA: 101.986,
29
- BRN: 658.849,
30
- BGR: 399.565,
31
- BFA: 611.429,
21
+ BLR: 415.64,
22
+ BEL: 165.36,
23
+ BLZ: 484.38,
24
+ BEN: 666.67,
25
+ BTN: 24.44,
26
+ BOL: 323.87,
27
+ BIH: 517.24,
28
+ BWA: 794.52,
29
+ BRA: 102.09,
30
+ BRN: 658.85,
31
+ BGR: 399.57,
32
+ BFA: 611.43,
32
33
  BDI: 250,
33
34
  CPV: 600,
34
35
  KHM: 400.46,
35
- CMR: 278.261,
36
- CAN: 127.816,
37
- CYM: 684.932,
36
+ CMR: 278.26,
37
+ CAN: 125.84,
38
+ CYM: 684.93,
38
39
  CAF: 0,
39
- TCD: 677.419,
40
- CHL: 332.612,
41
- CHN: 531.151,
42
- COL: 168.954,
43
- COM: 714.286,
44
- COG: 395.522,
45
- COD: 25.362,
40
+ TCD: 677.42,
41
+ CHL: 332.61,
42
+ CHN: 533.98,
43
+ COL: 168.95,
44
+ COM: 714.29,
45
+ COG: 395.52,
46
+ COD: 25.36,
46
47
  COK: 400,
47
- CRI: 37.213,
48
- CIV: 410.747,
49
- HRV: 246.459,
50
- CUB: 602.025,
51
- CYP: 589.354,
52
- CZE: 415.345,
53
- DNK: 180.709,
54
- DJI: 666.667,
55
- DMA: 529.412,
56
- DOM: 550.881,
57
- ECU: 188.708,
58
- EGY: 485.367,
59
- SLV: 194.226,
60
- GNQ: 492.958,
61
- ERI: 688.889,
62
- EST: 464.029,
63
- SWZ: 189.189,
64
- ETH: 25.187,
65
- EU: 277.37,
66
- EUROPE: 298.02,
48
+ CRI: 37.21,
49
+ CIV: 410.75,
50
+ HRV: 246.46,
51
+ CUB: 602.03,
52
+ CYP: 589.35,
53
+ CZE: 415.35,
54
+ DNK: 180.71,
55
+ DJI: 666.67,
56
+ DMA: 529.41,
57
+ DOM: 550.88,
58
+ ECU: 188.71,
59
+ EGY: 469.63,
60
+ SLV: 194.23,
61
+ GNQ: 492.96,
62
+ ERI: 688.89,
63
+ EST: 464.03,
64
+ SWZ: 189.19,
65
+ ETH: 25.19,
66
+ EU: 277.22,
67
+ EUROPE: 296.96,
67
68
  FLK: 500,
68
- FRO: 428.571,
69
- FJI: 289.474,
70
- FIN: 130.977,
71
- FRA: 84.817,
72
- GUF: 254.717,
73
- PYF: 471.429,
74
- G20: 440.49,
75
- G7: 341.12,
69
+ FRO: 428.57,
70
+ FJI: 289.47,
71
+ FIN: 130.98,
72
+ FRA: 84.82,
73
+ GUF: 254.72,
74
+ PYF: 471.43,
75
+ G20: 442.38,
76
+ G7: 343.92,
76
77
  GAB: 397.38,
77
78
  GMB: 700,
78
- GEO: 134.831,
79
- DEU: 385.467,
80
- GHA: 361.204,
81
- GRC: 343.822,
82
- GRL: 133.333,
83
- GRD: 714.286,
84
- GLP: 611.765,
79
+ GEO: 134.83,
80
+ DEU: 384.83,
81
+ GHA: 361.2,
82
+ GRC: 343.82,
83
+ GRL: 133.33,
84
+ GRD: 714.29,
85
+ GLP: 611.77,
85
86
  GUM: 670.33,
86
- GTM: 320.637,
87
- GIN: 208.633,
87
+ GTM: 320.64,
88
+ GIN: 208.63,
88
89
  GNB: 750,
89
- GUY: 642.276,
90
- HTI: 606.061,
91
- HND: 375.104,
92
- HKG: 683.972,
93
- HUN: 222.973,
94
- ISL: 28.557,
95
- IND: 632.406,
96
- IDN: 618.996,
97
- IRN: 493.595,
98
- IRQ: 498.869,
99
- IRL: 345.347,
90
+ GUY: 642.28,
91
+ HTI: 606.06,
92
+ HND: 375.1,
93
+ HKG: 683.97,
94
+ HUN: 222.97,
95
+ ISL: 28.56,
96
+ IND: 633.4,
97
+ IDN: 619.02,
98
+ IRN: 487.86,
99
+ IRQ: 498.87,
100
+ IRL: 346.33,
100
101
  ISR: 548.03,
101
- ITA: 371.692,
102
+ ITA: 371.69,
102
103
  JAM: 519.54,
103
- JPN: 482.87,
104
- JOR: 399.909,
105
- KAZ: 635.574,
106
- KEN: 100.568,
107
- KIR: 666.667,
108
- XKX: 768.733,
109
- KWT: 489.61,
110
- KGZ: 104.426,
111
- LAO: 242.182,
112
- "LATIN AMERICA AND CARIBBEAN": 240.38,
113
- LVA: 181.818,
114
- LBN: 594.752,
104
+ JPN: 494.86,
105
+ JOR: 399.91,
106
+ KAZ: 635.57,
107
+ KEN: 100.57,
108
+ KIR: 666.67,
109
+ XKX: 768.73,
110
+ KWT: 489.65,
111
+ KGZ: 104.43,
112
+ LAO: 242.18,
113
+ "LATIN AMERICA AND CARIBBEAN": 241.91,
114
+ LVA: 181.82,
115
+ LBN: 594.75,
115
116
  LSO: 20,
116
- LBR: 304.348,
117
- LBY: 550.421,
118
- LTU: 194.245,
119
- LUX: 168.142,
120
- MAC: 491.525,
121
- MDG: 483.254,
122
- MWI: 133.803,
123
- MYS: 543.737,
124
- MDV: 651.515,
125
- MLI: 466.077,
117
+ LBR: 304.35,
118
+ LBY: 550.42,
119
+ LTU: 194.25,
120
+ LUX: 168.14,
121
+ MAC: 491.53,
122
+ MDG: 483.25,
123
+ MWI: 133.8,
124
+ MYS: 543.87,
125
+ MDV: 651.52,
126
+ MLI: 466.08,
126
127
  MLT: 495,
127
128
  MTQ: 698.63,
128
- MRT: 526.596,
129
- MUS: 611.111,
130
- MEX: 421.402,
131
- "MIDDLE EAST": 515.47,
132
- MDA: 678.439,
133
- MNG: 749.656,
134
- MNE: 399.381,
129
+ MRT: 526.6,
130
+ MUS: 611.11,
131
+ MEX: 423.81,
132
+ "MIDDLE EAST": 512.24,
133
+ MDA: 678.44,
134
+ MNG: 749.66,
135
+ MNE: 399.38,
135
136
  MSR: 1000,
136
- MAR: 610.412,
137
- MOZ: 126.633,
138
- MMR: 344.365,
139
- NAM: 63.694,
137
+ MAR: 610.41,
138
+ MOZ: 126.63,
139
+ MMR: 344.37,
140
+ NAM: 63.69,
140
141
  NRU: 750,
141
142
  NPL: 24.51,
142
- NLD: 354.988,
143
- NCL: 610.119,
144
- NZL: 97.732,
145
- NIC: 354.212,
146
- NER: 622.222,
147
- NGA: 368.224,
148
- "NORTH AMERICA": 336.26,
149
- PRK: 157.785,
150
- MKD: 529.328,
151
- NOR: 28.818,
152
- OCEANIA: 446.55,
153
- OECD: 338.65,
154
- OMN: 488.272,
155
- PAK: 344.155,
156
- PSE: 465.116,
157
- PAN: 192.136,
158
- PNG: 526.749,
159
- PRY: 25.487,
160
- PER: 256.512,
161
- POL: 634.579,
162
- PRT: 234.029,
163
- PRI: 681.469,
164
- QAT: 489.76,
165
- REU: 519.031,
166
- ROU: 264.121,
167
- RUS: 367.189,
168
- RWA: 294.118,
169
- KNA: 681.818,
170
- LCA: 685.714,
143
+ NLD: 355.78,
144
+ NCL: 610.12,
145
+ NZL: 97.73,
146
+ NIC: 354.21,
147
+ NER: 622.22,
148
+ NGA: 368.22,
149
+ "NORTH AMERICA": 336.01,
150
+ PRK: 157.79,
151
+ MKD: 529.33,
152
+ NOR: 28.82,
153
+ OCEANIA: 449.43,
154
+ OECD: 341.08,
155
+ OMN: 488.27,
156
+ PAK: 344.16,
157
+ PSE: 465.12,
158
+ PAN: 192.14,
159
+ PNG: 526.75,
160
+ PRY: 25.49,
161
+ PER: 256.51,
162
+ POL: 634.58,
163
+ PRT: 234.03,
164
+ PRI: 681.47,
165
+ QAT: 489.68,
166
+ REU: 519.03,
167
+ ROU: 264.12,
168
+ RUS: 363.68,
169
+ RWA: 294.12,
170
+ KNA: 681.82,
171
+ LCA: 685.71,
171
172
  SPM: 800,
172
173
  VCT: 500,
173
- WSM: 470.588,
174
+ WSM: 470.59,
174
175
  STP: 600,
175
- SAU: 571.336,
176
- SEN: 523.132,
177
- SRB: 569.375,
178
- SYC: 615.385,
179
- SLE: 47.619,
180
- SGP: 488.775,
181
- SVK: 140.666,
182
- SVN: 237.378,
183
- SLB: 727.273,
184
- SOM: 634.146,
185
- ZAF: 708.989,
186
- KOR: 435.689,
187
- SSD: 684.211,
188
- ESP: 217.373,
189
- LKA: 462.997,
190
- SDN: 264.014,
191
- SUR: 356.436,
192
- SWE: 45.084,
193
- CHE: 45.622,
194
- SYR: 541.169,
195
- TWN: 561,
196
- TJK: 83.629,
197
- TZA: 366.748,
198
- THA: 502.305,
199
- PHL: 582.047,
200
- TGO: 460.317,
176
+ SAU: 557.78,
177
+ SEN: 523.13,
178
+ SRB: 569.38,
179
+ SYC: 615.39,
180
+ SLE: 47.62,
181
+ SGP: 488.78,
182
+ SVK: 140.67,
183
+ SVN: 237.38,
184
+ SLB: 727.27,
185
+ SOM: 634.15,
186
+ ZAF: 708.19,
187
+ KOR: 437.6,
188
+ SSD: 684.21,
189
+ ESP: 217.37,
190
+ LKA: 463,
191
+ SDN: 264.01,
192
+ SUR: 356.44,
193
+ SWE: 45.08,
194
+ CHE: 45.62,
195
+ SYR: 541.17,
196
+ TWN: 561.02,
197
+ TJK: 83.63,
198
+ TZA: 366.75,
199
+ THA: 501.57,
200
+ PHL: 582.05,
201
+ TGO: 460.32,
201
202
  TON: 625,
202
- TTO: 491.409,
203
- TUN: 469.428,
204
- TUR: 413.628,
205
- TKM: 490.187,
206
- TCA: 703.704,
207
- UGA: 52.273,
208
- UKR: 206.539,
209
- ARE: 461.845,
210
- GBR: 257.379,
211
- USA: 367.259,
203
+ TTO: 491.41,
204
+ TUN: 469.43,
205
+ TUR: 413.63,
206
+ TKM: 490.19,
207
+ TCA: 703.7,
208
+ UGA: 52.27,
209
+ UKR: 187.06,
210
+ ARE: 407.98,
211
+ GBR: 261.24,
212
+ USA: 367.26,
212
213
  URY: 114.81,
213
- UZB: 505.405,
214
- VUT: 571.429,
215
- VEN: 212.476,
216
- VNM: 376.828,
217
- VGB: 714.286,
218
- VIR: 685.714,
219
- WORLD: 436.33,
220
- YEM: 543.909,
221
- ZMB: 84.698,
222
- ZWE: 392.279,
214
+ UZB: 505.41,
215
+ VUT: 571.43,
216
+ VEN: 212.48,
217
+ VNM: 386.49,
218
+ VGB: 714.29,
219
+ VIR: 685.71,
220
+ WORLD: 437.26,
221
+ YEM: 543.91,
222
+ ZMB: 84.7,
223
+ ZWE: 392.28,
223
224
  };
224
225
  const type = "average";
225
226
  export { data, type };