npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

clementine-client

v1.0.4

Published

A Node.js library for Clementine remote protocol

Downloads

24

Readme

Clementine Client

A Node.js library for interfacing with the Clementine Music Player.

This is an ES6 fork of emersion's clementine-remote package that only implements a bare-bones client (I.E. no library, server or browser support).

Requirements

Node.js 10+

Installation

npm install clementine-client

Example

// Dependencies
const ClementineClient = require('clementine-client')

// Create client
const client = new ClementineClient({host: '127.0.0.1', port: '5500', authCode: 2738})

// Bind events
client.on('connect', () => console.log('Connected!'))
client.on('error', (err) => console.error(err))
client.on('play', () => console.log('Playing')))

// Set volume to 50%
client.setVolume(50)

// Start playing
client.play()

:memo: Documentation

Class: Client

Event: 'alive'

The alive event is emitted while the client is successfully connected to Clementine.

Event: 'connect'

The connect event is emitted when the client successfully connects to Clementine.

Event: 'disconnect'

The disconnect event is emitted when Clementine disconnects.

Event: 'library'

  • <LibraryInfo>

The library event is emitted when a library is received from Clementine. The callback is passed a object with the current library.

Event: 'position'

  • <Position>

The position event is emitted while a track plays in Clementine. The callback is passed a number indicating the current position.

Event: 'play'

The play event is emitted when Clementine starts playing.

Event: 'repeat'

  • <RepeatMode>

The repeat event is emitted when the repeat mode is changed in Clementine. The callback is passed a string with the current RepeatMode.

Event: 'shuffle'

  • <ShuffleMode>

The shuffle event is emitted when the shuffle mode is changed in Clementine. The callback is passed a string with the current ShuffleMode.

Event: 'song'

  • <SongInfo>

The song event is emitted when the song changes in Clementine. The callback is passed a object with the current song info.

Event: 'volume'

  • <Volume>

The volume event is emitted when the volume changes in Clementine. The callback is passed a volume percentage argument (int).

client.changeSong(playlistId, songIndex)

  • playlistId
  • songIndex

Change the song in Clementine.

client.getLibrary()

Request the current library returned (will be returned via the library event)

client.insert(playlistId, urls, options)

  • playlistId
  • urls
  • options

Insert songs into the playlist.

client.next()

Play the next song.

client.play()

Play the currently selected song.

client.playpause()

Play or pause the currently selected song.

client.previous()

Play the previous song.

client.setTrackPosition(pos)

  • pos

Set the current track position.

client.setVolume(volume)

  • volume: Percentage

Set the current volume.

client.shuffle()

Shuffle the current playlist.

client.stop()

Stop playback.

:scroll: License

MIT © foxxyz