npm-intro Flashcards
What is NPM?
npm is the world’s largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well.
npm consists of three distinct components:
the website
the Command Line Interface (CLI)
the registry
Use the website t
What is a package?
A package in Node. js contains all the files you need for a module. Modules are JavaScript libraries you can include in your project.
A package.json file:
lists the packages your project depends on
specifies versions of a package that your project can use using semantic versioning rules
makes your build reproducible, and therefore easier to share with other developers
How can you create a package.json with npm?
npm init –yes
What is a dependency and how to you add one to a package?
dependencies are the package references that are used by your library without which it cannot work and to be installed along with your library installation automatically. npm install [ …]
What happens when you add a dependency to a package with npm?
By default, npm install will install all modules listed as dependencies in package.json.