Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
api-extractor-model-me
Advanced tools
A helper library for loading and saving the .api.json files created by API Extractor
Use this library to read and write *.api.json files as defined by the API Extractor tool. These files are used to generate a documentation website for your TypeScript package. The files store the API signatures and doc comments that were extracted from your package.
API documentation for this package: https://rushstack.io/pages/api/api-extractor-model/
The following code sample shows how to load example.api.json
, which would be generated by API Extractor
when it analyzes a hypothetical NPM package called example
:
import { ApiModel, ApiPackage } from '@microsoft/api-extractor-model';
const apiModel: ApiModel = new ApiModel();
const apiPackage: ApiPackage = apiModel.loadPackage('example.api.json');
for (const member of apiPackage.members) {
console.log(member.displayName);
}
The ApiModel
is acts as a container for various packages that are loaded and operated on as a group.
For example, a documentation tool may need to resolve @link
references across different packages.
In this case we would load the various packages into the ApiModel
, and then use
the ApiModel.resolveDeclarationReference()
to resolve the @link
targets.
The data structure forms a tree of various classes that start with the Api
prefix. The nesting hierarchy
might look like this:
- ApiModel
- ApiPackage
- ApiEntryPoint
- ApiClass
- ApiMethod
- ApiProperty
- ApiEnum
- ApiEnumMember
- ApiInterface
- ApiMethodSignature
- ApiPropertySignature
- ApiNamespace
- (ApiClass, ApiEnum, ApiInterace, ...)
You can use the ApiItem.members
property to traverse this tree.
Note that the non-abstract classes (e.g. ApiClass
, ApiEnum
, ApiInterface
, etc.) use
TypeScript "mixin" functions (e.g. ApiDeclaredItem
, ApiItemContainerMixin
, etc.) to add various
features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class
to extend more than one base class). The "mixin" is a TypeScript merged declaration with three components:
the function that generates a subclass, an interface that describes the members of the subclass, and
a namespace containing static members of the class.
For a complete project that uses these APIs to generate an API reference web site, see the @microsoft/api-documenter source code.
API Extractor is part of the Rush Stack family of projects.
FAQs
A helper library for loading and saving the .api.json files created by API Extractor
The npm package api-extractor-model-me receives a total of 752 weekly downloads. As such, api-extractor-model-me popularity was classified as not popular.
We found that api-extractor-model-me demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.