npm Flashcards

1
Q

What is NPM?

A

World’s largest software registry where open source devs around the world use to share and borrow packages. Website, registry or CLI.

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

What is a package?

A

A file or directory that is described by a package.json file. It must contain a package.json file in order to be published to the npm registry. A directory with one or more files in it, including 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

Either by running a CLI questionnaire or creating a default package.json file.

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

Packages that your project depends on. They are added from the command line (npm install name of package) or by manually editing the package.json file

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

It allows you to use the application in production. The npm installed gets added to the directory. Adds the dependency to the package.json file. Download code from registry

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

What is Webpack?

A

A tool that lets you bundle your JavaScript applications - a module bundler

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

How do you add a devDependency to a package?

A

Using npm install –save-dev ‘name of package’ in the command or by manually adding it into the package.json file.

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

What is an NPM script?

A

A set of built-in and custom scripts defined in the package.json file to execute repetitive tasks

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

How do you execute Webpack with npm run?

A

npm run “script key name”

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