Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/itunes-library-stream
Streaming parser for the contents of iTunes Library XML files
https://github.com/hughsk/itunes-library-stream
Last synced: 12 days ago
JSON representation
Streaming parser for the contents of iTunes Library XML files
- Host: GitHub
- URL: https://github.com/hughsk/itunes-library-stream
- Owner: hughsk
- License: mit
- Created: 2014-01-03T13:54:22.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-08-19T04:40:34.000Z (about 8 years ago)
- Last Synced: 2024-10-17T16:38:57.453Z (22 days ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 12
- Watchers: 6
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# itunes-library-stream [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/itunes-library-stream&title=itunes-library-stream&description=hughsk/itunes-library-stream%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #
Streaming parser for the contents of iTunes Library XML files. Supports
retrieving the complete library track listing, but playlist listings *aren't
complete yet*.Should be useful for either ditching iTunes programatically or at least mucking
around with its data.## Usage ##
[![itunes-library-stream](https://nodei.co/npm/itunes-library-stream.png?mini=true)](https://nodei.co/npm/itunes-library-stream)
### `itunes.createTrackStream()` ###
Creates a transform stream which takes raw XML data and spits out JSON objects
for each discovered track.``` javascript
var itunes = require('itunes-library-stream')
var userhome = require('userhome')
var path = require('path')
var fs = require('fs')// If you're not running OSX, update this
// to point to the correct file in your
// iTunes Library folder.
var location = path.resolve(userhome()
, 'Music/iTunes/iTunes Music Library.xml'
)fs.createReadStream(location)
.pipe(itunes.createTrackStream())
.on('data', function(data) {
console.log('[' + data.Artist + '] ' + data.Name)
})
```## License ##
MIT. See [LICENSE.md](http://github.com/hughsk/itunes-library-stream/blob/master/LICENSE.md) for details.