You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
435 B
JavaScript
18 lines
435 B
JavaScript
8 years ago
|
'use strict';
|
||
|
|
||
|
const fs = require("fs");
|
||
|
const debug = require("debug")("seekable:fs");
|
||
|
|
||
|
module.exports = function getHttpSeekable(targetPath) {
|
||
|
return {
|
||
|
createReadStream: function createReadStream(start, end) {
|
||
|
debug(`${start}-${end} -- ${targetPath}`);
|
||
|
|
||
|
return fs.createReadStream(targetPath, {
|
||
|
start: start,
|
||
|
end: end
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
};
|