npm-intro Flashcards

1
Q

What is NPM?

A

npm is the world’s largest software registry. Developers share and borrow packages

The website
the Command Line Interface (CLI)
the registry

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 file or directory that is described by a package.json file. A package must contain a package.json file in order to be published to the npm registry. For more information on creating a package.json file, see “Creating a package.json 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

On the command line, navigate to the root directory of your package.
– cd /path/to/package

Run the following command:
– npm init –yes

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 another package that your package needs in order to work.

ex: npm install jquery

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

a directory is added to the directory of the package you added the dependency to and the dependencies data is added

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