node-vigem
Credit goes to Nefarius for his fantatstic work on ViGEm and ViGEm Bus Driver (Required)
Zero runtime checks, use together with TypeScript.
Almost a 1:1 mapping of the C++ API for ViGEm Client.
Differences:
- No manual freeing of memory
- Report has a nested structure
- Exceptions instead of return codes
Check addon.d.ts for documentation.
Example
;// create clientlet client = vigem;// create controllerlet x360 = vigem;// connect client to drivervigem;// connect controller to clientvigem; let report = // set dpad to South East dpad: x: 1 y: -1 thumbs: left: x: 0 y: 0 right: x: 0 y: 0 // press button A and B buttons: vigemXUSB_BUTTONA | vigemXUSB_BUTTONB triggers: left: 0 right: 0 ; // set state of the connected controllervigem;