노드의 패키지 매니저
다른 사람들이 만든 소스 코드들을 모아둔 저장소
남의 코드를 사용하여 프로그래밍 가능
이미 있는 기능을 다시 구현할 필요가 없어 효율적
오픈 소스 생태계를 구성중
패키지: npm에 업로드된 노드 모듈
모듈이 다른 모듈을 사용할 수 있듯 패키지도 다른 패키지를 사용할 수 있음
의존 관계라고 부름
npm install express
// package.json
{
"name": "npmtest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index"
},
"author": "ZeroCho",
"license": "MIT",
"dependencies": {
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.5",
"express": "^4.17.1"
},
"devDependencies": {
"nodemon": "^2.0.5"
}
}