Registry / database / klaru-mysql-wrapper

klaru-mysql-wrapper

JSON →
library1.2.0jsnpmunverified

A lightweight MySQL wrapper for Node.js providing simplified query execution and connection management. Current version 1.2.0 wraps the standard mysql package with async/await support and basic connection pooling. The API exposes a single default export for creating a connection pool and executing queries. This library has infrequent updates and minimal documentation; no recent changes or known issues. It differentiates by offering a very thin abstraction over mysql, but lacks TypeScript types and community adoption. Prefer more maintained alternatives like mysql2 or knex.

npm install klaru-mysql-wrapper
INSTALL
IMPORT
SIG · KLARU-MYSQL-WRAPPE
K
klaru-mysql-wrapper
databasejavascriptv1.2.0
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 KlaruMySQL from 'klaru-mysql-wrapper';
const KlaruMySQL = require('klaru-mysql-wrapper');
Package may not support CommonJS; ESM recommended.
default
const pool = require('klaru-mysql-wrapper');
import * as KlaruMySQL from 'klaru-mysql-wrapper';
CommonJS usage: package may not export named exports.
default
const { createPool } = require('klaru-mysql-wrapper');
import { createPool } from 'klaru-mysql-wrapper';
Likely no named export; check package source.

Demonstrates creating a connection pool, running a query, and closing the pool.

import KlaruMySQL from 'klaru-mysql-wrapper'; const pool = KlaruMySQL.createPool({ host: 'localhost', user: 'root', password: 'password', database: 'test' }); async function runQuery() { try { const rows = await pool.query('SELECT * FROM users LIMIT 1'); console.log(rows); } catch (err) { console.error('Query failed:', err); } finally { await pool.end(); } } runQuery();
Debug
Known issues
breakingBreaking change: In version 1.0.0, the API changed from callback-based to promise-based. Use async/await.
fix
Update code to use async/await or .then().
affects: >=1.0.0 <2.0.0
deprecatedDeprecated: Pool.query() callback style removed in 1.0.0. Use promises.
fix
Switch to async/await.
affects: >=1.0.0
gotchaCommon mistake: Pool.end() is required to close connections; forgetting causes memory leaks.
fix
Always call pool.end() after queries.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: KlaruMySQL.createPool is not a function
Using incorrect import path or wrong export.
fix
Use default import: import KlaruMySQL from 'klaru-mysql-wrapper';
Error: Cannot find module 'mysql'
Missing peer dependency mysql.
fix
Run: npm install mysql
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
mysqlrequiredCore dependency for MySQL driver functionality
Agent activity
5 hits · last 30 days
node
4
Resources
klaru-mysql-wrapper — npm install klaru-mysql-wrapper · libregistry