UNPKG

@nodesecure/tarball

Version:
61 lines 2.23 kB
import { type Warning, type Dependency } from "@nodesecure/js-x-ray"; import * as conformance from "@nodesecure/conformance"; import { ManifestManager, type PackageModuleType } from "@nodesecure/mama"; export interface DependencyRef { id: number; type: PackageModuleType; usedBy: Record<string, string>; isDevDependency: boolean; existOnRemoteRegistry: boolean; flags: string[]; description: string; size: number; author: Record<string, any>; engines: Record<string, any>; repository: any; scripts: Record<string, string>; warnings: any; licenses: conformance.SpdxFileLicenseConformance[]; uniqueLicenseIds: string[]; gitUrl: string | null; alias: Record<string, string>; composition: { extensions: string[]; files: string[]; minified: string[]; unused: string[]; missing: string[]; required_files: string[]; required_nodejs: string[]; required_thirdparty: string[]; required_subpath: Record<string, string>; }; } export declare function scanDirOrArchive(locationOrManifest: string | ManifestManager, ref: DependencyRef): Promise<void>; export interface ScannedPackageResult { files: { /** Complete list of files for the given package */ list: string[]; /** Complete list of extensions (.js, .md etc.) */ extensions: string[]; /** List of minified javascript files */ minified: string[]; }; /** Size of the directory in bytes */ directorySize: number; /** Unique license contained in the tarball (MIT, ISC ..) */ uniqueLicenseIds: string[]; /** All licenses with their SPDX */ licenses: conformance.SpdxFileLicenseConformance[]; ast: { dependencies: Record<string, Record<string, Dependency>>; warnings: Warning[]; }; } export declare function scanPackage(manifestOrLocation: string | ManifestManager): Promise<ScannedPackageResult>; export interface TarballResolutionOptions { spec: string; registry?: string; } export declare function extractAndResolve(location: string, options: TarballResolutionOptions): Promise<ManifestManager>; //# sourceMappingURL=tarball.d.ts.map