Modern Full-Stack Development


Deduplication  and Pruning



Download 5,64 Mb.
Pdf ko'rish
bet29/107
Sana06.08.2021
Hajmi5,64 Mb.
#140576
1   ...   25   26   27   28   29   30   31   32   ...   107
Bog'liq
Modern Full-Stack Development Using TypeScript, React, Node

 Deduplication  and Pruning
One of the complaints you’ll commonly see about NPM and Node is that the size of the 
node_modules directory can balloon in a hurry. Fortunately, you rarely will need to dive 
into it, but it’s still a question of disk space, and while disk space is cheap these days, it’s 
still not chic to be wasteful!
NPM provides two commands for dealing with this situation, starting with
npm dedup
Chapter 2   a Few More words: advanCed node and npM


27
The dedup command searches through the tree of packages in node_modules and 
looks for opportunities where packages can be moved up the tree and shared between 
dependencies, thereby reducing redundancy and saving space. The package tree is built 
up as you install packages and as NPM installs the packages, it depends on, and so on. 
Sometimes, packages will have dependencies in common, but being a tree, branches 
(read: packages) are mostly independent. This command attempts to reorganize those 
branches to make it more efficient.
The second command is this:
npm prune
This command will examine the installed packages and look for any that may no 
longer be needed. This typically happens when you uninstall packages and especially if 
you’ve done a dedup at some point. Any package that is not listed in the parent package’s 
dependency list is considered “extraneous” and therefore subject to being pruned.
Note  In regular operation, prune will be run automatically any time you install 
something, so you shouldn’t need to run this manually, but sometimes, as the 
saying goes, poo happens, so it’s good to know about it anyway.

Download 5,64 Mb.

Do'stlaringiz bilan baham:
1   ...   25   26   27   28   29   30   31   32   ...   107




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish