Modern Full-Stack Development


NPM: More on package.json



Download 5,64 Mb.
Pdf ko'rish
bet21/107
Sana06.08.2021
Hajmi5,64 Mb.
#140576
1   ...   17   18   19   20   21   22   23   24   ...   107
Bog'liq
Modern Full-Stack Development Using TypeScript, React, Node

 NPM: More on package.json
In the last chapter, you learned how to init a project with NPM, which generates a 
package.json file. I said then that most of its contents were optional, and that’s definitely 
true, but let’s talk about what’s available in that file, discussing each of the keys available 
(remember it’s just a JSON file, which means it’s defining a JavaScript object, which has 
keys or properties or attributes or even elements – all these terms are generally taken to be 
interchangeable in this context):
• 
name – We start with a simple one: the name of the thing you’re 
coding! The name element’s value must be no more than 214 
characters, cannot start with a dot or an underscore, can have no 
uppercase letters, and must be URL-safe.
• 
author – The author is a single person and is defined by an object 
with three potential attributes: name, email, and url (where name is 
required, and both email and url are optional). Alternatively, you 
can make the value a single string in the form "  
()" and NPM will parse it for you automatically.


22
• 
bin – Some packages require executables to be installed to do their 
work and added to the path. That’s where the bin element comes 
in. You can make the value an object (or map, which is probably the 
more appropriate term here) that maps a command to an executable 
and NPM will take care of “installing” it for you when you install the 
package by creating the appropriate symlink.
• 
browser – Some modules are meant to be used in a browser, not in 
Node, and for those packages, you can use this element instead of 
the main element (coming up shortly!) to hint to the users of your 
package that it depends on primitives available to JavaScript that 
aren’t available in Node.
• 
bugs – If your project has an issue tracker, then you can reference 
it with the bugs element. The value of this is an object with two 
attributes, url and email, and you can specify either or both (but you 
must specify at least one, or NPM will complain).
• 

Download 5,64 Mb.

Do'stlaringiz bilan baham:
1   ...   17   18   19   20   21   22   23   24   ...   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