@mdn/browser-compat-data 5.5.13 → 5.5.15
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/README.md +29 -0
- package/data.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,15 @@ yarn add @mdn/browser-compat-data
|
|
|
23
23
|
Then, you can import BCD into your project with either `import` or `require()`:
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
|
+
// ESM with Import Attributes (NodeJS 20+)
|
|
27
|
+
import bcd from '@mdn/browser-compat-data' with { type: 'json' };
|
|
28
|
+
// ...or...
|
|
29
|
+
const { default: bcd } = await import('@mdn/browser-compat-data', {
|
|
30
|
+
with: { type: 'json' },
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// ...or...
|
|
34
|
+
|
|
26
35
|
// ESM with Import Assertions (NodeJS 16+)
|
|
27
36
|
import bcd from '@mdn/browser-compat-data' assert { type: 'json' };
|
|
28
37
|
// ...or...
|
|
@@ -48,6 +57,19 @@ const bcd = require('@mdn/browser-compat-data');
|
|
|
48
57
|
You can import `@mdn/browser-compat-data` using a CDN.
|
|
49
58
|
|
|
50
59
|
```js
|
|
60
|
+
// ESM with Import Attributes (Deno 1.37+)
|
|
61
|
+
import bcd from 'https://unpkg.com/@mdn/browser-compat-data' with { type: 'json' };
|
|
62
|
+
// ...or...
|
|
63
|
+
const { default: bcd } = await import(
|
|
64
|
+
'https://unpkg.com/@mdn/browser-compat-data',
|
|
65
|
+
{
|
|
66
|
+
with: { type: 'json' },
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// ...or...
|
|
71
|
+
|
|
72
|
+
// ESM with Import Assertions (Deno 1.17+)
|
|
51
73
|
import bcd from 'https://unpkg.com/@mdn/browser-compat-data' assert { type: 'json' };
|
|
52
74
|
// ...or...
|
|
53
75
|
const { default: bcd } = await import(
|
|
@@ -56,6 +78,13 @@ const { default: bcd } = await import(
|
|
|
56
78
|
assert: { type: 'json' },
|
|
57
79
|
}
|
|
58
80
|
);
|
|
81
|
+
|
|
82
|
+
// ...or...
|
|
83
|
+
|
|
84
|
+
// Fetch Method (Deno 1.0+)
|
|
85
|
+
const bcd = await fetch('https://unpkg.com/@mdn/browser-compat-data').then(
|
|
86
|
+
(response) => response.json(),
|
|
87
|
+
);
|
|
59
88
|
```
|
|
60
89
|
|
|
61
90
|
### Other Languages
|