Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

peerflix-engine

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peerflix-engine

Low level streaming torrent client that exposes files as node.js streams and downloads pieces based on demand

Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

peerflix-engine

The streaming torrent engine that peerflix (will) use

npm install peerflix-engine

Disclamer

This module is under heavy development. Here be dragons

Usage

peerflix-engine is a node module that allows you to access files inside a torrent as node streams.

var pe = require('peerflix-engine');
var fs = require('fs');

var engine = pe(fs.readFileSync('my-test-file.torrent'));

engine.files.forEach(function(file) {
	console.log('filename: '+file.name);
	var stream = file.createReadStream();
	// stream is readable stream to containing the file content
});

You can pass start and end options to stream to slice the file

// get a stream containing bytes 10-100 inclusive.
var stream = file.createReadStream({
	start: 10,
	end: 100
});

Per default no files are downloaded unless you create a stream to them. If you want to fetch a file anyway use the file.select and file.deselect method

file.select(); // file will be downloaded at a lower prio than any existing streams

When you start peerflix-engine it will connect to the torrent dht and fetch pieces according to the streams you create.

How can I help?

  • Open issues on things that are broken
  • Fix open issues by sending PRs
  • Add documentation

License

MIT

FAQs

Package last updated on 10 Mar 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