undetected-chromedriver-js
Version:
Node.js wrapper for undetected-chromedriver with automatic setup and cross-platform support
27 lines (21 loc) โข 733 B
JavaScript
const fs = require('fs');
const path = require('path');
function removeDir(dirPath) {
if (fs.existsSync(dirPath)) {
fs.rmSync(dirPath, { recursive: true, force: true });
console.log(`โ Removed ${dirPath}`);
}
}
function removeFile(filePath) {
if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
console.log(`โ Removed ${filePath}`);
}
}
console.log('๐งน Cleaning up undetected-chromedriver-js...');
// Remove virtual environment
removeDir(path.join(process.cwd(), '.venv'));
// Remove generated files
removeFile(path.join(process.cwd(), 'chromedriver_path.txt'));
removeFile(path.join(__dirname, 'generate_executable.py'));
console.log('โ
Cleanup completed. Run npm run setup to reinstall.');