m3ujs
v0.2.1
Published
Create m3u files
Downloads
7
Readme
m3ujs
Create m3u files.
Features
- Write relative or absolute m3u files
- Support m3u and extm3u format
- Add extm3u displayName based on id3 tag info
Usage
Installation
Install as npm package:
npm install m3ujs --save
Install latest development version:
npm install m3ujs@next --save
API
import { Playlist } from 'm3ujs/playlist';
import { Mp3Entry } from 'm3ujs/mp3-entry';
import { TypeEXTM3U } from 'm3ujs/type';
const playlist = new Playlist(new TypeEXTM3U(entry => {
if (entry instanceof Mp3Entry) {
return `${entry.artist} - ${entry.album} - ${entry.track} - ${entry.title}`;
}
return entry.displayName;
}));
playlist.add(new Mp3Entry('/path/to/test.mp3'));
playlist.write('/pat/to/playlist.m3u');