New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@johnpaulvaughan/itunes-music-library-tracks

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@johnpaulvaughan/itunes-music-library-tracks

Creates an stream of tracks or playlists from an iTunes Library XML file

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

iTunes Music Library Tracks

This module loops through iTunes Music Library XML and spits out a stream of JSON objects for each track (or playlist).

Motivation

There are similar npm modules that do this, however when trying to utilise them in an electon application they all failed in one way or another. I created my module using minimal dependencies so that it works without issue.

Installation

$ npm install @johnpaulvaughan/itunes-music-library-tracks --save

Code Example

Supply the module with a path to your xml file. It returns a node readStream of tracks.
It throws an error if something goes wrong.

let getItunesTracks = require('@johnpaulvaughan/itunes-music-library-tracks').getItunesTracks;
let validXMLpath = 'C:\\Users\\JohnPaulVaughan\\Music\\iTunes\\iTunes Music Library.xml'

let trackStream = getItunesTracks(validXMLpath)

trackStream.on('data', function(track) {
    console.log(JSON.parse(track))
})

trackStream.on('error', function(err) {
    console.log(err)
})

trackStream.on('end', () => {
console.log('finished parsing xml stream')
})


Methods

There are two methods that work in a similsr fashion

  • getItunesTracks for track info
  • getItunesPlaylists for playlist info

Keywords

FAQs

Package last updated on 23 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc