npm-intro Flashcards

1
Q

What is NPM?

A

npm is the world’s largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well.

npm consists of three distinct components:

the website
the Command Line Interface (CLI)
the registry
Use the website t

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

What is a package?

A

A package in Node. js contains all the files you need for a module. Modules are JavaScript libraries you can include in your project.

A package.json file:

lists the packages your project depends on
specifies versions of a package that your project can use using semantic versioning rules
makes your build reproducible, and therefore easier to share with other developers

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

dependencies are the package references that are used by your library without which it cannot work and to be installed along with your library installation automatically. 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

By default, npm install will install all modules listed as dependencies in package.json.

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