Panel Hook and javascript


Hi everyone!
I want to create a panel hook that adds metadata to a file but to extract the data from the file I need to use a javascript library. So, is it possible to load .js inside a hook file?

Thanks in advance!


JavaScript only works in the browser, not in backend code (unless you use node on the server). I don’t really understand what you are trying to do here, could you provide some more details, please?

I assume you mean you need to get the metadata from somewhere (from where and why does it need JavaScript?) to add it to a file in the Kirby folder?


I’m trying to get the metadata stored inside a font file. But I think I can do it without using the js library I was thinking. I just found a php version lib to do it. I will try it now.
Thanks for your comment it made me think harder haha