Posts

Showing posts from October, 2020

NPM dependencies vs devDependencies

What's the difference between dependencies and devDependencies in npm? If you are creating just an application or a service, there isn't a difference in the usage. However, if you are creating a library, this following key part may help you understand the difference: Anything is the devDependencies list will NOT be installed in the client application while everything in the dependencies list will be. Why does it matter? Scenario 1 Imagine your library is to offer a date time parser to its users. You may be using eslint for your development linting check. If you decide to put it in the dependencies list, when user install your library package, the eslint listed in your "dependencies" list will also be installed into users' node_modules folder, even if users have decided not to use any eslint feature at all for their applications. This increase the overall package size for their application if it is a Node JS application and also force the client to unneces