thedesk/app/node_modules/itunes-nowplaying-mac/README.md

59 lines
1.1 KiB
Markdown
Raw Normal View History

2018-05-20 16:17:10 +10: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:
```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:
```javascript
const nowplaying = require("itunes-nowplaying-mac")
nowplaying().then(console.log)
nowplaying.getRawData().then(console.log) // return iTunes raw data
```
example return data:
```json
{
"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"
}
```