pnpm
Version:
A fast implementation of npm install
33 lines (32 loc) • 787 B
TypeScript
import { IncomingMessage } from 'http';
export declare type RequestParams = {
headers?: {
authorization: string;
};
};
export declare type HttpResponse = {
body: string;
};
export declare type Got = {
get: (url: string) => Promise<HttpResponse>;
getStream: (url: string) => Promise<IncomingMessage>;
getJSON<T>(url: string): Promise<T>;
};
export declare type NpmRegistryClient = {
get: Function;
fetch: Function;
};
declare var _default: (client: {
get: Function;
fetch: Function;
}, opts: {
cachePath: string;
cacheTTL: number;
}) => {
get: (url: string) => Promise<{
body: string;
}>;
getStream: (url: string) => Promise<IncomingMessage>;
getJSON<T>(url: string): Promise<T>;
};
export default _default;