Registry / database / speedt-mysql

speedt-mysql

JSON →
library0.1.65jsnpmunverified

A lightweight MySQL client library for Node.js, version 0.1.65. Provides basic database connection and query functionality with a simple API. Release cadence is irregular with limited maintenance. Differentiators: minimal dependencies and straightforward usage for small projects, but lacks advanced features like connection pooling or prepared statements found in more mature libraries like mysql2 or knex.

npm install speedt-mysql
INSTALL
IMPORT
SIG · SPEEDT-MYSQL
S
speedt-mysql
databasejavascriptv0.1.65
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 'speedt-mysql'
const mysql = require('speedt-mysql')
Library uses ESM default export. In CommonJS, use dynamic import: const mysql = await import('speedt-mysql')
query
import { query } from 'speedt-mysql'
const { query } = require('speedt-mysql')
Named export for query function, not available in CommonJS require
connection
import { connection } from 'speedt-mysql'
import { connect } from 'speedt-mysql'
Export is 'connection' not 'connect'. Use to create a connection object.

Creates a MySQL connection and executes a simple SELECT query using callbacks.

import mysql from 'speedt-mysql'; const connection = mysql.createConnection({ host: 'localhost', user: 'root', password: process.env.DB_PASS ?? '', database: 'test' }); connection.query('SELECT * FROM users', (err, results) => { if (err) throw err; console.log(results); });
Debug
Known issues
gotchaNo built-in connection pooling; creating many connections will exhaust resources.
fix
Use a connection pooling library like mysql2 with pool, or manage connections manually.
affects: >=0.0.0
gotchaCallback-based API; no Promise support by default. Query results require callbacks.
fix
Wrap queries in Promise: new Promise((resolve, reject) => connection.query(sql, (err, res) => err ? reject(err) : resolve(res))).
affects: >=0.0.0
deprecatedThe createConnection method may be deprecated in future versions.
fix
Check documentation for alternative method or migrate to mysql2.
affects: 0.1.60-0.1.65
Errors
Common errors & fixes
Error: Cannot find module 'speedt-mysql'
Package not installed or incorrect import path.
fix
Install with 'npm install speedt-mysql' and ensure your Node.js version supports ESM (>=13.2) or use dynamic import.
TypeError: mysql.createConnection is not a function
Wrong import style: using require in CJS or destructuring incorrectly.
fix
Use default import: 'import mysql from 'speedt-mysql'' or 'const mysql = await import('speedt-mysql')'.
Upgrade
Version history
0.1.65latest on npm
Audit
Dependencies
mysqlrequiredCore MySQL driver for Node.js
Agent activity
9 hits · last 30 days
node
8
Meta
1
Resources
speedt-mysql — npm install speedt-mysql · libregistry