A minimal singleton wrapper around the MySQL npm driver that provides a single shared connection pool. Currently at version 1.0.5, last updated in 2018. It offers both callback-based and Promise-based connection retrieval. Differentiators: extremely simple API, but lacks connection management features and is not actively maintained. Consider using mysql2 or knex for production.
npm install mysql-singletonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: configure the singleton, get a connection asynchronously, run a query, and release the connection.
Migrate to mysql2 or knex for active support and security patches.
Use getConnectionPromise for async/await or pass a callback to getConnection.
Ensure the config object includes a 'database' property.
Run 'npm install mysql' as a peer dependency.
Ensure the package is installed: 'npm install mysql-singleton' and required correctly.