This is a poc of how you can infect node modules and execute code every time the application that uses them start.
Modules are the blocks of encapsulated code that communicates with an external application on the basis of their related functionality. Modules can be a single file or a collection of multiples files/folders. Node modules can be found in almost every electron application such as ( discord, nzxt, slack, signal, vscode, etc.).
I have created a reverse tcp payload just for the poc but you can inject what ever you want as long as its nodejs code.