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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mock-hls-server

v0.1.1

Published

Fake a live/event HLS stream from a VOD one. Useful for testing.

Downloads

28

Readme

npm version

Mock HLS Server

Fake a live/event HLS stream from a VOD one. Useful for testing.

Usage

npm install -g mock-hls-server

to install globally.

mock-hls-server

will start the server running on "http://localhost:8080".

mock-hls-server 0.0.0.0 -p 8000 --event

will start listening on all interfaces on port 8000. It will also serve the playlist as an EVENT playlist, which means URL's will never be removed from the start.

These are all the options:

  • host
  • port
  • windowSize: The number of seconds to keep in the playlist. Not valid with --event.
  • initialDuration: The number of seconds into the stream that should be available on the first playlist request.
  • event: Changes the playlist type to EVENT, meaning no segments will ever be removed.
  • loop: Loop the playlist.
  • logLevel

Now start your stream at http://localhost:8080/proxy?url=<stream url>. The first playlist request will start the stream. Variant playlists are supported, and the playlist URL's contained in them will be rewritten to route through the proxy.

The source stream should be a VOD playlist that contains all the segments.

Example

Run

mock-hls-server

and then start streaming 'http://localhost:8080/proxy?url=https%3A%2F%2Fdevstreaming-cdn.apple.com%2Fvideos%2Fstreaming%2Fexamples%2Fimg_bipbop_adv_example_ts%2Fmaster.m3u8'