UNPKG

snyk-docker-plugin

Version:
18 lines (17 loc) 843 B
/// <reference types="node" /> /// <reference types="node" /> import { Readable } from "stream"; /** * https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings */ declare type SupportedEncodings = "utf8" | "base64"; export declare function streamToString(stream: Readable, streamSize?: number, encoding?: SupportedEncodings): Promise<string>; export declare function streamToBuffer(stream: Readable): Promise<Buffer>; export declare function streamToSha256(stream: Readable): Promise<string>; export declare function streamToSha1(stream: Readable): Promise<string>; /** * Reads up to 2 megabytes from the stream and tries to JSON.parse the result. * Will reject if an error occurs from within the stream or when parsing cannot be done. */ export declare function streamToJson<T>(stream: Readable): Promise<T>; export {};