Pnpm
빠르고, 효율적인 패키지 매니저
Features
- Fast. Up to 2x faster than the alternatives (see benchmark).
- Efficient. Files inside node_modules are linked from a single content-addressable storage.
- Great for monorepos.
- Strict. A package can access only dependencies that are specified in its package.json.
- Deterministic. Has a lockfile called pnpm-lock.yaml.
- Works as a Node.js version manager. See pnpm env use.
- Works everywhere. Supports Windows, Linux, and macOS.
- Battle-tested. Used in production by teams of all sizes since 2016.
- See the full feature comparison with npm and Yarn.
npm vs yarn vs yarn-berry vs pnpm
Case 01
- Yarn 대신 pnpm으로 넘어간 3가지 이유 | GeekNews
- [원문] Yarn 대신 pnpm으로 넘어간 3가지 이유
- Yarn Berry에서 느낀 불편한 점
- Yarn PnP가 Git에 지속적으로 주는 부하
- Ghost Dependency와의 끈질긴 싸움
- Yarn Workspace의 자잘한 버그들
- 배포 과정 중 패키지 설치 시간이 30초 ~ 1분 정도 빨라짐
- 전역 저장소(Virtual Store)에 패키지 저장 / 프로젝트의 node_modules와는 symlink로 연결
- 중복된 패키지를 설치하지 않아 저장 공간과 네트워크 절약
- 자동으로 패키지간 링크가 되어 보다 간단하게 모노레포 셋업
- patch-package, dedupe 등 Yarn Berry에서 사용했던 기능들 거의 그대로 사용 가능