depcheck is a npm packange which checks what dependencies are not used in the project.
https://www.npmjs.com/package/depcheck
As you can see on the link, it is very easy to use.
Mainly it is used to clear package.json file.
npm install -g depcheck
npx depcheck