streamify-video
v1.2.0
Published
Secure, zero-config HTTP video streaming utility for Node.js
Maintainers
Readme
streamify-video
Secure, zero-configuration HTTP video streaming utility for Node.js & Express.
streamify-video makes video streaming effortless by handling HTTP Range requests , secure access , and edge cases for you.
Perfect for media servers , course platforms , self-hosted video apps , and internal tools .
Why streamify-video?
Most developers struggle with:
- HTTP
Rangeheaders - Video seeking issues
- Boilerplate Express code
- Securing video endpoints
streamify-video solves all of this in minutes.
Features (v1.1.0)
- HTTP Range support (206 Partial Content)
- Smooth seeking in browsers & players
- Secure streaming via token or password
- Automatic MIME type detection
- Edge-case safe range parsing
- TypeScript support with typings
- Zero configuration setup
Installation
npm install streamify-videoQuick Start
import express from "express";
import { streamVideo } from "streamify-video";
const app = express();
app.get(
"/video/:filename",
streamVideo({
videoDir: "./videos"
})
);
app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
});Open in browser:
http://localhost:3000/video/sample.mp4Secure Streaming (Token / Password)
Token-based access
app.get(
"/video/:filename",
streamVideo({
videoDir: "./videos",
token: "secret123"
})
);Request:
/video/movie.mp4?token=secret123Or via header:
x-stream-token: secret123Password-based access
app.get(
"/video/:filename",
streamVideo({
videoDir: "./videos",
password: "mypassword"
})
);Request:
/video/movie.mp4?password=mypasswordConfiguration Options
streamVideo({
videoDir: string; // Required: directory containing videos
token?: string; // Optional: secure token
password?: string; // Optional: password protection
})Supported Video Formats
- MP4 (
video/mp4) - WebM (
video/webm) - MKV (
video/x-matroska) - AVI (
video/x-msvideo) - MOV (
video/quicktime)
(Other formats fall back to application/octet-stream.)
How It Works
- Automatically parses HTTP
Rangeheaders - Validates invalid or out-of-bound ranges
- Streams only requested chunks
- Sends correct response headers:
Content-RangeAccept-RangesContent-LengthContent-Type
This ensures fast loading , low memory usage , and perfect seeking .
Example Use Cases
- 📚 Online course platforms
- 🎞 Self-hosted video servers
- 📡 Internal company media tools
- 🧪 Prototyping video apps
- 📱 Mobile + web video backends
Roadmap
Planned future upgrades:
- HLS streaming support
- Bandwidth throttling
- Fastify plugin
- FFmpeg thumbnail generation
- Analytics & hooks
🧑💻 Author
Mihir Acharya Web Developer & Streaming Systems Enthusiast
📄 License
MIT License — free to use in personal and commercial projects.
⭐ If this package helps you, consider giving it a star on GitHub!
