Modern Full-Stack Development



Download 5,64 Mb.
Pdf ko'rish
bet37/107
Sana06.08.2021
Hajmi5,64 Mb.
#140576
1   ...   33   34   35   36   37   38   39   40   ...   107
Bog'liq
Modern Full-Stack Development Using TypeScript, React, Node

 Process
Unlike the other modules, this one is a global, which means it is always available, and 
there is no need to import anything. You simply call methods on the intrinsic process 
reference or access its properties.
That, of course, is good to know, but what does this module do for us? Well, the 
answer is quite a lot! In short, it allows you to retrieve information and control the 
current Node process. Here are just a few of the items it offers:
•  process.abort() – This method aborts the Node process, ending 
your program. However, that unceremoniously kills the process, so 
what you likely want to use is process.exit() instead, to which you 
can pass an exit code to return to the process that started Node.
•  process.version – This contains the version of Node itself.
•  process.uptime() – How long has the Node process been running 
for? This method will tell you!
•  process.mainModule – Here, you can find the name of the .js file 
that was launched by Node. Note that Node also provides a handful 
of global variables that contain important information like this, 
__filename being the equivalent to this property (they generally all 
start with two underscores like that). For reference, __dirname will 
provide the name of the directory where the script was launched 
from, which tends to be an often-needed piece of information.
•  process.env – This contains an object whose keys are user 
environment variables.
There’s quite a bit more that the process module offers, but in my experience, much 
beyond these is a bit more unusual to use, so I’ll leave its exploration as an exercise for 
the reader.
Chapter 2   a Few More words: advanCed node and npM


37

Download 5,64 Mb.

Do'stlaringiz bilan baham:
1   ...   33   34   35   36   37   38   39   40   ...   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