@@ -31,6 +31,7 @@ import { tryGetPackageAPI } from './try-get-package-api';
3131 * @param mirrors - URLs of registry mirrors (default: npm registry mirrors)
3232 * @param ignoreLicense - if `true`, extract API from unlicensed or proprietary packages (default: `false`)
3333 * @param ignoreFilePatternOptimizations - if `true`, ignore file pattern optimizations for known npm packages (default: `false`)
34+ * @param skipAPIExtraction - if `true`, do not extract the API from the package (default: `false`)
3435 *
3536 * @see {@link RegistryPackageInfo }
3637 */
@@ -41,13 +42,15 @@ export async function analyzeRegistryPackage({
4142 mirrors,
4243 ignoreLicense,
4344 ignoreFilePatternOptimizations,
45+ skipAPIExtraction = false ,
4446} : {
4547 name : string ;
4648 version ?: string ;
4749 registry ?: string ;
4850 mirrors ?: string [ ] ;
4951 ignoreLicense ?: boolean ;
5052 ignoreFilePatternOptimizations ?: boolean ;
53+ skipAPIExtraction ?: boolean ;
5154} ) : Promise < RegistryPackageInfo > {
5255 const start = performance . now ( ) ;
5356 log ( 'analyzeRegistryPackage: analyzing package: %O' , { name, version } ) ;
@@ -61,6 +64,17 @@ export async function analyzeRegistryPackage({
6164 const { id } = manifest ;
6265 log ( 'analyzeRegistryPackage: got manifest: %O' , { id, manifest } ) ;
6366
67+ if ( skipAPIExtraction ) {
68+ log ( 'analyzeRegistryPackage: skipping API extraction: %O' , { id } ) ;
69+ return {
70+ id,
71+ manifest,
72+ api : undefined ,
73+ elapsed : Math . round ( performance . now ( ) - start ) ,
74+ createdAt : new Date ( ) . toISOString ( ) ,
75+ } ;
76+ }
77+
6478 const api = await tryGetPackageAPI ( {
6579 manifest,
6680 ignoreLicense,
0 commit comments