1. 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)
ast-metadata-inferer
Package: ast-metadata-inferer
Created by: amilajack
Last modified: Thu, 09 Feb 2023 06:56:06 GMT
Version: 0.8.0
License: MIT
Downloads: 1,947,242
Repository: https://github.com/amilajack/ast-metadata-inferer

Install

npm install ast-metadata-inferer
yarn add ast-metadata-inferer

ast-metadata-inferer

Test

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

 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 POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code