npm Flashcards
What is NPM?
The world’s largest software registry.
Consists of three distinct components: the website, the CLI, the registry
CLI runs from a terminal, and is how most developers interact with npm.
Registry: large public database of JavaScript software and the meta-information surrounding it
What is a package?
Also called “modules”
Reusable code that other developers can use. Like shared building blocks to solve problems
Directory with one or more files in it, that also has a file called package.json with some meta-data about this package
* a directory that has package.json
How can you create a package.json with npm?
npm init –yes
What is a dependency and how do you add one to a package?
Modules that the project relies on to function properly
When you install a package…?
* package that your package needs to run.
* npm install [name of package]
* npm install jquery
What happens when you add a dependency to a package with npm?
The package is automatically listed in the package.json file, under the dependencies list