# range-stream **Repository Path**: mirrors_stephenplusplus/range-stream ## Basic Information - **Project Name**: range-stream - **Description**: Receive a byte range from a readable stream. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-11-23 - **Last Updated**: 2026-04-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # range-stream > Receive a byte range from a readable stream ## Use ```sh $ npm install --save range-stream ``` ```js var rangeStream = require("range-stream") fs.createReadStream("file.txt").pipe(rangeStream(50, 100)) ``` ### Doesn't `fs.createReadStream` have `start` and `end` options? Yes. And range-stream is meant to behave the same way when consuming a stream that doesn't give you those options. ## Limitations range-stream currently only works with Buffer streams. Support for object mode is planned (PR welcome :+1:). ## API ### require("range-stream")(start, [end]) #### start - Type: `Number` The byte offset to begin consuming data from the source stream. #### end - Optional - Type: `Number` The byte offset that when hit will end the stream. If not set, the stream will run until all data is consumed. ## License Copyright (c) 2014 Stephen Sawchuk. Licensed under the MIT license.