Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

range-stream

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

range-stream

Receive a byte range from a readable stream.

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1.1K
12.11%
Maintainers
1
Weekly downloads
 
Created
Source

range-stream

Receive a byte range from a readable stream

Use

$ npm install --save range-stream
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

Type: Number

The byte offset that when hit will end the stream.

License

Copyright (c) 2014 Stephen Sawchuk. Licensed under the MIT license.

Keywords

byte

FAQs

Package last updated on 22 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts