NPM Flashcards

1
Q

What is NPM?

A

It can refer to 3 things: the npm website, the CLI for using npm, or the registry of packages that npm offers

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

What is a package?

A

A directory that contains a package.json and other files

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 do you add one to a package?

A

A dependency is an independent directory that your package needs to run, and they can be added using 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

The dependency gets added to the node_modules directory in the package directory

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

What is Webpack?

A

A tool that bundles all JS modules into a single file

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

How do you execute Webpack with npm run?

A

In the “scripts” property of package.json add a property "anything": "webpack", then run the command line npm run anything

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

What is an NPM script?

A

The script for running an npm package

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

What is Babel?

A

A JavaScript compiler that converts all ES6+ code into ES5, and in general ensures that any code will be compatible for reading

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

What is a Plug-in?

A

A program added to an application that provides extra features

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

What is a Webpack loader?

A

A Webpack plug-in that transforms the source code before Webpack bundles the code

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

How can you make Babel and Webpack work together?

A

You install babel-loader and assign the module.exports.module.rules[0].use.loader = ‘babel-loader’ in the webpack.config.js file

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