NPM Flashcards
1
Q
What is NPM?
A
- Node Package Manager
- a way to re-use code from other devs, or share your code for use
- consists of:
- website, use to discover packages, set up profiles, and manage other aspects of your npm experience.
- CLI, runs from a terminal, and is how most developers interact with npm.
- registry, a large public database of JavaScript software and the meta-information surrounding it.
2
Q
What is a package?
A
a directory that contains a file or files of reuse-able code that is shared on npm. -package must contain a package.json file in order to be published to the npm registry.
3
Q
How can you create a package.json with npm?
A
make sure you’re in the correct directory, then:
- npm init –yes
4
Q
What is a dependency and how to you add one to a package?
A
- a connection to a library of code your program will access/use
- npm install ‘package-name’
- npm uninstall ‘package-name’
dependency is another package of software that your package of sotftware depends on
npm install package.json
npm install express
5
Q
What happens when you add a dependency to a package with npm?
A
you are installing/adding the dependency to your package.json file and generates a node_modules folder with the installed modules