file-box
Version:
Pack a File into Box for easy move/transfer between servers no matter of where it is.(local path, remote url, or cloud storage)
15 lines • 734 B
TypeScript
/// <reference types="node" />
import http from 'http';
import type stream from 'stream';
export declare function dataUrlToBase64(dataUrl: string): string;
/**
* Get http headers for specific `url`
* follow 302 redirection for max `REDIRECT_TTL` times.
*
* @credit https://stackoverflow.com/a/43632171/1123955
*/
export declare function httpHeadHeader(url: string): Promise<http.IncomingHttpHeaders>;
export declare function httpHeaderToFileName(headers: http.IncomingHttpHeaders): null | string;
export declare function httpStream(url: string, headers?: http.OutgoingHttpHeaders): Promise<http.IncomingMessage>;
export declare function streamToBuffer(stream: stream.Readable): Promise<Buffer>;
//# sourceMappingURL=misc.d.ts.map