npm Flashcards
What is NPM?
World’s largest software registry where open source devs around the world use to share and borrow packages. Website, registry or CLI.
What is a package?
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 can you create a package.json with npm?
Either by running a CLI questionnaire or creating a default package.json file.
What is a dependency and how to you add one to a package?
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
What happens when you add a dependency to a package with npm?
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
What is Webpack?
A tool that lets you bundle your JavaScript applications - a module bundler
How do you add a devDependency to a package?
Using npm install –save-dev ‘name of package’ in the command or by manually adding it into the package.json file.
What is an NPM script?
A set of built-in and custom scripts defined in the package.json file to execute repetitive tasks
How do you execute Webpack with npm run?
npm run “script key name”