Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mysql-client
Advanced tools
This MySQL implementation supports some basic MySQL protocol commands. I plan to support the full MySQL protocol except the deprecated parts.
var Connection = require('./lib/Connection').Connection;
var myCon = new Connection('user', 'pass');
myCon.on('authenticated', function() {
myCon.selectDb('test'); // Even tough the querys are asynchronous, this is possible (through query-queue)
myCon.query('SELECT * FROM foo', function(err, packet) {
console.log(packet);
});
});
boolean Connection.prototype.options.bufferRows
Decides, if rows should get buffered
boolean Connection.prototype.options.autoBox
Converts the MySQL datatypes to javascript datatypes automatically.
{0, 1, 2} Connection.prototype.options.fetchMode
Decides the fetchmode.
Connection([string user[, string password[, string host[, number port]]]])
Creates a connection and tries to connect/authorize to the database
Connection.prototype.connect()
Connects to the database, if the first attempt wasn't successful/the connection got destroyed
Connection.prototype.close(function(string err, ParseablePacket pp) listener)
Closes the connection to the database through the mysql_close command. Fires off listener, after a result.
Connection.prototype.destroy()
Destroys the socket to the database immediatly. No more reads/writes will be possible.
Connection.prototype.selectDb(string db, function(string err, ParseablePacket pp) listener)
Selects a database. Fires off listener after a result of the database.
Connection.prototype.query(string cmd, function(string err, Array.<Object.<*>> rows) listener, function(ColumnPacket cp) columnCb, function(Object.<*> data) rowCb)
Sends a query to the database. Fires off listener after a full result/error of the database. If no error occured and buffering rows is activated, rows contains every row. Fires columnCb for every received column entry; fires rowCb for every received row.
drain
Fired, when all querys are executed and all result sets are received.
authenticated
Fired, when the authentication was successful.
error
Fired, when the authentication wasn't successful (will maybe have more meanings; for example when the connection is destroyed/not accessible anymore)
FAQs
A full-featured mysql client for node
We found that mysql-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.