How to see what hooks are firing?
-
Why do you want to see that? What for? If you just want a list of available hooks look at this page: https://github.com/NodeBB/NodeBB/wiki/Hooks
-
That might be a bit much even for verbose? One click gave me 87 lines of output that I can't post here because even Askimet thinks this is a bit spamy
It sure might be an interesting idea. But it also doesn't give a lot of information. For example it gives you no context information of the fired hooks. Why was it fired, for what was it fired, etc?
-
If you're on Linux this can be achieved. I'm at the moment doing this to exclude all of them:
./nodebb dev | grep -v "plugins/fireHook"
If you only want action hooks you could do something like this:
./nodebb dev | grep -v -e "plugins/fireHook] filter" -e "plugins/fireHook] static"
Probably somehow also possible with the PowerShell on Windows.
-
If you want to filter for hooks you can just leave out the
-v
. It will exclude every line others than the ones that include the pattern. For example:
./nodebb dev | grep "plugins/fireHook] filter:parse.post"
This would only show you lines that include this pattern. Again you can combine multiple patterns, just provide each via the
-e
argument. For example:
./nodebb dev | grep -e "plugins/fireHook] filter:parse.post" -e "plugins/fireHook] filter:users.get"