NPM Flashcards

1
Q

What is NPM?

A

node package manager

Allows developers to share code they’ve written so that others may reuse it in their own applications

website npm
registry npm
command line

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

What is a package?

A

bits of reusable code (modules) that are shared via npm

directory

text 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

npm init command

–yes or -y option (Default values)

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

npm dependency: package that uses other packages inside of it

can add dependency by manually editing the package.json file or installing a package inside your own package by using command line:

npm install or npm i

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

package.json file gets updated

If someone were to install your package, the dependencies would also be installed

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