npm-intro Flashcards

1
Q

What is NPM?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a package?

A

A directory with one or more files in it that is described by a package.json file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can you create a package.json with npm?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a dependency and how do you add one to a package?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens when you add a dependency to a package with npm?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly