Global js scripts

Hi, everyone.

I have a js code that I use in one custom script and I want it to be accessible in another js inside the app and in other apps.
There is a way in hooks for example to do this? I want to follow the DRY principle.

Thanks in advance

You can include you js code to app via hooks app_include_js in your custom app, please check the hooks.py in frappe or erpnext app