xspf-js
v0.1.1
Published
XML format for sharing playlists (https://xspf.org/spec)
Downloads
3
Readme
xspf-js (“spiff”)
XML format for sharing playlists (https://xspf.org/spec)
Usage
Install
npm i xspf-js
Parse
const { parse } = require("xspf-js")
const xml = `<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<title>SpongeBob SquarePants Theme Song</title>
<trackList>
<track><location>file:///music/song\_2.flac</location></track>
</trackList>
</playlist>
`
const result = parse(xml)
// result:
// {
// "version": "1",
// "xmlns": "http://xspf.org/ns/0/",
// "playlist": {
// "title": "SpongeBob SquarePants Theme Song",
// "trackList": [
// {
// "location": "file:///music/song_2.flac"
// }
// ]
// }
// }