Dependencies in Node.js

Dependencies have a different purpose.


dependencies are normally needed when running the code. They are like a library. They have functions that you call from the code.


devDependencies are needed at some point in the development workflow. When doing npm link or  npm install from the root of a package this dependencies will be installed 


peerDependencies are required only when you are publishing your own package. Dependencies that your project hooks into or modifies in the parent project. Having a peerDependency means the person installing your project must have the exact dependencies your package is having.


optionalDependencies are those categories of dependencies which will show a successful process status even if the installation failed. These are useful for dependencies that won’t work necessarily on every system. Your program should have the code to handle the lack of dependency.


When publishing the package an array of package names will be bundled. They should be inside your project. They have the same functionalities of normal dependencies. bundledDependencies are useful where normal dependencies are not sufficient. You can bundle your dependencies in a tarball file by specifying package names in the bundled Dependencies array and executing npm package.