npm-intro Flashcards
What is NPM?
NPM is the world’s largest software registry. It consists of the website, the command line interface (CLI) and the registry (a large public database of JavaScript software and the meta-information surrounding it).
and
It was originally created to be a package manager for Node and for users to grab the packages they need and for version control.
What is a package?
A directory with one or more files in it that is described by a package.json file.
How can you create a package.json with npm?
Navigate to the root directory, and use the “npm init –yes” on the terminal in the directory. Instead of “–yes”, you can fill it with various information such as email name, author name, etc.
What is a dependency and how do you add one to a package?
A dependency is a library that a project needs to function effectively. You add a dependency as a package to another package using the “npm install” command followed by the name of the package dependency on the terminal.
What happens when you add a dependency to a package with npm?
A “node_modules” directory is created containing the library that was installed using the “npm install” command.
and
It updates the package.json file with the new dependency and it may include all the dependencies and sub-dependencies in the “node-modules” directory.