![Malicious npm Package Typosquats react-login-page to Deploy Keylogger](https://cdn.sanity.io/images/cgdhsj6q/production/007b21d9cf9e03ae0bb3f577d1bd59b9d715645a-1024x1024.webp?w=400&fit=max&auto=format)
Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
larvitdbmigration
Advanced tools
Readme
This is used to keep track of the database structure, and update it when need be via deploys.
At the moment only MariaDB(/MySQL) is supported.
A table by default called db_version will be created, containing a single integer.
Scripts will be placed by default in /dbmigration/.js
Each migration script will be ran, and the db_version increased, until no more migration scripts exists.
In your application startup script, do something like this:
'use strict';
var dbMigration = require('larvitdbmigration');
dbMigration({'host': '127.0.0.1', 'user': 'bar', 'database': 'bar'})(function(err) {
if (err)
throw err;
// Now database is migrated and ready for use!
});
To use custom table name and/or script path, just change
dbMigration({'host': '127.0.0.1', 'user': 'bar', 'database': 'bar'})(function(err) {
to
dbMigration({'host': '127.0.0.1', 'user': 'bar', 'database': 'bar', 'tableName': 'some_table', 'migrationScriptsPath': './scripts_yo'})(function(err) {
Lets say the current database have a table like this:
CREATE TABLE bloj (nisse int(11));
And in the next deploy we'd like to change the column name "nisse" to "hasse". Then create the file /dbmigration/1.js with this content:
'use strict';
var db = require('db');
exports = module.exports = function(cb) {
db.query('ALTER TABLE bloj CHANGE nisse hasse int(11);', cb);
}
Tadaaa! Now this gets done once and the version will be bumped to 1. If you then create a script named "2.js" you might guess what happends. :)
FAQs
Unknown package
We found that larvitdbmigration demonstrated a healthy version release cadence and project activity because the last version was released less than 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 researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.