基礎
命令:run
解釋:運行腳本
示例:npm run dev
命令:list || ls
解釋:查看依賴列表
示例:npm list || npm ls
命令:install || i
解釋:安裝依賴
示例:npm install || npm i
命令:-v
解釋:查看版本
示例:npm -v
查看依賴信息
命令:docs || home
解釋:自動跳轉npm依賴庫查看此依賴文檔文檔
示例:npm docs lodash || npm home lodash
命令:view
解釋:查看依賴的詳情
示例:npm view lodash
優化
命令:dedupe || ddp
解釋:調整依賴樹,去除重復依賴
示例:npm view dedupe || npm view ddp
命令:outdated
解釋:檢查包是否有過時
示例:npm outdated // 檢查所有包是否過時
npm outdated lodash // 檢查lodash是否過時
命令:update
解釋:更新依賴
示例:npm update // 更新所有依賴
npm update lodash // 更新lodash
命令:uninstall
解釋:卸載依賴
示例:npm uninstall lodash
檢查
audit 掃描安全漏洞 npm audit
audit fix 自動修復漏洞 npm audit fix
npm doctor 檢查環境 npm doctor
加星(可以用來收藏)
star 加星 npm star lodash
unstar 取消加星 npm unstar lodash
stars 加星列表 npm stars