NPM Flashcards
What is a package?
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
what is NPM
software registry. - has 3 parts the website
the Command Line Interface (CLI)
the registry
How can you create a package.json with npm?
npm init –y
What is a dependency and how to you add one to a package?
dependencies are the packages that the project relies on to function properly.
npm install
What happens when you add a dependency to a package with npm?
package with npm?
A
The newly installed package(s) gets added to the list of dependencies in your package. json file
what happens when you add a dependency to a package with npm?
it goes tot he registry and downloads all files, if those dependencies also have dependencies, goes and downloads those too