thedesk/app/node_modules/itunes-nowplaying-mac
2018-05-26 21:48:13 +09:00
..
dist TheDesk Mio (ver.3) 2018-05-20 15:17:10 +09:00
package.json TheDesk Mio (ver.5) 2018-05-26 21:48:13 +09:00
README.md TheDesk Mio (ver.3) 2018-05-20 15:17:10 +09:00
tsconfig.json TheDesk Mio (ver.3) 2018-05-20 15:17:10 +09:00

itunes-nowplaying-mac

tested in macOS High Sierra 10.13.2 and iTunes 12.7.2.58

install

npm install itunes-nowplaying-mac

how to use

TypeScript:

import nowplaying from "itunes-nowplyaing-mac"
nowplaying().then(console.log)

import {getRawData as nowplaying} from "itunes-nowplaying-mac"
nowplaying().then(console.log) // return iTunes raw data

JavaScript:

const nowplaying = require("itunes-nowplaying-mac")
nowplaying().then(console.log)

nowplaying.getRawData().then(console.log) // return iTunes raw data

example return data:

{
    "name": "AnemoneStar",
    "duration": 211.29299926757812,
    "artist": "渋谷凛 (福原綾香)",
    "composer": "Yasushi",
    "album": {
        "name": "THE IDOLM@STER CINDERELLA GIRLS STARLIGHT MASTER 01",
        "artist": "",
        "loved": false,
        "disliked": false
    },
    "genre": "Soundtrack",
    "track": {
        "length": 7,
        "number": 3
    },
    "disc": {
        "length": 1,
        "number": 1
    },
    "sampleRate": 44100,
    "comment": "",
    "loved": true,
    "disliked": false,
    "state": "playing"
}