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

@flow-player/test-streams

v0.14.2

Published

ffmpeg-driven local test stream service for Flow Player integration testing: generates and serves H.264/HEVC × HTTP-FLV / HLS / fMP4 / MP4 / MPEG-TS fixtures on 127.0.0.1:4177 (live infinite-loop + 5s VOD fixtures).

Readme

@flow-player/test-streams

Flow Player 集成本地验收用的测试流服务:spawn 系统 ffmpeg 生成 H.264/HEVC × HTTP-FLV / HLS / fMP4 / MP4 / MPEG-TS fixture,经本地 HTTPS server(默认 127.0.0.1:4177)提供两类流:

  1. /streams/live/<format>/<codec> — 无限循环 live 流(-stream_loop -1 -re -fflags +genpts,HTTP 永不 EOF),模拟 NVR 长期监控场景;格式 flv|hls|mp4|fmp4|ts,编码 h264|hevc。
  2. /streams/<format>/<codec> — 5s 预生成 VOD 风格 fixture,适合短链路验收与范围请求验证。

要求

  • Node ≥ 24(本包直接发布 TypeScript 源码,依赖原生 type stripping 运行)
  • 系统 ffmpeg 在 PATH 上(fixture 生成时按需 spawn;缺失时脚本给出提示)

接入

npm install -D @flow-player/test-streams

启动 streams server(HTTPS 需自备证书,--cert/--key 可省略走 HTTP):

node node_modules/@flow-player/test-streams/src/cli/serve.ts --cert ./local.pem --key ./local-key.pem
# 或经包 exports 编程式接入:
#   import { ... } from "@flow-player/test-streams"
#   import { createStreamsServer } from "@flow-player/test-streams/server"

健康检查:

curl -ksSf https://127.0.0.1:4177/streams/health

Vite 项目可加包提供的 dev 插件(仅 serve 生效:健康检查失败时自动后台拉起 streams server,日志 /tmp/test-streams.log):

import { testStreamsVitePlugin } from "@flow-player/test-streams/vite-plugin";

export default {
  plugins: [
    testStreamsVitePlugin({ cert: "./local.pem", key: "./local-key.pem" }),
  ],
};

发布形态差异

npm 发布产物由 scripts/build-package.ts 生成:esbuild 编译出 dist/*.js,files 仅含 README.md / LICENSE / dist/,不含 fixtures/ 产物;仓库内 packages/test-streams/fixtures/ 也被 .gitignore 忽略(生成产物不入库)。而 test-streams(serve)bin 的默认 fixture 目录按其自身位置解析为 <包根>/fixtures,因此裸跑 test-streams serve 时该目录是空的:/streams/health 回 503、VOD 路由 404(live 流不依赖 fixture,仍可正常播)。裸跑前二选一:

  1. 先跑 test-streams-generate 生成完整矩阵 + manifest.json(系统需有 ffmpeg;建议用 --fixture-dir 指到项目内目录,避免写入 node_modules);或
  2. 用 --fixture-dir <path> 显式指向一个已有 fixture 目录。

注意

  • 内置矩阵、CLI 参数与路径语义与 仓库文档 保持一致;不要在业务代码里硬编码流地址——demo 侧经 VITE_FLOW_PLAYER_DEMO_STREAMS_BASE 切换基址。
  • 本包是测试/验收工具,不是生产代理服务;生成码流质量只服务于接入验收(低码率、短 GOP)。

License

MIT。