npm-intro-Q&A Flashcards

1
Q

What is NPM?

A

A way for programmers to have their code saved and used by other programmers. npm is the world’s largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well.

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

What is a package?

A

is a file or directory that is described by a package.json file. A package must contain a package.json file in order to be published to the npm registry.

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

You can add dependencies to a package.json file from the command line (–save-prod) or by manually editing the package.json file ( add an attribute called “dependencies”).

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

When you (or another user) run npm install, npm will download dependencies and devDependencies that are listed in package.json that meet the semantic version requirements listed for each. updates your files with what you installed (your new dependcy) and a package-lock.json

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