VScode를 사용하여 node를 돌릴때
npmjs.com을 이용하여 설치를 하면 아래 json 형태의 파일이 생긴다.
{
"name": "day04",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"type": "module",
"scripts": {
"dev": "nodemon index.js"
},
"dependencies": {
"axios": "^0.26.1",
"cors": "^2.8.5",
"dotenv": "^16.0.0",
"express": "^4.17.3",
"mongoose": "^6.2.8",
"nodemon": "^2.0.15",
"swagger-jsdoc": "^6.1.0",
"swagger-ui-express": "^4.3.0"
}
}
이 파일들은 우선 어떤 library와 어떠한 버전이 있는지만 표시해 주는 것이다. 실제 코드프로그램은 modules라는 개별 파일안에 저장되어 있다.
modules 를 삭제 해도 package.json만 있다면, yarn install 또는 npm install 을 통하여 다시 설치를 할 수 있다.
내가 설치한 라이브러리를 참고하고 어떠한 기능들이 빠졌는지 확인 할 때 사용할 수 있다.