npm Flashcards

1
Q

What is NPM?

A

-Software registry consisting website, CLI, and registry

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

What is a package?

A
  • Reusable bits of code

- File or directory 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 of your package

- 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
  • Specified in a simple object that maps a package name to a version range
  • npm install [–save-prod]
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
  • Updates package.json

- Downloads the package from npm registry

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