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

vue-plugin-request-test

v2.0.2

Published

测试使用,勿用

Readme

m3u8-plus

m3u8-plus 是一个用于解析和修改 .m3u8 播放列表文件的工具库。它可以将 .m3u8 文件内容转换成 JavaScript 对象,支持 Node.js、ES 模块以及浏览器环境。

功能特点

  1. 轻松解析 .m3u8 文件
  2. 支持 AES-128 加密信息解析
  3. 可修改播放列表信息
  4. 支持将修改后的对象以 .m3u8 文本格式输出
  5. 通用环境兼容(Node/ES/浏览器)

安装

npm

npm install m3u8-plus

浏览器

<script src="path/to/index.umd.cjs"></script>

示例

import { parse, replace } from 'm3u8-plus'

const demo01 = `
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-KEY:METHOD=AES-128,URI="key.dat",IV=0x00000000000000000000000000000000
#EXTINF:10.000000,
segmt0.ts
#EXTINF:10.000000,
segmt1.ts
#EXTINF:10.000000,
segmt2.ts
#EXT-X-ENDLIST
`
const m3u8 = parse(demo01)
console.log(m3u8)
/*
{
  start: true,
  version: 3,
  targetDuration: 10,
  mediaSequence: 0,
  type: 'VOD',
  key: {
    method: 'AES-128',
    url: 'key.dat',
    iv: '0x00000000000000000000000000000000'
  },
  keys: [
    {
      method: 'AES-128',
      url: 'key.dat',
      iv: '0x00000000000000000000000000000000'
    }
  ],
  segments: [
    { duration: 10, title: '', url: 'segmt0.ts', key: [Object] },
    { duration: 10, title: '', url: 'segmt1.ts', key: [Object] },
    { duration: 10, title: '', url: 'segmt2.ts', key: [Object] }
  ],
  end: true,
  totalDuration: 2040,
  unknowns: [],
  toText: [Function: toText]
}
*/
console.log(m3u8.toText())
/*
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-KEY:METHOD=AES-128,URL="key.dat",IV=0x00000000000000000000000000000000
#EXTINF:10,
segmt0.ts
#EXTINF:10,
segmt1.ts
#EXTINF:10,
segmt2.ts
#EXT-X-ENDLIST
*/

API 说明

parse(text: string)

解析 .m3u8 文本,返回一个包含播放列表信息的对象。

replace(message: string, ...args: any[])

用于字符串参数占位符替换的辅助函数。

更多

  1. 支持自定义标签解析逻辑
  2. 可通过 .toText() 方法导出编辑后的 m3u8 文本
  3. 内部维护 segments、keys、unknowns 等详细信息

许可证

MIT
如果你觉得这个项目对你有帮助,欢迎点赞和 Star!🎉