The question is published on by Tutorial Guruji team.
What I am trying to do is when I do npm install for my app itself I need to check unused dependencies in package.json.
Is there any way to include npm package https://www.npmjs.com/package during npm install itself, so that I don’t need to install it seprately see unused dependencies like this
Thanks,
Answer
I think I get what you’re trying to do, but I might be confused. Check out the “scripts” option for package.json. You can install depcheck-es6 as a dev dependency, and then do something like:
"scripts": { "prepublish": "depcheck [directory] [arguments]" }
Which would check your dependencies before you publish, it will also be run locally when you run npm install
which I think accomplishes what you want.
Check out all the options in the NPM Scripts Docs