NPM Flashcards

1
Q

What is a package?

A

reuseable code or module, it is a directory
A package is:

a) a folder containing a program described by a package.json file
b) a gzipped tarball containing (a)
c) a url that resolves to (b)
d) a <name>@<version> that is published on the registry (see registry) with (c)
e) a <name>@<tag> (see npm dist-tag) that points to (d)
f) a <name> that has a "latest" tag satisfying (e)
g) a <git> that resolves to (a)</git></name></tag></name></version></name>

a package or module of code to reuse.

It needs to be a directory with one or more files

It has a package.JSON file

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

what is NPM

A

software registry. - has 3 parts the website
the Command Line Interface (CLI)
the 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

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

dependencies are the packages that the project relies on to function properly.

npm install

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 with npm?

A
The newly installed package(s) gets added to the list of dependencies in your package. json file

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

what happens when you add a dependency to a package with npm?

A

it goes tot he registry and downloads all files, if those dependencies also have dependencies, goes and downloads those too

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