Some of their values are commonly known, for example the HOURS_COUNT_IN_STELLAR_DAY is 24 and MAXIMAL_DAYS_IN_MONTH is 31.
However, without being stored to the constants with clear names, it will be the
magic numbers.
Installation
npm i fundamental-constants -E
Content
Computer Networking
Constant Name
Value
HTTP_DEFAULT_PORT
80
HTTPS_DEFAULT_PORT
443
NETWORK_PORT_MAXIMAL_VALUE
65535
NETWORK_PORT_MINIMAL_VALUE
1
Enumerations
HTTP_Methods
Key
Value
get
"GET"
post
"POST"
create
"CREATE"
put
"PUT"
delete
"DELETE"
options
"OPTIONS"
head
"HEAD"
connect
"CONNECT"
trace
"TRACE"
patch
"PATCH"
HTTP Status Codes
HTTP_StatusCodes — All HTTP Status Codes
Key
Value
continue
100
switchingProtocols
101
processing
102
earlyHints
103
OK
200
created
201
accepted
202
nonAuthoritativeInformation
203
noContent
204
resetContent
205
partialContent
206
multiStatus
207
alreadyReported
208
IM_Used
226
multipleChoices
300
movedPermanently
301
found
302
seeOther
303
notModified
304
useProxy
305
unused
306
temporaryRedirect
307
permanentRedirect
308
badRequest
400
unauthorized
401
paymentRequired
402
forbidden
403
notFound
404
methodNotAllowed
405
notAcceptable
406
proxyAuthenticationRequired
407
requestTimeout
408
conflict
409
gone
410
lengthRequired
411
preconditionFailed
412
payloadTooLarge
413
URI_TooLong
414
unsupportedMediaType
415
rangeNotSatisfiable
416
expectationFailed
417
IAmATeapot
418
misdirectedRequest
421
unprocessableEntity
422
locked
423
failedDependency
424
tooEarly
425
upgradeRequired
426
preconditionRequired
428
tooManyRequests
429
requestHeaderFieldsTooLarge
431
unavailableForLegalReasons
451
internalServerError
500
notImplemented
501
badGateway
502
serviceUnavailable
503
gatewayTimeout
504
HTTP_VersionNotSupported
505
variantAlsoNegotiates
506
insufficientStorage
507
loopDetected
508
notExtended
510
networkAuthenticationRequired
511
InformationalResponsesHTTP_StatusCodes — Information Responses
ServerErrorsHTTP_StatusCodes — Server Error Responses
Key
Value
internalServerError
500
notImplemented
501
badGateway
502
serviceUnavailable
503
gatewayTimeout
504
HTTP_VersionNotSupported
505
variantAlsoNegotiates
506
insufficientStorage
507
loopDetected
508
notExtended
510
networkAuthenticationRequired
511
DataTypes
IntegerDataTypes
IntegerDataTypes enumeration
Key
Value
oneByte
"1_BYTE_INTEGER"
twoBytes
"2_BYTES_INTEGER"
threeBytes
"3_BYTES_INTEGER"
fourBytes
"4_BYTES_INTEGER"
eightBytes
"8_BYTES_INTEGER"
Minimal and Maximal Values
Constant Name
Value
MAXIMAL_VALUE_OF_1_BYTE_INTEGER
127
MAXIMAL_VALUE_OF_2_BYTES_INTEGER
32,767
MAXIMAL_VALUE_OF_3_BYTES_INTEGER
8,388,607
MAXIMAL_VALUE_OF_4_BYTES_INTEGER
2,147,483,647
MAXIMAL_VALUE_OF_8_BYTES_INTEGER
9,223,372,036,854,775,807
MAXIMAL_VALUE_OF_UNSIGNED_1_BYTE_INTEGER
255
MAXIMAL_VALUE_OF_UNSIGNED_2_BYTES_INTEGER
65,535
MAXIMAL_VALUE_OF_UNSIGNED_3_BYTES_INTEGER
16,777,215
MAXIMAL_VALUE_OF_UNSIGNED_4_BYTES_INTEGER
4,294,967,295
MAXIMAL_VALUE_OF_UNSIGNED_8_BYTES_INTEGER
18,446,744,073,709,551,615
MINIMAL_VALUE_OF_1_BYTE_INTEGER
-128
MINIMAL_VALUE_OF_2_BYTES_INTEGER
-32,768
MINIMAL_VALUE_OF_3_BYTES_INTEGER
-8,388,608
MINIMAL_VALUE_OF_4_BYTES_INTEGER
-2,147,483,648
MINIMAL_VALUE_OF_8_BYTES_INTEGER
-9,223,372,036,854,775,808
Class Integer and Interface IntegerConstructor
The analogue of Number and NumberConstructor respectively pointing that target number is integer.
Both class Integer and interface IntegerConstructor are empty.
Intended to be used for describing of business rules alongside with native types like String and StringConstructor: