Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
node-mini-migrations
Advanced tools
A very small, lightweight and flexible migrations library unconcerned with what database you use
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');
const righto = require('righto');
const righto = require('node-mini-migrations/up');
function migrator (db) {
return {
init: (direction, callback) => {
sqlite.run(db, 'CREATE TABLE IF NOT EXISTS _migrations (file TEXT PRIMARY KEY);', callback);
},
getMigrationState: (id, callback) => {
sqlite.getOne(db, 'SELECT file FROM _migrations WHERE file = ?', [id], callback);
},
setMigrationUp: (id, callback) => {
sqlite.run(db, 'INSERT INTO _migrations (file) VALUES (?)', [id], callback);
},
setMigrationDown: (id, callback) => {
sqlite.run(db, 'DELETE FROM _migrations WHERE file = ?', [id], callback);
},
handler: (fn, callback) => fn(db, callback)
};
};
const db = righto(sqlite.connect, './test.sqlite');
const driver = righto.sync(migrator, db);
const migrations = getMigrationsFromDirectory('./test/migrations');
const migrated = righto(up, driver, migrations);
migrated(callback)
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
A very small, lightweight and flexible migrations library unconcerned with what database you use
The npm package node-mini-migrations receives a total of 43 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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.