UNPKG

@jsdocs-io/extractor

Version:

Analyze and extract the API from npm packages

42 lines 1.72 kB
import { RegistryPackageInfo } from '../types/registry-package-info'; /** * `analyzeRegistryPackage` analyzes a package hosted on a registry and * tries to extract its public API. * * @example * Analyze the latest version of package `query-registry` from the npm registry: * * ```typescript * import { analyzeRegistryPackage } from '@jsdocs-io/extractor'; * * (async () => { * const info = await analyzeRegistryPackage({ name: 'query-registry' }); * * // Output: 'query-registry' * console.log(info.manifest.name); * * // Output: 'string' * console.log(typeof info.api?.overview); * })(); * ``` * * @param name - package name * @param version - package version (default: `latest`) * @param registry - registry URL (default: npm registry) * @param mirrors - URLs of registry mirrors (default: npm registry mirrors) * @param ignoreLicense - if `true`, extract API from unlicensed or proprietary packages (default: `false`) * @param ignoreFilePatternOptimizations - if `true`, ignore file pattern optimizations for known npm packages (default: `false`) * @param skipAPIExtraction - if `true`, do not extract the API from the package (default: `false`) * * @see {@link RegistryPackageInfo} */ export declare function analyzeRegistryPackage({ name, version, registry, mirrors, ignoreLicense, ignoreFilePatternOptimizations, skipAPIExtraction, }: { name: string; version?: string; registry?: string; mirrors?: string[]; ignoreLicense?: boolean; ignoreFilePatternOptimizations?: boolean; skipAPIExtraction?: boolean; }): Promise<RegistryPackageInfo>; //# sourceMappingURL=analyze-registry-package.d.ts.map