Two Articles in a Week? Is He Insane? ...Yes
I've read a feature set article about PNPM but I speak English not excited 3 am techie, so I thought to check out PNPM and write a little
coherent article on the subject as a bonus article this week, because writing a book is taxing and coding is fun (if by fun I mean in the same
sense as pulling my eyeballs out with pliers while 13 year olds watch).
PNPM but NPM Was A Pain In the Ass Already
If you just crawled out from under a rock, these are package managers used to include specific, generally JS related, functionality to a website/app/project/whatever. The thing about NPM is it is a little slippery at times and sometimes even basic functionality requires moving between versions or reinstalling while in front of your CS class or what not. I keep my eyes peeled for its replacements because I think it kinda sucks but so far yarn is as annoying to me as its parent company (Zucc'ed again muahahaha)
What is PNPM?
A package manager based on NPM, but with modifications to make it faster, more secure and less of a disk space hog for those of you with MacBook Airs with 120 GB SSDs.
Why Would I Use It
The article I read first said it was for competent developers who are speed freaks. I don't think meth use is entirely necessary to use it or find a
use case, but YMMV.
It seems the best reason to use it is to take advantage of its new features, like Hooks that you can write into your package (assuming you do that sort
of thing) or its system linking features enabling you to have a jumbled mess of system links instead of 85 copies of prettier clogging your
main frame. Your best bet is if you think its worth a dead moose's last **** to try it and find out if it works well for you or not. NPM
alone is proof that sometimes articles in English or any derivative are unable to convey how you will use the thing, just always back up on external clouds folks!
Ok I Guess I Could Try It But How Do I Install It
Assuming you have BASH shell, NPM and Curl installed (if not look it up, there's a million articles on each and its pretty easy)
Step 1: Download the Bad Mother
curl -L https://unpkg.com/@pnpm/self-installer | node
Step 2: Use NPM to Install It
npm install -g pnpm
Step 3: Update it
pnpm install -g pnpm
See that wasn't so hard, neither were typing out those instructions instead of insane ranting about the feature set. But let's move on to that feature set anyway
So I have it installed How Do I Use It, Like What Commands Are There
Here are the commands according to their documentation
an example of its usage would be
pnpm install -g create-react-app
it works just like NPM (for most basic uses, except seemingly works better)
But I need NPX blah blah I want to be special blah blah
Yeah well shut your mouth, cause they include PNPX too and guess what? Works the same way too. See below and try it yourself!
pnpx create-react-app my-cool-new-app
See its surprisingly spry compared to the tumbling all over itself, gotta switch versions for every app crap NPM they make at 1999 Harrison in Oakland on the 11th floor (thanks for the pizza though)
English Please on Peer Dependencies
I might be reading the tweakerism wrong, but it seems this is a reference to when packages have dependencies in common, PNPM doesn't install differing sets of them
by attempts to use the same package, thus saving your puny 2014 MacBook Air's little tiny ssd you have saved your life's work on (BACK THAT SUCKER UP). A sensible feature
which is I am sure why it never made it out of NPM's board room (but they have YubiKeys for everyone)
WTF ABOUT SYSLINKS
Evidently what the intention of this part of the article and documentation (maybe PNPM causes brain damage for most people...) was to convey the nested dependencies structure that
PNPM has innovated. Essentially, for those who don't make these for your windows or are just awful Linux users, you are creating pathways to a program or file instead of copying it. Also
good if there are several packages depending on their own dependencies because screw having 70 prettiers in one project.
Nope not a one. PNPM and said article describe this as a limitation, yawn on that explanation. Figure it out for yourself on their website
SO NPM IS BEING INNOVATED
Good its about time. No offence to the employees (maybe a little) but damn that is one ratchet package manager to begin with. Sure it is fast, but I would take slow over
getting the same damn error messages claiming its not NPM's fault when we both know damn well it is. Yes this is not a perfect solution but at least it isn't a stagnant field
and again we can see the utility of the Open Source ethos at play here. People have seen a need and addressed it as best as they can. So help out, or write some terse article on something
else I can explain the more basic portions of for those who don't know wtf you are talking about :3