iptv-m3u
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

IpTv M3U

A simple module that allows you to convert M3U playlists to objects, and objects to M3U playlists. It basically can read and write M3U files.

Import

ES Modules (ESM)

import * as m3u from 'iptv-m3u';

CommonJS

const m3u = require('iptv-m3u');

Usage

Read external M3U file (async)

You can convert an external M3U file to an IptvPlaylist object.

await m3u.readExternalM3u('UrlToM3uFile');

Read string M3U playlist

You can convert a M3U string to an IptvPlaylist object.

await m3u.readStringM3u(stringToRead);

Read local M3U file

You can convert an local M3U file to an IptvPlaylist object.

m3u.readLocalM3u('PathToM3uFile');

You can also use path.join.

m3u.readLocalM3u(path.join(__dirname, 'PathToM3uFile'));

Create M3U String

You can convert an IptvPlaylist object to a M3U file to string.

m3u.createM3uString(iptvPlaylist);

Create M3U File

You can convert an IptvPlaylist object to a M3U file.

m3u.createM3uFile(iptvPlaylist, 'PathToM3uFile');

You can also use path.join.

m3u.createM3uFile(iptvPlaylist, path.join(__dirname, 'PathToM3uFile'));

Package Sidebar

Install

npm i iptv-m3u

Weekly Downloads

2

Version

1.1.5

License

ISC

Unpacked Size

27.3 kB

Total Files

7

Last publish

Collaborators

  • alexandrevassard