We use node-mssql for connecting to SQL server from node js application. Its default driver Tedious supports azure managed identity but not windows auth.
There is another driver msnodesqlv8 which supports windows auth but not azure managed identity. Looks like the documentation does not have any info about azure managed identity support.
https://github.com/TimelordUK/node-sqlserver-v8