A MySQL command-line tool for Node.js that executes SQL statements and returns results as an object array. Current stable version 0.1.8, released in 2019. The package provides a simple promise-based API to run multiple SQL statements (e.g., USE, SELECT) in a single call, returning an array of row objects. It requires manual configuration of host/username/password and supports dynamic connections per query. This is a lightweight alternative to full ORM solutions like Sequelize, but lacks active maintenance.
npm install mysql-cli-execNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to initialize the library with connection config, execute SQL, and handle the returned array.
Migrate to mysql2: npm install mysql2 and use its promise API.
Parse results manually or use multiple exec calls.
Create custom type declarations or use require() with JSDoc.
Use `const { init } = require('mysql-cli-exec');` instead of `const myCli = require('mysql-cli-exec'); myCli.init(...)`Use async/await or .then(): `const result = await myCli.exec(sql);`
Ensure config.username, config.password, and config.host are correct.