Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/api-extractor-model > ApiModel > tryGetPackageByName

ApiModel.tryGetPackageByName() method​

Efficiently finds a package by the NPM package name.

Signature:

tryGetPackageByName(packageName: string): ApiPackage | undefined;

Parameters​

Parameter

Type

Description

packageName

string

Returns:

ApiPackage | undefined

Remarks​

If the NPM scope is omitted in the package name, it will still be found provided that it is an unambiguous match. For example, it's often convenient to write {@link node-core-library#JsonFile} instead of {@link @rushstack/node-core-library#JsonFile}.