Comparing version 1.0.0 to 1.0.1
72
index.js
@@ -40,2 +40,9 @@ var client = require('./client.js'); | ||
var spop = { | ||
/** | ||
* @param {object} settings Setup parameters | ||
* @param {string} settings.host Server hostname or ip address | ||
* @param {number} settings.port Server port number | ||
* @param {boolean} settings.debug Logs additional information if true | ||
* @return {Promise} | ||
*/ | ||
setup: function(settings) { | ||
@@ -47,2 +54,7 @@ this.settings = settings; | ||
/** | ||
* @description Execute a command on the spop server. Returned promise will be resolved with server's response. | ||
* @param {string} command Command to be executed on spop server | ||
* @return {Promise} | ||
*/ | ||
exec: function(command) { | ||
@@ -65,2 +77,7 @@ return new Promise(function(resolve, reject) { | ||
/** | ||
* @description Replace the contents of the queue with the given Spotify URI (playlist, track or album only) and start playing | ||
* @param {string} uri Spotify URI to be played | ||
* @returns {Promise} | ||
*/ | ||
uplay: function(uri) { | ||
@@ -70,2 +87,7 @@ return this.exec('uplay ' + uri); | ||
/** | ||
* @description Add the given Spotify URI to the queue (playlist, track or album only) | ||
* @param {string} uri Spotify URI to be enqueued | ||
* @returns {Promise} | ||
*/ | ||
uadd: function(uri) { | ||
@@ -75,2 +97,6 @@ return this.exec('uadd ' + uri); | ||
/** | ||
* @description Start playing from the queue | ||
* @returns {Promise} | ||
*/ | ||
play: function() { | ||
@@ -80,2 +106,6 @@ return this.exec('play'); | ||
/** | ||
* @description Toggle pause mode | ||
* @returns {Promise} | ||
*/ | ||
pause: function() { | ||
@@ -85,2 +115,7 @@ return this.exec('pause'); | ||
/** | ||
* @description Go to position pos in the current track | ||
* @param pos Position to seek (in miliseconds) | ||
* @returns {Promise} | ||
*/ | ||
seek: function(pos) { | ||
@@ -90,2 +125,6 @@ return this.exec('seek ' + pos); | ||
/** | ||
* @description Toggle repeat mode | ||
* @returns {Promise} | ||
*/ | ||
repeat: function() { | ||
@@ -95,2 +134,6 @@ return this.exec('repeat'); | ||
/** | ||
* @description Toggle shuffle mode | ||
* @returns {Promise} | ||
*/ | ||
shuffle: function() { | ||
@@ -100,2 +143,7 @@ return this.exec('shuffle'); | ||
/** | ||
* @description Switch to track number tr in the queue | ||
* @param tr Number of the track | ||
* @returns {Promise} | ||
*/ | ||
goto: function(tr) { | ||
@@ -105,2 +153,6 @@ return this.exec('goto ' + tr); | ||
/** | ||
* @description Switch to the next track in the queue | ||
* @returns {Promise} | ||
*/ | ||
next: function() { | ||
@@ -110,2 +162,6 @@ return this.exec('next'); | ||
/** | ||
* @description Switch to the previous track in the queue | ||
* @returns {Promise} | ||
*/ | ||
prev: function() { | ||
@@ -115,2 +171,6 @@ return this.exec('prev'); | ||
/** | ||
* @description List the contents of the queue | ||
* @returns {Promise} | ||
*/ | ||
qls: function() { | ||
@@ -120,2 +180,6 @@ return this.exec('qls'); | ||
/** | ||
* @description Stop playback | ||
* @returns {Promise} | ||
*/ | ||
stop: function() { | ||
@@ -125,2 +189,6 @@ return this.exec('stop'); | ||
/** | ||
* @description Display informations about the queue, the current track, etc. | ||
* @returns {Promise} | ||
*/ | ||
status: function() { | ||
@@ -130,2 +198,6 @@ return this.exec('status'); | ||
/** | ||
* @description Disconnect from the server | ||
* @returns {Promise} | ||
*/ | ||
end: function() { | ||
@@ -132,0 +204,0 @@ return client.end(); |
{ | ||
"name": "node-spop", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Node wrapper for https://github.com/Schnouki/spop", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11871
323