How to use OCP core events

i want to use OCP file events in my app.
after upload a file in nextcloud , we want to get some metadata from the file , we need a sample code , and how to use them ( i read docs , but it seems document is old ).
thank you.

Events are documented at The document is up to date.