1.0.6 • Published 6 years ago

node-spotilocal v1.0.6

Weekly downloads
9
License
MIT
Repository
github
Last release
6 years ago

DEPRECATED node-spotilocal

npm npm npm paypal

Simple wrapper class for Spotify app local webserver.


Install

Via npm [package]:

$ npm install node-spotilocal

Via yarn [package]:

$ yarn add node-spotilocal

Usage

// require lib
const Spotilocal = require("node-spotilocal");

// init lib
const spotify = new Spotilocal();

// [optional] get auth tokens from Spotify app or auth process will execute with first request
spotify._auth().then(tokens => {
	// ...
}).catch(console.error);

// play track
spotify.play("spotify:track:1qCQTy0fTXerET4x8VHyr9").then(console.log).catch(console.error);

// pause track
spotify.pause().then(console.log).catch(console.error);

// unpause track
spotify.unpause().then(console.log).catch(console.error);

// get app status on particular events (default: ["login", "logout", "play", "pause", "error", "ap"]) or after X seconds (default: 0; 0 = disabled)
spotify.status(["login", "logout", "play", "pause", "error", "ap"], 0).then(console.log).catch(console.error);

// [optional] revoke auth tokens
spotify._revoke();

License

MIT

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago