How to use the webtorrent/lib/file-stream.prototype function in webtorrent

To help you get started, we’ve selected a few webtorrent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexeisavca / webtorrentapp / index.js View on Github external
requestFile(filename).then(function(file){
            var stream = ReadableStream();
            stream.push(file);
            stream.push(null);
            stream.pipe = FileStream.prototype.pipe.bind(stream);
            promise.resolve(stream);
        });
        return promise.promise;