当前位置:网站首页>Pnpm Brief
Pnpm Brief
2022-07-25 10:09:00 【A cabbage~】
List of articles
What is? pnpm
pnpm yes Node.js Alternative package manager . It is npm A direct alternative to , But faster 、 More efficient .
Why is it more efficient ? When you install the package , We will save it in the global storage on your machine , Then we will create a hard link from it , Instead of copying . For each version of the module , Only one copy remains on the disk . for example , When using npm or yarn when , If you have 100 One use lodash My bag , Then there will be 100 individual lodash copy .pnpm You can save money GB Of disk space !
pnpm advantage
pnpm Have Yarn exceed npm All the additional functions of :
- Security : And yarn equally ,pnpm There is a special file that contains the checksums of all installed packages , Used to verify the integrity of each installed package before executing the code .
- Offline mode : pnpm Send all downloaded packages tarball Save in the local registry image . When the package is available locally , It never makes requests . Use this
--offlineParameters can be completely disabled HTTP request . - Speed : pnpm Not only is better than npm fast , And ratio yarn fast . Whether cold cache or hot cache , It's all better than yarn fast .yarn Copy files from the cache , and pnpm Just link them from global storage .
pnpm install
npm install -g pnpm // adopt npm install
npx pnpm add -g pnpm // adopt npx install
Set source
pnpm config get registry // View source
pnpm config set registry https://registry.npmmirror.com // Switch Taobao source
Add package
pnpm add [package] // Save to dependency
pnpm add -D [package] // Save to devDependencies
pnpm add -O [package] // Save to optionalDependencies
Remove package
pnpm remove [package] // Remove package
pnpm remove [package] --global // Remove global package
Update package
pnpm up // Update all dependencies , comply with package.json The range specified in
pnpm up --latest // Latest update all dependencies , Ignore package.json The range specified in
Set storage path
pnpm config set store-dir /path/to/.pnpm-store
Want to know more see pnpm Official website : https://pnpm.js.org/installation/
边栏推荐
猜你喜欢

OC -- Inheritance and polymorphic and pointer

【建议收藏】靠着这些学习方法,我入职了世界五百强——互联网时代的“奇技淫巧”

Swift creates weather app

Temperature, humidity and light intensity acquisition based on smart cloud platform

Introduction to armv8 general timer

rospy Odometry天坑小计

MLX90640 红外热成像仪测温模块开发说明

工程监测无线中继采集仪和无线网络的优势

nodejs版本升级或切换的常用方式

Mlx90640 infrared thermal imager temperature measurement module development notes (V)
随机推荐
File -- first acquaintance
NLM5系列无线振弦传感采集仪的工作模式及休眠模式下状态
JDBC总结
车辆属性最近一次入库时间初始化生成sql脚本文件
[necessary for growth] Why do I recommend you to write a blog? May you be what you want to be in years to come.
js利用requestAnimationFrame实时检测当前动画的FPS帧率
Configuring ROS development environment with vscode: Causes and solutions to the problem of ineffective code modification
Reflection 反射
Swift simple implementation of to-do list
yarn速查手册
关闭brew执行命令时的自动更新
看一个双非二本(0实习)大三学生如何拿到阿里、腾讯的offer
Mlx90640 infrared thermal imager temperature measurement module development notes (V)
安装 oh my zsh
工程监测无线中继采集仪和无线网络的优势
~2 CCF 2022-03-1 uninitialized warning
Advanced introduction to digital IC Design SOC
canal实现mysql数据同步
nodejs链接mysql报错:ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE
数据库MySQL详解