A lightweight promise-based wrapper around the mysql package (version 2.x) that simplifies common database operations like select, insert, update, and delete. Version 0.3.3 is the current stable release; the package has seen no updates for over 5 years and is considered feature-complete. It provides a cleaner API with helper methods for CRUD operations and transaction support, but lacks TypeScript definitions and modern async/await patterns. It is best suited for small to medium projects already using the mysql driver, but for new projects consider more up-to-date alternatives like mysql2 or knex.
npm install mysql-easyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a connection pool, inserts a row, selects rows by condition, and closes the pool using CommonJS require.
Update code to use .then() or async/await with createTransaction().
Consider migrating to mysql2 or an alternative wrapper like promise-mysql.
Use an array of strings for fields to avoid confusion; the object syntax maps field names to result properties.
Always provide a where condition to avoid accidental mass deletion.
Wrap your queries in a retry loop or use a connection pool with built-in recovery.
Switch to mysql2 which is actively maintained and provides better security.
Run: npm install mysql
Use const mysqlEasy = require('mysql-easy'); instead of import.Ensure query() is called with a string SQL and optional array of params. Check that db is a valid connection/pool.
Verify host, user, password, and database in the connection config.