Variables in Node.js

So I’m trying to make a variable accesible outside a function. I’ve tried multiple things in attempt to fix it. My code is https://github.com/Dog2puppy/splatoon2.ink-node-api-client/blob/Dog2puppy-patch-1/index.js