Here's what I did recently: https://github.com/morph-games/owls16/blob/main/src/console.js#L26
The idea is that if you're constrained to an NES controller, then you can map a whole bunch of keys to the controller buttons, so that players can just pick and choose which they like.
- WASD and arrow keys for the D-pad
- "A" button: E, X, M, ".", "]"
- "B" button: Q, Z, N, ",", "["
- Start: F, J, B, Enter
- Select: R, H, V, Tab