npm-intro Flashcards

1
Q

What is NPM?

A

NPM is a database that developers can share their codes or for others to reuse that code.

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

What is a package?

A

a package (sometimes called a module) is a directory with files containing reusable codes in it, and it also has a file called package.json with some metadata about this package.

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

use the npm init command with the –yes or -y flag.

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 dependency is a package that depends on another package to run.
And to add one, you could use the npm install command.

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

It download the source code and place it in the node-module directory. The package is automatically listed in the package.json file, under the dependencies list.

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