Parse MySQL connection strings to extract user, password, host, port, and database parameters, producing output compatible with mysql or mysqldump command-line clients. Version 3.0.2 supports Node >=20 and ESM-only. Unlike generic URI parsers, it specifically handles MySQL URIs and outputs formatted CLI flags. The package is small, focused, and provides both a CLI tool and a module API. Release cadence is low; no recent major changes.
npm install mysql-parseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to parse a MySQL URI and build CLI parameters for mysqldump, with named imports and execSync integration.
Use import syntax or enable ESM in your project.
Do not manually add a space after -p; the output is intentionally -ppassword.
Ensure URI includes a database path segment if needed.
Place extra options before $(mysql-parse ...) as shown in README.
Add "type": "module" to package.json or use .mjs extension.
Use import { parseUri, buildMysqlParams } from 'mysql-parse'.Install package: npm install mysql-parse
No dependency data recorded yet.