# stream-to-buf **Repository Path**: mirrors_node-modules/stream-to-buf ## Basic Information - **Project Name**: stream-to-buf - **Description**: convert readable stream to buffer with length limit - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-19 - **Last Updated**: 2025-11-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README stream-to-buf ==== Collect a readable stream's data into buffer. Support max size limit. ## Install ```bash npm i stream-to-buf ``` ## Usage ```js const streamTobuffer = require('stream-to-buf'); const stream = fs.createReadStream(path.join(__dirname, 'fixtures/file')); streamToBuffer(stream, { maxSize: '10kb' }).then(onBuffer, onError); ``` ### Options - `maxSize`: If stream's emitted buffer exceed `maxSize`, it will throw an error.(but it will still consume the stream before resolve).