Registry / database / is-mysql

is-mysql

JSON →
library0.3.0jsnpmunverified

Check if a MySQL server is running on the local machine. Version 0.3.0, last updated in 2014. Minimal dependency (only a shell command check). No active development; consider this a simple utility with no promise/error handling. Not suitable for production monitoring.

npm install is-mysql
INSTALL
IMPORT
SIG · IS-MYSQL
I
is-mysql
databasejavascriptv0.3.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 isMysql from 'is-mysql'
import { isMysql } from 'is-mysql'
Module exports a single function as default.
require
const isMysql = require('is-mysql')
const { isMysql } = require('is-mysql')
CommonJS users must require the entire module.
CLI
is-mysql
npm run is-mysql
CLI is invoked directly after global install.

Demonstrates both Promise and callback usage to check if MySQL is running.

import isMysql from 'is-mysql'; isMysql().then((result) => { console.log(result.running); // true or false }).catch((err) => { console.error(err); }); // or with callback: isMysql((result) => { console.log(result.type); // 'mysql' });
Debug
Known issues
breakingModule uses callback with single argument; modern code expects error-first callback or Promise.
fix
Wrap in a Promise or use the built-in promise support.
affects: <=0.3.0
gotchaNo error handling for missing mysql command; throws unhandled rejection.
fix
Add try-catch or .catch handler.
affects: <=0.3.0
deprecatedPackage has not been updated since 2014; no ES module or TypeScript support.
fix
Consider using 'is-docker' or a custom exec check for MySQL.
affects: <=0.3.0
Errors
Common errors & fixes
TypeError: isMysql is not a function
Incorrect import syntax (named import instead of default).
fix
Use `import isMysql from 'is-mysql'` or `const isMysql = require('is-mysql')`
UnhandledPromiseRejectionWarning: Error: spawn mysql ENOENT
MySQL client not installed or not in PATH.
fix
Install MySQL server/client or update system PATH.
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
is-mysql — npm install is-mysql · libregistry