npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

express-video-stream

v1.2.0

Published

An express package used to easily render video files on the web

Readme

Express Video Stream

alt text for screen readers

About

Express video stream is an easy to implement package that allows you to stream videos on the server to an HTML5 video tag.

How to Install

Run this command to install in your project.

npm install express-video-stream

How to Use

The first step is importing it.

const evs = require('express-video-stream') // Express Video Stream

Once you have created your express app, this package needs 2 lines to work. The first line sets the config. The config is where you set your video ID and path behind it. This is so you can ask the server for a video without needing the path to the file. The config should contain an array named files with objects that have an id and path. You can also use the addVideo function, which takes the id then the path.

evs.setConfig(JSON.parse(fs.readFileSync('./sample/config.json'))); //Load config from file
// or
evs.addVideo("Demo3", "./sample/vids/test3.mp4")    //Add video to config

The last one takes the EVS object you’ve created and sets it as middleware for express.

app.use(evs.middleware) //Use streaming middleware

Once your backend is set up its time to look at front end. All you need is a video tag with a source tag inside. The source’s src tag should be ‘/vidChunk?id={put your id here}. The server will return a 404 if the video’s ID cannot be found.

<video id="videoPlayer" width="600" controls muted="muted" autoplay>
  <source src="/vidChunk?id=test3" type="video/mp4" />
</video>

Example

Server.js

const express = require('express')
const fs = require('fs')
const path = require('path')
const evs = require('express-video-stream') // Express Video Stream
 
var app = express();
 
evs.setConfig(JSON.parse(fs.readFileSync('./sample/config.json'))); //Load config from file
evs.addVideo("Demo3", "./sample/vids/test3.mp4")    //Add video to config
 
app.use(evs.middleware) //Use streaming middleware
 
app.get('/', (req, res) => {
    var page = fs.readFileSync(path.join(__dirname, './index.html')) // Load html into buffer
    res.send(page + ' ');
})
 
app.listen(8080, () => {
    console.log("Test is up and running on localhost:8080")
})

index.html

<html lang="en">
  <body>
    <video id="videoPlayer" width="600" controls muted="muted" autoplay>
      <source src="/vidChunk?id=test3" type="video/mp4" />
    </video>
  </body>
</html>

Reference

The express video stream middleware package currently comes with 2 api paths. | GET /getids | Returns an array of all ids in config | |-------|---| | GET /vidChunk?id= | Returns a 1 MB chunk of video, requires ID |