npm-intro Flashcards

1
Q

What is NPM?

A

Node Package Manager

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

What is a package?

A

a package is a collection of code and other assets that are bundled together and made available for use in other projects.

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

npm init

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

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

A

a package that your project relies on in order to function properly.

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

The package specified in the npm install command is downloaded from the npm registry and installed in the node_modules directory of your project.

The package and its dependencies (if any) are added to the dependencies field of your package.json file.

If the package has its own dependencies, those dependencies are also downloaded and installed in the node_modules directory, and added to the dependencies field of your package.json file.

The installed package can now be imported and used in your codebase.

When you run npm install command again, npm checks the dependencies field of your package.json and installs any missing packages. It also ensures that the installed versions of the packages match the versions specified in the dependencies field.

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