A sample npm package
npm install evacommerceopenWindowElectron(filePath) - Opens an Electron window with the specified file
getScreenResolution(page) - Gets the screen resolution
getChromeExecutablePath() - Gets the Chrome executable path based on platform
openBrowserFirstPage(browser) - Opens or reuses the first page in a browser instance
openNewPage(browser) - Opens a new browser page with proper viewport settings
createNavigationInstance(userDataDir, directoryName) - Creates a configured browser instance
getIframe(page, selector) - Gets an iframe from the specified selector
ctrlz(page) - Simulates Ctrl+Z keyboard shortcut
ctrla(page) - Simulates Ctrl+A keyboard shortcut
copyPasteText(page, selector, inputText) - Copies and pastes text using clipboard
clearInputAndWrite(page, selector, inputText, secondElement, timeout) - Clears input field and enters new text
waitForSelectorAndType(page, selector, inputText) - Waits for a selector to appear and types text
deleteFieldValueByBackspace(input) - Deletes field value using backspace
connectToDatabase(sequelize) - Establishes and verifies database connection with retry
createCronInstance(cronTime, functionJob, onComplete, start) - Creates a new cron job with timezone settings
createSequelizeConnection({ host, port, username, password, database }, pathModels) - Creates and configures Sequelize connection and loads models
connectToMongo() - Connects to MongoDB with retry functionality
isDisconnected() - Checks if MongoDB connection is disconnected
controllerMethod(req, res, schema, methodFunction, parametersMethod) - Handles request validation and execution
controllerMiddleware(controller) - Middleware for exception handling in controllers
getIdMachine() - Gets unique hardware identifier for the machine
get(url, options) - Makes GET request
post(url, data, options) - Makes POST request
put(url, data, options) - Makes PUT request
delete(url, options) - Makes DELETE request
startCron(cronConfig) - Starts cron execution
scheduleCronJob(job, schedule) - Schedules a cron job
stopAllCronJobs() - Stops all running cron jobs
startServer(port, options) - Starts server on specified port
stopServer() - Stops running server
restartServer() - Restarts running server
loginToFacebook(credentials) - Logs in to Facebook
postToFacebook(content) - Posts content to Facebook
navigateToFacebookPage(pageUrl) - Navigates to specific Facebook page
loginToML(credentials) - Logs in to MercadoLivre
navigateToMLDashboard() - Navigates to ML dashboard
editMLListing(listingId, data) - Edits ML listing
updateMLPrice(listingId, price) - Updates price on ML listing
updateMLStock(listingId, stock) - Updates stock on ML listing
createMLAccount(userData) - Creates ML account
registerMLSeller(sellerData) - Registers as ML seller
createMLListing(productData) - Creates new ML listing
createNuvemShopStore(storeData) - Creates new NuvemShop store
configureNuvemShopStore(storeId, config) - Configures store settings
loginToNuvemShop(credentials) - Logs in to NuvemShop
addProductToNuvemShop(productData) - Adds product to NuvemShop
editProductInNuvemShop(productId, data) - Edits product in NuvemShop
loginToSoftUp(credentials) - Logs in to SoftUp
navigateToSoftUpDashboard() - Navigates to SoftUp dashboard
logoutFromSoftUp() - Logs out from SoftUp
generateChatGptResponse(prompt) - Generates response from ChatGPT
optimizeProductDescription(description) - Optimizes product descriptions
generateDeepseekResponse(prompt) - Generates response from Deepseek
analyzeProductImage(imagePath) - Analyzes product images
generateGeminiResponse(prompt) - Generates response from Gemini
generateProductVariations(baseProduct) - Generates product variations
searchImages(query) - Searches for images using Google
downloadTopImages(query, count) - Downloads top images for query
reverseImageSearch(imagePath) - Performs reverse image search
logInfo(message) - Logs informational message
logSuccess(message) - Logs success message
logWarning(message) - Logs warning message
logError(message) - Logs error message
formatDate(date, format) - Formats date to specified format
getDateDifference(date1, date2) - Gets difference between dates
isDateValid(dateString) - Validates date string
downloadImage(url, path) - Downloads image from URL to path
resizeImage(imagePath, width, height) - Resizes downloaded image
cleanDirectory(directory) - Cleans all files from a directory
checkFileType(url) - Checks if a file is an image or document based on extension
addPrefix55IfNotPresent(phoneNumber) - Adds the "55" prefix to a phone number if not present
formatPriceChangePeriodToComma(number) - Formats a price by changing period to comma
formatUrlsToHtml(text) - Converts URLs in text to HTML anchor tags
extractImageUrls(urls) - Extracts image URLs from a list of URLs
getMainDomain(url) - Gets the main domain from a URL
buildFullUrl(domain, urlPath) - Builds a full URL from domain and path
extractIdFromUrlMercadoLivre(url) - Extracts product ID from a Mercado Livre URL
extractUrlsForText(text) - Extracts URLs from text
waitForSelector(page, selector, timeout) - Waits for an element with the specified selector to appear
waitForTimeout(ms) - Returns a promise that resolves after the specified milliseconds