listenmoe.js

0.0.3 • Public • Published

ListenMoe.js NPM version

A NodeJS wrapper for the listen.moe WebSocket.

Installing

npm install listenmoe.js

How to use

const ListenMoeJS = require('listenmoe.js');

// For the jpop WebSocket you can also leave the parameters empty
const moe = new ListenMoeJS('jpop'); // or "kpop" if you want the trackdata from there

moe.on('updateTrack', (data) => { // When listen.moe updates the track
    // Do something with it
});

moe.on('error', (error) => { // Handle any thrown errors
    // Handle it or ignore
});

moe.connect(); // Connect to the WebSocket

moe.getCurrentTrack() // Returns the current track (or null if there is none)

moe.fetchTrack() // Send a track update request to receive the newest data
.then(t => {
    // Do something with it
}).catch(e => {
    // Handle it or ignore
}):

Links

GitHub repository

NPM package

License

Refer to the LICENSE file.

Readme

Keywords

none

Package Sidebar

Install

npm i listenmoe.js

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

11.4 kB

Total Files

10

Last publish

Collaborators

  • theakio