Client library for controlling a Mopidy music server via WebSocket and JSON-RPC. Current stable version is 1.3.0. Released on npm with TypeScript types included. Key differentiator: provides a unified API for both browser and Node.js, handling WebSocket reconnection with exponential backoff, and exposing Mopidy's core API methods dynamically. Minimal dependencies, lightweight (~12 kB minified).
npm install mopidyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to a Mopidy server via WebSocket, listens for state and track change events, and calls a core API method.
Set autoConnect: false and call connect() after configuring webSocketUrl, or pass webSocketUrl explicitly.
Use 'event:' naming consistently; check your Mopidy version for event naming.
Wait for 'state' event with value 'connected' before making API calls.
Update Node.js to >=10 and migrate from callbacks to Promises or async/await.
Use full URL format: 'ws://host:port/mopidy/ws/'
Subscribe to the 'state' event and wait for 'connected', or use the 'onOpen' callback if available.
Check API signature; use appropriate data types as specified in Mopidy docs.
Run 'npm install mopidy' or use the prebuilt bundle from GitHub releases.
Use default import: import Mopidy from 'mopidy'
Ensure library is loaded and accessible; check script tags or bundler configuration.
No dependency data recorded yet.