I want to add a package whenever it is required in my code than adding an optional dependency. Is there any disadvantage of this approach? Example:
this.install('test-package');
Instead of in package.json
"optionalDependencies": {
"test-package": "^1.0.0"
},