UNPKG

apisurf

Version:

Analyze API surface changes between npm package versions to catch breaking changes

20 lines (19 loc) 773 B
import { ApiSurface } from '../types/ApiSurface.js'; /** * Extracts the API surface of a package from a specific Git branch or commit. * Attempts to parse TypeScript source files and falls back to JavaScript analysis. */ export declare function extractApiSurface(pkg: { name: string; path: string; }, branch: string): Promise<ApiSurface>; /** * Parses CommonJS modules using static analysis. * Fallback when VM-based analysis fails. */ export declare function parseCommonJSStatically(sourceContent: string, packageName: string, version: string): ApiSurface; /** * Loads a CommonJS module using Node.js VM for dynamic analysis. * Provides safer execution environment for untrusted code. */ export declare function loadModuleWithVM(modulePath: string): any;