npm-intro Flashcards
What is NPM?
NPM stands for node package manager and it is used to hold packages which contain modules, anyone can upload their packages or use packages from others. NPM is the website, registry, and CLI.
What is a package?
A package is a set of modules and code that solves one sub-problem and does so well. Has a package.json, a directory, and one or more files.
How can you create a package.json with npm?
npm init will run through the creation of a package.json by prompting you to answer questions in the CLI
What is a dependency and how to you add one to a package?
A dependency is a library of tools and code that you can import into your project by npm install package name
What happens when you add a dependency to a package with npm?
When a dependency is added to a package with npm the files for that dependency are downloaded and placed in a directory called node_modules. Then the package.json is updated under the packages key where there is an object that holds modules