npm-intro Flashcards

1
Q

What is NPM?

A

NPM stands for node package manager and it is used to hold packages which contain modules, anyone can upload their packages or use packages from others. NPM is the website, registry, and CLI.

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 set of modules and code that solves one sub-problem and does so well. Has a package.json, a directory, 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

npm init will run through the creation of a package.json by prompting you to answer questions in the CLI

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 library of tools and code that you can import into your project by 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

When a dependency is added to a package with npm the files for that dependency are downloaded and placed in a directory called node_modules. Then the package.json is updated under the packages key where there is an object that holds modules

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