I also struggled for a while to figure out how to use the gamepad module. I’ve been accessing gamepad state with “window.gamepad”. You do not need to import the module yourself.
Eg.
/* User Input */
if (window.gamepad.btn.right) character.x += 1;
if (window.gamepad.btn.left) character.x -= 1;
if (window.gamepad.btn.up) character.y -= 1;
if (window.gamepad.btn.down) character.y += 1;