@jorgeferrero/stream-to-buffer
Version:
A promise based npm package that converts a node.js ReadStream to buffer
13 lines (12 loc) • 421 B
TypeScript
/// <reference types="node" />
import { Writable, WritableOptions } from 'stream';
export interface Bufferable {
toBuffer(): Buffer;
}
export declare class BufferableStream extends Writable implements Bufferable {
private readonly chunks;
constructor(opts?: WritableOptions);
toBuffer(): Buffer;
_write(chunk: any, _: string, next: (error?: Error | null) => void): void;
private chunksToBuffer;
}