osa-spotify
Control the Spotify desktop macOS app
Installation
Requires OSX 10.10 Yosemite.
npm install osa-spotify --save
Usage
var spotify = // Play a song with a specific Spotify URIspotify // Pause playbackspotify // Resume playbackspotify // Toggle playback (if paused, play; if playing, pause)spotify // Play next track in current playlistspotifynext // Play previous track in current playlistspotify // Get info about the current track (title, artist, album, etc)spotify // Get info about the player state (play/pause, volume, shuffle, repeat)spotify // Note: All functions return promises that resolve when the operation completes