NodeJS can authenticate with SharePoint in several ways:
1) User only authentication using Microsoft STS or NTLM for on-premise SharePoint.
2) User + add-in identity using OAuth or Azure ACS with S2S for the add-in.
3) Add-in only authentication using an Azure AD application and S2S calls.
Tools like SharePoint Passport JS and the Azure AD library support these authentication methods.