Package Manager Standardization

Show blog post de­tails
Posted
Tags
Coffee Time
Hide blog post de­tails

Matt Turnbull has a great ar­ti­cle ti­tled Why Are You Still Using Yarn in 2018? which makes the ar­gu­ment that newer ver­sions of NPM are just as fast as Yarn and switch­ing to NPM might ac­tu­ally have some ben­e­fits (I’m still a Yarn user).

Furthermore, it’s get­ting com­pli­cated to main­tain doc­u­men­ta­tions and say: To in­stall this pack­age, use npm install package or yarn add package, etc. With other great pack­age man­agers on the hori­zon like PNPM which claims to be faster than both NPM and Yarn, docs are go­ing to get even harder to main­tain.

The so­lu­tion: Package man­ager stan­dard­iza­tion. Just like with browser ex­ten­sions be­came a stan­dard so de­vel­op­ers could write ex­ten­sions for mul­ti­ple browsers, we can have a stan­dard for pack­age man­agers. To use stor­age in a a Chrome ex­ten­sion, you can use the API chrome.storage or browser.storage, both work.

Similarly, in­stead of npm install package and yarn add package and pnpm i package, you can do:

package-manager install package

or, even more in­ter­est­ing:

package-manager + package

Based on your lo­cal con­fig­u­ra­tion, this can be trans­lated to npm install package or yarn add package. Both pack­age man­agers (and all pack­age man­agers) will use the same verbs — and even if they don’t, at least have aliases to the stan­dards.

The stan­dard com­mands can be install (or +), remove (or -), and update (or ^). Then, de­vel­oper doc­u­men­ta­tions can be as sim­ple as Add our pack­age: package-manager + package and start us­ing it.”