Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@microsoft/api-extractor-model
Advanced tools
@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.
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);
});
TypeDoc is a documentation generator for TypeScript projects. It generates API documentation directly from the source code, similar to how @microsoft/api-extractor-model works with API reports. However, TypeDoc focuses more on generating HTML documentation rather than providing tools for programmatic inspection and manipulation of API data.
API Documenter is another tool from Microsoft that works in conjunction with API Extractor. It generates documentation in various formats (Markdown, HTML) from API reports. While it shares some functionality with @microsoft/api-extractor-model, it is more focused on documentation generation rather than API data manipulation.
ts-morph is a TypeScript compiler API wrapper that simplifies working with TypeScript AST (Abstract Syntax Tree). It allows for programmatic inspection and manipulation of TypeScript code, similar to how @microsoft/api-extractor-model allows for inspection and manipulation of API reports. However, ts-morph operates at the source code level rather than the API metadata level.
FAQs
A helper library for loading and saving the .api.json files created by API Extractor
The npm package @microsoft/api-extractor-model receives a total of 805,418 weekly downloads. As such, @microsoft/api-extractor-model popularity was classified as popular.
We found that @microsoft/api-extractor-model demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.