Run script during plugin Uninstallation

Hi everyone,
I am creating a plugin to use on PeerTube. I have a script that should run at the time of plugin installation and plugin remove. The script runs when installation the plugin using register. But, I am unable to run script on plugin unregister. Can anyone provide me idea on how can i run script when plugin is uninstalling.

You just have to override the unregister method.
Check here for example: