koa-stream
Helper to stream files and buffers with range requests using koa.
This can be used with video
tags, and other resource using the Range
header.
The implementation follows RFC 7233.
Installation
$ npm install koa-stream
Usage
Stream Files
var stream = ;var path = ;var app = ; app;
Stream Buffers
var stream = ;var path = ;var app = ; app;
See sample/index.js for a working example.
Options
root
: the directory from which file paths will be resolvedallowDownload
: allow to return the file instead of streaming it if notRange
header is provided