Registry / database / lz-nmysql

lz-nmysql

JSON →
library1.0.4jsnpmunverified

lz-nmysql is a lightweight MySQL interface wrapper for Node.js. This package provides a simplified API for executing queries and managing connections. Current version is 1.0.4. There is no clear release cadence. It differentiates by offering a thin layer over the mysql driver. However, note that this package has no README, is unmaintained, and may have security issues. Use at your own risk.

npm install lz-nmysql
INSTALL
IMPORT
SIG · LZ-NMYSQL
L
lz-nmysql
databasejavascriptv1.0.4
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 mysql from 'lz-nmysql'
const mysql = require('lz-nmysql')
ESM-only package. CommonJS require will fail if the package is not dual CJS/ESM.
query
import { query } from 'lz-nmysql'
Named export for executing queries. Check actual exports; this may not exist.
pool
import { pool } from 'lz-nmysql'
const pool = require('lz-nmysql').pool
If using CommonJS, ensure the package supports it. Best to use ESM imports.

Demonstrates creating a MySQL connection and running a simple query using lz-nmysql, assuming promise-based API.

import mysql from 'lz-nmysql'; async function run() { try { const connection = await mysql.createConnection({ host: process.env.DB_HOST ?? 'localhost', user: process.env.DB_USER ?? 'root', password: process.env.DB_PASS ?? '', database: process.env.DB_NAME ?? 'test' }); const result = await connection.query('SELECT 1 + 1 AS solution'); console.log(result); await connection.end(); } catch (err) { console.error(err); } } run();
Debug
Known issues
deprecatedPackage has no README and appears unmaintained. Last update over 5 years ago.
fix
Consider using mysql2 or other actively maintained MySQL drivers.
affects: all
gotchaPackage may not be ESM-only; check exports. If using CommonJS, require may fail.
fix
Use dynamic import() or switch to ESM.
affects: *
breakingIf previously used with callbacks, the API might have changed to promises. No type definitions provided.
fix
Wrap calls with promisify or use a wrapper.
affects: 1.0.0 - 1.0.4
Errors
Common errors & fixes
Error: Cannot find module 'lz-nmysql'
Package not installed or not in node_modules.
fix
Run npm install lz-nmysql
TypeError: mysql.createConnection is not a function
Incorrect import or API mismatch.
fix
Ensure you are using the correct import: import mysql from 'lz-nmysql'
ConnectionError: connect ECONNREFUSED
MySQL server not running or wrong host/port.
fix
Check MySQL service and connection credentials.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
mysqlrequiredruntime dependency for MySQL driver
Agent activity
4 hits · last 30 days
node
4
Resources
lz-nmysql — npm install lz-nmysql · libregistry