I received a nodejs website with many redundant js files. How can I know which js files in this website folder are unused and can be deleted?

  node.js, question

Thank you very much. Or how to traverse the entire website to know which js files are used

It’s hard.
Only some incomplete and reliable solutions can be provided.

Strace -e trace=open node your website.js
straceAll files you visit will be recorded.
Then find a way to traverse the entire website, such ascurl/wget(but not ajax. )

Otherwise, let your website run long enough and then
Find -atime plus 180 directoryFind files that have not been accessed for more than 180 days.