# ast-metadata-inferer

> [![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)

Latest version **0.8.1** (published 2024-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install ast-metadata-inferer
pnpm add ast-metadata-inferer
yarn add ast-metadata-inferer
bun add ast-metadata-inferer
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.1 |
| Published | 2024-12-11 |
| First published | 2018-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Amila Welihinda |
| Maintainers | amilajack |

## Links

- npm: https://www.npmjs.com/package/ast-metadata-inferer
- Repository: https://github.com/amilajack/ast-metadata-inferer
- Homepage: https://github.com/amilajack/ast-metadata-inferer#readme
- Issues: https://github.com/amilajack/ast-metadata-inferer/issues
- npm.io page: https://npm.io/package/ast-metadata-inferer

## Dependencies (1)

- [@mdn/browser-compat-data](https://npm.io/package/@mdn/browser-compat-data.md) ^5.6.19

## Recent versions

- 0.8.1 (latest) — 2024-12-11
- 0.8.0-1 (next) — 2023-02-09
- 0.8.0 — 2023-02-09
- 0.8.0-0 — 2023-02-09
- 0.7.0 — 2021-08-19
- 0.6.0 — 2021-08-09
- 0.5.1 — 2021-07-18
- 0.5.0 — 2021-07-16
- 0.4.0 — 2020-06-27
- 0.4.0-0 — 2020-06-27
- 0.3.0 — 2020-06-10
- 0.3.0-1 — 2020-06-10
- 0.3.0-0 — 2020-06-08
- 0.2.0 — 2020-05-24
- 0.2.0-0 — 2020-05-15
- … 8 more at https://npm.io/package/ast-metadata-inferer/versions

## README

# ast-metadata-inferer

[![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)

A collection of metadata about browser API's. This collection is intended for tools that analyze JS. It currently supports more than 6,000 compatibility records.

For all the API's it supports, it gives the

- AST node type of the API (`MemberExpression`, `NewExpression`, or `CallExpression`)
- Determines if an API is statically invoked (ex. `document.querySelector()`)
- Determines if an API is a CSS or JS API
- Provides compatibility information from `@mdn/browser-compat-data`

## Usage

```js
import AstMetadata from "ast-metadata-inferer";

const [firstRecord] = AstMetadata;
console.log(firstRecord);
// {
//   "language":"js-api",
//   "protoChain":["document","querySelector"],
//   "protoChainId":"document.querySelector",
//   "astNodeTypes":["MemberExpression"],
//   "isStatic":true,
//   "compat": {
//     support: {
//       chrome: {
//         version_added: "14"
//       },
//       chrome_android: { version_added: "18" },
//       ...
//     }
//   }
// }
```

## Related

- [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat)
- [compat-db](https://github.com/amilajack/compat-db)

---
_Source: https://npm.io/package/ast-metadata-inferer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
