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.
node-mini-migrations
Advanced tools
Readme
A really simple node migrations library that is completely independant of any database or file system.
npm install --save node-mini-migrations
const sqlite = require('sqlite-fp/promises');
const up = require('node-mini-migrations/up');
const getMigrationsFromDirectory = require('node-mini-migrations/getMigrationsFromDirectory');
function migrator (db) {
return {
init: (direction) => {
return sqlite.run(db, 'CREATE TABLE IF NOT EXISTS _migrations (file TEXT PRIMARY KEY);');
},
getMigrationState: (id) => {
return sqlite.getOne(db, 'SELECT file FROM _migrations WHERE file = ?', [id]);
},
setMigrationUp: (id) => {
return sqlite.run(db, 'INSERT INTO _migrations (file) VALUES (?)', [id]);
},
setMigrationDown: (id) => {
return sqlite.run(db, 'DELETE FROM _migrations WHERE file = ?', [id]);
},
handler: (fn) => fn(db)
};
};
const db = await sqlite.connect('./test.sqlite');
await up(
migrator(db),
getMigrationsFromDirectory('./test/migrations')
);
module.exports = {
up: (db) => {
return db.exec('CREATE TABLE test_table (test TEXT)')
},
down: (db) => {
return db.exec('DROP TABLE test_table')
}
}
This project is licensed under the terms of the MIT license.
FAQs
Unknown package
The npm package node-mini-migrations receives a total of 14 weekly downloads. As such, node-mini-migrations popularity was classified as not popular.
We found that node-mini-migrations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.