npm-intro-Q&A Flashcards
What is NPM?
A way for programmers to have their code saved and used by other programmers. npm is the world’s largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well.
What is a package?
is a file or directory that is described by a package.json file. A package must contain a package.json file in order to be published to the npm registry.
How can you create a package.json with npm?
use the npm init command with the –yes or -y flag.
What is a dependency and how to you add one to a package?
You can add dependencies to a package.json file from the command line (–save-prod) or by manually editing the package.json file ( add an attribute called “dependencies”).
What happens when you add a dependency to a package with npm?
When you (or another user) run npm install, npm will download dependencies and devDependencies that are listed in package.json that meet the semantic version requirements listed for each. updates your files with what you installed (your new dependcy) and a package-lock.json