UNPKG

node_aimp

Version:

use aimp remote use module web remote aimp

33 lines (28 loc) 696 B
let aimp = require("./Aimp"); const control = new aimp({port:3333}); let {GetControl,Next,Back} = control.setMethod(); GetControl({},(a,b,c)=>{ const {playlist_id,track_id} = a; return {playlist_id,track_id}; }).then((a)=>{ let { response , method , time} = a; return response; }).then(e=>{ console.log(e) }) .catch(e=>{ console.log(e) }) control.on("control",{ OK:(a)=>console.log(a,"OK"), complete:(a)=>console.log(a,"Comp"), error:(a)=>a.error }).catch(e=>{ console.log(e,"catch one") }) control.on("control",(a)=>{ console.log(a,"other") return "init other" }).catch(e=>{ console.log(e,"catch two") })