NPM Flashcards
What is NPM?
share code (as packages) with other developers
What is a package?
Folder containing a package.json
How can you create a package.json with npm?
npm init –yes(optional)
What is a dependency and how to you add one to a package?
Packages that your package needs to run.
npm install packagename
What happens when you add a dependency to a package with npm?
It gets added as a dependancy in package.json. Creates node_modules directory
What is Webpack?
Allows you to bundle js files
How do you add a devDependency to a package?
npm install package-name –save-dev || add property “devdependencies” that’s value is an object containing the name of the dependency
What is an NPM script?
A property in package.json that contains scripts that can be ran from the command line
How do you execute Webpack with npm run?
build: webpack
npm run build
How are ES Modules different from CommonJS modules?
They are built in to the language
What kind of modules can Webpack support?
CommonJS Modules, AMD, and es6 Modules