Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/api-extractor-model

Package Overview
Dependencies
Maintainers
2
Versions
197
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/api-extractor-model

A helper library for loading and saving the .api.json files created by API Extractor

  • 7.17.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
679K
decreased by-48.17%
Maintainers
2
Weekly downloads
 
Created

What is @microsoft/api-extractor-model?

@microsoft/api-extractor-model is a library that provides tools for analyzing and processing API metadata. It is primarily used to work with API reports generated by API Extractor, enabling developers to programmatically inspect and manipulate API data.

What are @microsoft/api-extractor-model's main functionalities?

Loading API Reports

This feature allows you to load an API report JSON file and inspect its contents. The code sample demonstrates how to load an API report and print the package name.

const { ApiModel } = require('@microsoft/api-extractor-model');
const apiModel = new ApiModel();
const apiPackage = apiModel.loadPackage('path/to/api-report.json');
console.log(apiPackage.name);

Inspecting API Members

This feature allows you to inspect the members of an API package. The code sample demonstrates how to iterate over the members of an API package and print their display names.

const { ApiModel } = require('@microsoft/api-extractor-model');
const apiModel = new ApiModel();
const apiPackage = apiModel.loadPackage('path/to/api-report.json');
apiPackage.members.forEach(member => {
  console.log(member.displayName);
});

Comparing API Reports

This feature allows you to compare two API reports to identify changes. The code sample demonstrates how to load two API reports, compare them, and print the changes.

const { ApiModel } = require('@microsoft/api-extractor-model');
const apiModel = new ApiModel();
const oldApiPackage = apiModel.loadPackage('path/to/old-api-report.json');
const newApiPackage = apiModel.loadPackage('path/to/new-api-report.json');
const changes = oldApiPackage.compareWith(newApiPackage);
changes.forEach(change => {
  console.log(change.kind, change.name);
});

Other packages similar to @microsoft/api-extractor-model

FAQs

Package last updated on 23 Apr 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc