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

@octamap/vite-hls

v2.0.1

Published

Making it super easy to use HLS video streaming instead of .mov, .mp4 and other slow video formats

Downloads

6

Readme

Vite HLS Plugin

Effortlessly enable HLS (HTTP Live Streaming) for videos in your Vite project.

Transform your video workflow with the power of HLS. With this plugin, you can seamlessly prepare your SPA website to use adaptive streaming for videos, making them perform better across devices and network conditions. No need for third-party services like Cloudflare Stream—just simple, effective HLS integration.

✅ No runtime javascript

This plugin adds ZERO runtime javascript. Everything is performed & compiled during build. (Using this plugin wont add any overhead)

🚀 Key Features

  • Automatic HLS Conversion
    • During build and development, the plugin automatically creates .m3u8 files and segmented video files for your videos.
  • Code Transformation
    • Automatically updates your <video> elements to point to the .m3u8 files.
  • Simplified Deployment
    • Publish your SPA with HLS-enabled videos, ready to be streamed by modern browsers.
  • No Extra Costs
    • Avoid relying on external video streaming services—everything stays local.

🎯 Why HLS?

HLS (HTTP Live Streaming) is a streaming protocol that breaks videos into small segments, enabling adaptive bitrate streaming. This ensures your videos:

  • Load faster
  • Play smoothly on poor network connections
  • Deliver an optimized experience for each user’s device

✨ Example Usage

Input

<video src="/videos/my-video.mov?hls"></video>

Output

<video src="hls/my-video/output.m3u8"></video>

How It Works

  • The plugin processes videos with the ?hls suffix.
  • It generates the .m3u8 and segment files.
  • Updates the <video> element source to point to the .m3u8 file.

📦 Installation

Install the plugin via npm:

npm install @octamap/vite-hls

Or with yarn:

yarn add @octamap/vite-hls

🔧 Configuration

Add the plugin to your vite.config.ts file:

import { ViteHLSPlugin } from "@octamap/vite-hls";

export default defineConfig({
  plugins: [
    ViteHLSPlugin(),
  ],
});

⚙️ Options

Customize the plugin with HlsPluginOptions:

export default interface HlsPluginOptions {
    /** Subfolder inside dist where HLS files go, e.g. 'hls' */
    hlsOutput?: string;
    /** Duration of each HLS segment (seconds) */
    segmentDuration?: number;
    /** Directory for caching intermediate files */
    cacheDir?: string;
    /** Public folder for input videos */
    publicFolder?: string;
}

Example Configuration

import { ViteHLSPlugin } from "@octamap/vite-hls";

export default defineConfig({
  plugins: [
    ViteHLSPlugin({
      hlsOutput: 'hls',
      segmentDuration: 10,
      cacheDir: '.hls-cache',
      publicFolder: 'public',
    }),
  ],
});

🖥️ Development and Build Process

  • Development: Use the ?hls suffix to preview HLS-enabled videos during local development.
  • Build: The plugin ensures all HLS files are properly generated and placed in the specified hlsOutput directory.

🎥 Full Example

<video controls>
  <source src="/videos/my-video.mov?hls" type="application/vnd.apple.mpegurl">
</video>

Output Structure (after build)

/public
  /videos
    my-video.mov
/dist
  /hls
    my-video
      output.m3u8
      segment-0.ts
      segment-1.ts

🛠️ Compatibility

  • Modern browsers with HLS support.
  • Works out-of-the-box with any Vite-based project.

📚 Learn More

🤝 Contributions

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

📜 License

This project is licensed under the MIT License.