NPM Flashcards

1
Q

What is NPM?

A

share code (as packages) with other developers

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

What is a package?

A

Folder containing a package.json

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(optional)

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 package needs to run.

npm install packagename

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 gets added as a dependancy in package.json. Creates node_modules directory

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

What is Webpack?

A

Allows you to bundle js files

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

npm install package-name –save-dev || add property “devdependencies” that’s value is an object containing the name of the dependency

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

What is an NPM script?

A

A property in package.json that contains scripts that can be ran from the command line

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

build: webpack

npm run build

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

How are ES Modules different from CommonJS modules?

A

They are built in to the language

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

What kind of modules can Webpack support?

A

CommonJS Modules, AMD, and es6 Modules

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