Package JSON Demystified - Dependencies and DevDependencies
Тәжірибелік нұсқаулар және стиль
In this Javascript tutorial on NPM Package.JSON keywords 'dependencies' and 'devDependencies' we look at how they are used to tailor the experience for consumers of your NPM package and then also developers working on enhancements to the package itself.
Пікірлер: 18
Thanks for sharing. Years using npm and I just discovered the difference between dependencies and dev-dependencies.
@Ashotofcode
3 жыл бұрын
Glad it was helpful Gideon :-) Cheers Mark
awesome !
@Ashotofcode
2 жыл бұрын
Glad you enjoyed😎 cheers Mark
Thanks! Very good content!
@Ashotofcode
2 жыл бұрын
Glad you liked it Ana :-) Cheers Mark
great explanation! thanks!
@Ashotofcode
2 жыл бұрын
Glad you enjoyed it Andre 🙂Cheers Mark
Good demo. It's still a little unclear how npm decides who is a user vs who is a developer. They both install via 'npm install'.
@Ashotofcode
3 жыл бұрын
Hi Michael, good question, this part comes down to where your package.json is located, npm will only install the devDependencies from a package.json in the current folder, which will be your package.json if developing a package. When we then npm install a dependency it ends up in the node_modules folder, and these ones only the dependencies will get installed for :-) Cheers Mark
@joostschuur
2 жыл бұрын
@@Ashotofcode Super interesting, I did not know this!
I'm very grateful with you for sharing this knowledge, already subscribed to your channel and I would like to know more about NPM environment Thumbs Up 👍
@Ashotofcode
2 жыл бұрын
Thanks Alex, more to come I'm intending yes 🙂
Thank you!
@Ashotofcode
2 жыл бұрын
Welcome Peter! Glad was useful 🙂Cheers Mark
Thanks for the demo, extremely useful, please let me know like if a project contains many libraries and each lib has it’s own package.json and a root application which has these libs in the dependency section, so if a package say ‘abc’ is present as a dev dependency and peer dependency in one of the libs and as a dependency in the root application( we run the root application) , do we still need to add the package as a Dev dependency to the lib?
☀️
@Ashotofcode
3 жыл бұрын
Thanks Andrew :-)