How can I get bpm from an audio file using p5.js?

Hello everybody! How can I get bpm from an audio file using p5.js?

I have not been able to figure out all this

peak detection might be helpful:

it doesn’t work for me, it doesn’t see peeks