Socket
Socket
Sign inDemoInstall

ast-metadata-inferer

Package Overview
Dependencies
1
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    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)


Version published
Weekly downloads
446K
decreased by-11.12%
Maintainers
1
Install size
28.7 MB
Created
Weekly downloads
 

Readme

Source

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" },
//       ...
//     }
//   }
// }

FAQs

Last updated on 09 Feb 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc