Unable to use Javascript Library in Browser

I want to log all the events from a midi file.
I found a library that should do just that:
text

Problem is I can’t figure out how to use it in a website.
I’ve tried with a CDN from jsdeliver, however I get the error: “loadFile is only supported on Node.js”

I’ve tried with npm and vite build, however I still get the same error. The library uses the following codeCode

This library has 350 stars and seems like it should be of good quality,
If you could help me figure out how to correctly use it in a web project, that would be great. (in the browser)

Right now, I’m using the ES6 import:enter image description here

Not sure how I can use nodejs in the browser, or if there is something I can do to fix this, is this the fault of the library?

I can perfectly fine import local files for Threejs (for example) within the same project. Not sure why this dosen’t work…

Thanks for any help!