#!/usr/bin/env node
/**
* Script to update the ExploitDB database
* This script can be run manually or scheduled to keep the database up to date
*/
import exploitdb from '../exploitdb/index.js';
import { ensureDataDir } from '../config.js';
// Main function
const main = async () => {
try {
console.log('Starting ExploitDB database update...');
// Ensure data directory exists
await ensureDataDir();
// Update the database
const count = await exploitdb.updateDatabase();
console.log(`Database update completed. Processed ${count} exploits.`);
process.exit(0);
} catch (error) {
console.error('Error updating database:', error);
process.exit(1);
}
};
// Run the main function
main();