printer-notifications/node_modules/import-meta-resolve/lib/package-json-reader.d.ts
2023-11-13 16:10:04 -05:00

25 lines
707 B
TypeScript

export default reader;
export type ErrnoException = import('./errors.js').ErrnoException;
export type PackageType = 'commonjs' | 'module' | 'none';
export type PackageConfig = {
pjsonPath: string;
exists: boolean;
main: string | undefined;
name: string | undefined;
type: PackageType;
exports: Record<string, unknown> | undefined;
imports: Record<string, unknown> | undefined;
};
declare namespace reader {
export { read };
}
/**
* @param {string} jsonPath
* @param {{specifier: URL | string, base?: URL}} options
* @returns {PackageConfig}
*/
declare function read(jsonPath: string, { base, specifier }: {
specifier: URL | string;
base?: URL;
}): PackageConfig;