npm Flashcards

1
Q

What is npm?

A

the package manager for Node.js

- the website, the CLI, and the registry

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 a package.json and one or more files

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

run ‘npm init –yes’ within the current working directory

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 package required by your application to run

- ‘npm install ‘package-name’’

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 gets downloaded from the registry into a node-modules directory, and will update the package.json file

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