1 | # ast-metadata-inferer
|
2 |
|
3 | [![Test](https://github.com/amilajack/ast-metadata-inferer/actions/workflows/test.yml/badge.svg)](https://github.com/amilajack/ast-metadata-inferer/actions/workflows/test.yml)
|
4 |
|
5 | A collection of metadata about browser API's. This collection is intended for tools that analyze JS. It currently supports `3993` compatibility records.
|
6 |
|
7 | For all the API's it supports, it gives the
|
8 |
|
9 | - AST node type of the API (`MemberExpression`, `NewExpression`, or `CallExpression`)
|
10 | - Determines if an API is statically invoked (ex. `document.querySelector()`)
|
11 | - Determines if an API is a CSS or JS API
|
12 | - Provides compatibility information from `@mdn/browser-compat-data`
|
13 |
|
14 | ## Usage
|
15 |
|
16 | ```js
|
17 | import AstMetadata from "ast-metadata-inferer";
|
18 |
|
19 | const [firstRecord] = AstMetadata;
|
20 | console.log(firstRecord);
|
21 | // {
|
22 | // "language":"js-api",
|
23 | // "protoChain":["document","querySelector"],
|
24 | // "protoChainId":"document.querySelector",
|
25 | // "astNodeTypes":["MemberExpression"],
|
26 | // "isStatic":true,
|
27 | // "compat": {
|
28 | // support: {
|
29 | // chrome: {
|
30 | // version_added: "14"
|
31 | // },
|
32 | // chrome_android: { version_added: "18" },
|
33 | // ...
|
34 | // }
|
35 | // }
|
36 | // }
|
37 | ```
|
38 |
|
39 | ## Support
|
40 |
|
41 | If this project is saving you (or your team) time, please consider supporting it on Patreon 👍 thank you!
|
42 |
|
43 | <p>
|
44 | <a href="https://www.patreon.com/amilajack">
|
45 | <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
|
46 | </a>
|
47 | </p>
|
48 |
|
49 | ## Related
|
50 |
|
51 | - [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat)
|
52 | - [compat-db](https://github.com/amilajack/compat-db)
|