@sophons/request
Version:
🚀 Probably the best Node.js HTTP request component, It also contains a rich stream processing
20 lines (19 loc) • 885 B
TypeScript
/// <reference types="node" />
import { Stream } from 'stream';
import { AxiosRequestConfig, BufferEncoding } from './common';
/**
* Based on the URL corresponding to the resource transform to buffer
*/
export declare const fastGetBuffer: (url: string, configs?: AxiosRequestConfig) => Promise<Buffer>;
/**
* Based on the URL corresponding to the resource transform to stream
*/
export declare const fastGetStream: (url: string, configs?: AxiosRequestConfig) => Promise<Stream>;
/**
* Based on the URL corresponding to the resource transform to a string in the specified format
*/
export declare const fastGetString: (url: string, type?: BufferEncoding, configs?: AxiosRequestConfig) => Promise<string>;
/**
* Based on the URL download file
*/
export declare const fastDownload: (url: string, path: string, configs?: AxiosRequestConfig, isStream?: boolean) => Promise<string>;