A lightweight MySQL database abstraction layer for Node.js that simplifies pooling and prepared statements. Version 4.0.3 is the current stable release, with semi-regular updates from a single maintainer. It wraps the popular mysql2 driver, providing an async/await interface with named parameter support (using @param syntax) and TypeScript type definitions built-in. Key differentiators: no external dependencies beyond mysql2, minimal API surface with methods like query(), execute(), getOne(), getValue(), and exists(), and automatic connection pooling via a single class instance. Suitable for small-to-medium projects wanting a thin wrapper without ORM overhead.
npm install slim-node-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a SlimNodeMySQL instance, then using the five main methods: query, execute, getOne, getValue, and exists with named parameters.
Replace ? placeholders with @paramName and pass an object with matching keys.
Use getOne() when expecting at most one result row.
Use database.query() for SELECT statements to get typed results.
Use: import { SlimNodeMySQL } from 'slim-node-mysql';Ensure correct import: const { SlimNodeMySQL } = require('slim-node-mysql'); then const db = new SlimNodeMySQL(connectionString);Pass the parameters object as second argument to query/execute/getOne/getValue/exists.