UNPKG

@hashangit/breachhound

Version:

An efficient OSINT tool for uncovering digital footprints associated with a username. TypeScript port of GoSearch.

53 lines 2.26 kB
#!/usr/bin/env node "use strict"; // Shebang makes it executable var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const dotenv_1 = __importDefault(require("dotenv")); const path_1 = __importDefault(require("path")); const args_1 = require("./args"); const ui_1 = require("./ui"); const lib_1 = require("../lib"); // Import the main engine function const config_1 = require("../lib/config"); // Need this for site count // Load .env file variables into process.env dotenv_1.default.config({ path: path_1.default.resolve(process.cwd(), '.env') }); async function main() { const args = await (0, args_1.parseArguments)(); // Get API keys from environment variables (prefer env over args if both exist?) // Or prioritize args? Let's prioritize args if provided, else fallback to env. const breachDirectoryApiKey = args.breachDirectoryApiKey || process.env.BREACH_DIRECTORY_API_KEY; // Add other API keys if needed await (0, ui_1.deleteOldFile)(args.targetUsername); // Fetch config early to get site count for header const siteConfigData = await (0, config_1.fetchWebsiteConfig)(); const siteCount = siteConfigData?.websites?.length ?? 0; (0, ui_1.printHeader)(args.targetUsername, siteCount, { hideFalsePositives: args.hideFalsePositives, breachDirectoryEnabled: !!breachDirectoryApiKey }); if (siteCount === 0) { console.error("Exiting: Could not load website configuration."); return; } const results = await (0, lib_1.runChecks)(args.targetUsername, { breachDirectoryApiKey: breachDirectoryApiKey, // Pass other keys if needed }); if (results) { await (0, ui_1.displayResults)(results, args.targetUsername, args.hideFalsePositives); } else { console.error("BreachHound checks failed to complete."); } } main().catch(error => { console.error("\n[-] An unexpected error occurred:", error); process.exit(1); }); main().catch(error => { console.error("\n[-] An unexpected error occurred:", error); process.exit(1); }); //# sourceMappingURL=index.js.map