You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+95-9
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
By the [W3C WebDX Community Group](https://www.w3.org/community/webdx/) and contributors.
4
4
5
-
`baseline-browser-mapping` exposes arrays of browsers compatible with Baseline Widely Available and specified Baseline year feature sets.
5
+
`baseline-browser-mapping` exposes arrays of browsers compatible with Baseline Widely available and specified Baseline year feature sets.
6
6
You can use `baseline-browser-mapping` to help you determine minimum browser version support for your chosen Baseline feature set.
7
7
8
8
## Prerequisites
@@ -25,11 +25,9 @@ To install the package, run:
25
25
]
26
26
```
27
27
28
-
## Usage
28
+
## Get Baseline Widely available browser versions
29
29
30
-
### Get Baseline Widely Available browser versions
31
-
32
-
To get the current list of minimum browser versions compatible with Baseline Widely Available features from the core browser set, call the `getCompatibleVersions()` function with:
30
+
To get the current list of minimum browser versions compatible with Baseline Widely available features from the core browser set, call the `getCompatibleVersions()` function:
@@ -64,9 +62,9 @@ Executed on 7th March 2025, the above code returns the following browser version
64
62
```
65
63
66
64
> [!NOTE]
67
-
> The minimum versions of each browser are not strictly the final release before the Widely Available cutoff date of `TODAY - 30 MONTHS`. Some earlier versions will have supported the full Widely Available feature set.
65
+
> The minimum versions of each browser are not strictly the final release before the Widely available cutoff date of `TODAY - 30 MONTHS`. Some earlier versions will have supported the full Widely available feature set.
`getCompatibleVersions()` accepts an `Object` as an argument with configuration options. The defaults are as follows:
72
70
@@ -118,7 +116,7 @@ Returns the following versions:
118
116
119
117
#### `widelyAvailableOnDate`
120
118
121
-
The `widelyAvailableOnDate` options returns the minimum versions compatible with Baseline Widely Available on a specified date in the formay `YYYY-MM-DD`:
119
+
The `widelyAvailableOnDate` options returns the minimum versions compatible with Baseline Widely available on a specified date in the formay `YYYY-MM-DD`:
122
120
123
121
```javascript
124
122
getCompatibleVersions({
@@ -127,7 +125,7 @@ getCompatibleVersions({
127
125
```
128
126
129
127
> [!TIP]
130
-
> This can be particularly useful if you provide a versioned library that target Baseline Widely Available on each version's release date and want to provide a table of minimum supported browsers in your documentation.
128
+
> This can be particularly useful if you provide a versioned library that target Baseline Widely available on each version's release date and want to provide a table of minimum supported browsers in your documentation.
131
129
132
130
#### `includeDownstreamBrowsers`
133
131
@@ -151,6 +149,94 @@ getCompatibleVersions({
151
149
});
152
150
```
153
151
152
+
## Get data for all browser versions
153
+
154
+
You may want to obtain data on all the browser versions available in this module for use in an analytics solution or dashboard. To get details of each browser version's level of Baseline support, call the `getAllVersions()` function:
By default, this function returns an `Array` of `Objects` and excludes downstream browsers:
163
+
164
+
```javascript
165
+
[
166
+
...
167
+
{
168
+
browser:'chrome_android', // Browser name
169
+
version:'68', // Browser version as a string
170
+
release_date:'2018-07-24', // Release date
171
+
year:2019, //Baseline year feature set the version supports
172
+
waCompatible:false// Boolean indicating whether the version is compatible with Baseline Widely available
173
+
},
174
+
...
175
+
]
176
+
```
177
+
178
+
### `getAllVersions()` Configuration options
179
+
180
+
`getAllVersions()` accepts an `Object` as an argument with configuration options. The defaults are as follows:
181
+
182
+
```javascript
183
+
{
184
+
includeDownstreamBrowsers:false,
185
+
outputFormat:"array"
186
+
}
187
+
```
188
+
189
+
#### `includeDownstreamBrowsers` (in `getAllVersions()` output)
190
+
191
+
As with `getCompatibleVersions()`, you can set `includeDownstreamBrowsers` to `true` to include the Chromium downstream browsers [listed below](#list-of-downstream-browsers).
192
+
193
+
```javascript
194
+
getAllVersions({
195
+
includeDownstreamBrowsers:true,
196
+
});
197
+
```
198
+
199
+
Downstream browsers include the same properties as core browsers, as well as the engine they use and which version of that engine they implement, for example:
200
+
201
+
```javascript
202
+
[
203
+
...
204
+
{
205
+
"browser":"samsunginternet_android",
206
+
"version":"18.0",
207
+
"release_date":"2022-08-08",
208
+
"engine":"Blink",
209
+
"engine_version":"99",
210
+
"year":2021,
211
+
"waCompatible":false
212
+
},
213
+
...
214
+
]
215
+
```
216
+
217
+
#### `outputFormat`
218
+
219
+
By default, this function returns an `Array` of `Objects` which can be manipulated in Javascript or output to JSON. To return a `String` in CSV format, set `outputFormat` to `csv`:
220
+
221
+
```javascript
222
+
getAllVersions({
223
+
outputFormat:"csv",
224
+
});
225
+
```
226
+
227
+
`getAllVersions` returns a `String` with a header row and comma-separated values for each browser version that you can write to a file or pass to another service. Core browsers will have "NULL" as the value for their `engine` and `engine_version`:
0 commit comments