- Added functionality to detect if the script is run directly, allowing for conditional execution of the main function. - Imported `pathToFileURL` from the 'url' module to facilitate the direct run check, improving script usability and flexibility.