# @eyevinn/m3u8

> streaming m3u8 parser for Apple's HTTP Live Streaming protocol

Latest version **0.5.9** (published 2025-05-30) · 0 weekly downloads

## Install

```sh
npm install @eyevinn/m3u8
pnpm add @eyevinn/m3u8
yarn add @eyevinn/m3u8
bun add @eyevinn/m3u8
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.5.9 |
| Published | 2025-05-30 |
| First published | 2020-03-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 70.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Mark Bogdanoff |
| Maintainers | martinstark, jobi, bwallberg |
| Keywords | m3u, m3u8, hls, http live streaming, stream |

## Links

- npm: https://www.npmjs.com/package/@eyevinn/m3u8
- Repository: https://github.com/Eyevinn/node-m3u8
- Homepage: https://github.com/Eyevinn/node-m3u8#readme
- Issues: https://github.com/Eyevinn/node-m3u8/issues
- npm.io page: https://npm.io/package/@eyevinn/m3u8

## Dependencies (1)

- [chunked-stream](https://npm.io/package/chunked-stream.md) ~0.0.2

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.5.9 (latest) — 2025-05-30
- 0.5.8 — 2024-11-28
- 0.5.7 — 2024-11-27
- 0.5.6 — 2023-03-13
- 0.5.5 — 2023-03-13
- 0.5.4 — 2023-03-09
- 0.5.3 — 2023-02-22
- 0.5.2 — 2022-01-14
- 0.5.0 — 2022-01-14
- 0.4.4 — 2021-11-22
- 0.4.3 — 2021-11-18
- 0.4.2 — 2021-11-10
- 0.4.1 — 2021-08-02
- 0.4.0 — 2021-03-13
- 0.3.3 — 2021-02-24
- … 12 more at https://npm.io/package/@eyevinn/m3u8/versions

## README

m3u8
====

node-m3u8 is a streaming m3u8 parser tailored for dealing with [Apple's HTTP
Live Streaming protocol](http://tools.ietf.org/html/draft-pantos-http-live-streaming).
It may work for other m3u files, but I have not tested it for those uses.

example
-------

``` js
var m3u8 = require('m3u8');
var fs   = require('fs');

var parser = m3u8.createStream();
var file   = fs.createReadStream('/path/to/file.m3u8');
file.pipe(parser);

parser.on('item', function(item) {
  // emits PlaylistItem, MediaItem, StreamItem, and IframeStreamItem
});
parser.on('m3u', function(m3u) {
  // fully parsed m3u file
});
```

All items and the m3u object have `toString()` methods for conversion to m3u8.
Attributes and properties have getter/setters on m3u and item objects:

```
parser.on('item', function(item) {
  var duration = item.get('bandwidth');
  item.set('uri', 'http://example.com/' + item.get('uri'));
});
```

The M3U and Item objects are available on m3u8:
```
var m3u8 = require('m3u8');

var m3u = m3u8.M3U.create();
m3u.addPlaylistItem({
  duration : 10,
  uri      : 'file'
});
```

See tests for more usage patterns.

---
_Source: https://npm.io/package/@eyevinn/m3u8 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
