avatar

即將開始測試的 npm@5

所以說競爭對使用者還是好事,自從 yarn 面世之後 npm 升版速度之快啊 XD

Oh hey, a reminder that #npm5 is going into public beta this Thursday. There's a ton of really cool changes:{' '} https://t.co/Uzv7sOJX4a{' '} @npmjs

— ✨ Kat! ✨ (@maybekatz){' '} May 1, 2017

5/4 將會是第一個 npm@5 beta 釋出的時間,也終於將重心擺在執行效能與 shrinkwrap 改善之上。如果稍微看一下 v5 的 PR 所列出的更新,應該不難發現引用了不少 yarn 的行為 ;)

導入新的 package-lock.json
npm install -s 將成為預設的行為
Refactor cache code
安全性改善

package-lock.json

這應該是新版最特別的改變之一,Spec 還在討論當中,所以伴隨著 beta 在測試可能還會有調整。

在 npm@5 之中,如果沒有存在 npm-shrinkwrap.json 就會預設產生 package-lock.json,但是該文件不會跟著 npm publish 一起出去,它的用途與格式基本上與 npm-shrinkwrap.json 一樣,除非下了 npm shrinkwrap,就會把 package-lock.json 轉成 npm-shrinkwrap.json

配合上面提到的 Refactor cache code 預測應該速度會貼近 yarn(可能再看後續的調整,看 benchmark 還是有點落差 XD )

powered by WebMention.io

You can tweet this post or discuss it on Twitter, the comments will show up here.
0Likes0Replies0Mentions

Be the first one to share this article!