Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
After a little deeper research I've found how this is done using the secp256k1 library in the ethereumjs-util code:
const sig = secp256k1.sign(msgHash, privateKey)
Where msgHash is a Buffer containing the transaction hash. sig.signature is the signature hex code.
Code found here
Required, but never shown