Registry / database / mysql-live-client

mysql-live-client

JSON →
library0.4.1jsnpmunverified

Client-side JavaScript library for real-time MySQL database synchronization via WebSockets/Socket.IO. Version 0.4.1 (last release: ~2016). Works with the mysql-live server package to enable reactive collections, auto-updating queries, and latency compensation similar to Meteor. Ships TypeScript definitions. Suitable for building live-updating web apps with MySQL backends. Note: project appears unmaintained since 2016.

npm install mysql-live-client
INSTALL
IMPORT
SIG · MYSQL-LIVE-CLIENT
M
mysql-live-client
databasejavascriptv0.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default import
import LiveClient from 'mysql-live-client'
const LiveClient = require('mysql-live-client')
Package exposes a default export; named exports are not available. CJS require works but ESM import is preferred.
live (namespace)
import LiveClient from 'mysql-live-client'; const live = LiveClient.live;
import { live } from 'mysql-live-client'
'live' is a property of the default export, not a named export.
Collection
const coll = new LiveClient.Collection(name, table)
import { Collection } from 'mysql-live-client'
Collection is a constructor available on the default export instance or via LiveClient.Collection.

Initialize a mysql-live-client instance, subscribe to a server publication, and listen for collection updates.

// client-side (browser or Node) import LiveClient from 'mysql-live-client'; const options = { host: 'http://localhost:8080', // optional: auth token }; const live = new LiveClient(options); // subscribe to a publication live.subscribe('allUsers'); // handle collection data live.on('usersCollection', (data) => { console.log('Received users:', data); }); // client can also call methods if server defines them // live.call('someMethod', arg1, arg2, callback); // cleanup on unmount live.disconnect();
Debug
Known issues
deprecatedProject last updated in 2016; may be unmaintained.
fix
Consider alternatives like Meteor, Socket.IO with custom sync, or Hasura for real-time MySQL.
affects: >=0.0.0
breakingSocket.IO version mismatch: client v0.4.1 depends on Socket.IO 1.x, but server mysql-live may require specific version.
fix
Ensure client and server use compatible Socket.IO versions (both 1.x or both 2.x via custom build).
affects: >=0.4.0
gotchaTypeScript definitions may be incomplete or outdated.
fix
Supplement with custom type declarations or use @ts-ignore as needed.
affects: >=0.4.0
breakingPackage ships a compat minified bundle that includes lodash and socket.io-client; using that bundle may conflict with other versions.
fix
Use npm import instead of the compat script tag to avoid duplicates.
affects: >=0.4.0
Errors
Common errors & fixes
Uncaught TypeError: LiveClient is not a constructor
Using named import instead of default import.
fix
Use `import LiveClient from 'mysql-live-client'` instead of `import { LiveClient } from 'mysql-live-client'`.
Uncaught TypeError: Cannot read property 'subscribe' of undefined
Not instantiating LiveClient with new keyword.
fix
Use `const live = new LiveClient(options)` instead of `const live = LiveClient(options)`.
Error: No server publication named '...'
Attempting to subscribe to a publication that does not exist on the server.
fix
Ensure the server has published the collection with `.publish()` or check the publication name spelling.
Upgrade
Version history
0.4.1latest on npm
Audit
Dependencies
socket.io-clientrequiredWebSocket transport for real-time communication with server
lodashrequiredUtility functions for object/array manipulation
Agent activity
5 hits · last 30 days
node
4
Resources
mysql-live-client — npm install mysql-live-client · libregistry