package.json 은 무엇인가?
- 쉽게 얘기하면 package.json 이란 패키지에 관한 정보와 버전에 관한 정보를 담고 있는 것!
예를 들어:
기본적으로는 package.json은 문서다
- 개발자가 배포한 패키지에 대해, 다른 사람들이 관리하고 설치하기 쉽게 하기 위한 문서
- npm에 패키지를 배포하고 npm registry에 올리기 위해서 반드시 필요한 문서파일
- 자신의 프로젝트가 의존하는 패키지의 리스트
- 자신의 프로젝트의 버전을 명시
- 다른 환경에서도 빌드를 재생 가능하게 만들어, 다른 개발자가 쉽게 사용할 수 있도록 함
(중요) 일반적으로 패키지를 불러와서 프로젝트를 개발하는게 목적이라면, 의존성 관리에 대한 명세가 더 중요할 것!!!
참조:
https://www.zerocho.com/category/NodeJS/post/5825a3caaff5c70018279975
https://hoya-kim.github.io/2021/09/14/package-json/
(영문 해석)
What is package.json?
- It is a JSON file that lives in the root directory of your project.
- Your package.json holds important information about the project. It contains human-readable metadata about the project (like the project name and description) as well as functional metadata like the package version number and a list of dependencies required by the application.
What is the purpose of package.json?
- package.json is the central place to configure and describe how to interact with and run your application.
- It is used by the npm CLI (and yarn) to identify your project and understand how to handle the project's dependencies.
- It's the package.json file that enables npm to start your project, run scripts, install dependencies, publish to the NPM registry, and many other useful tasks.
Source:
https://nodejs.org/en/knowledge/getting-started/npm/what-is-the-file-package-json/
https://heynode.com/tutorial/what-packagejson/