JSJavaScript · Lesson 12 of 14
Modules & npm
JavaScript modules let you split code across files and import only what you need. They also gave rise to npm, which has over 2 million packages, making it simultaneously the world's largest software repository and the world's largest potential supply-chain attack surface.
◆ Note
Keep node_modules out of git — add it to .gitignore. The package-lock.json file should be committed; it records exact versions of every dependency so installs are reproducible across machines and CI.
Keep node_modules out of git — add it to .gitignore. The package-lock.json file should be committed; it records exact versions of every dependency so installs are reproducible across machines and CI.