npm-intro Flashcards

1
Q

What is NPM?

A

node package manager is a sharing platform for devs to share their code in the form of packages

when ppl talk about npm, they mention three things:
- website
- registry
- cli

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

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 -y

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

third party code that your code needs in order to run
npm install (insert)

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

npm install does two things:
- downloads dependency from registry to your local directory
- then updates package.json to list the dependencies

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

3 requirements before you use download a package

A
  • github/lab repository needs to be public
    you need to see the code before you install it
  • needs to have documentation
    means they care/don’t care
    if you run into issues you won’t have docs to refer to

-are people using it? check to see if downloads are over a couple hundred.

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