new Constamp(o)
constructor - Create an immutable stamp relating to various data, including the
- D: execPath, cwd and pwd,
- T: time and hrtime, and
- W: type, user info, arch, hostname, totalmem and platform.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
o |
object | = { format: null } parameters Properties
|
Members
-
<static> format
-
the default timestamp format
-
arch
-
get arch - operating system cpu architecture
-
cwd
-
get cwd - current working directory of the Node.js process
-
execPath
-
get execPath - absolute pathname of the executable that started the Node.js process
-
hostname
-
get hostname - system's host name
- Source:
- See:
-
hrtime
-
get hrtime - the timestamp high-resolution real time
-
isCopy
-
get isCopy - was this instance copied from json?
-
platform
-
get platform - operating system platform as set during node.js compile time
- Source:
- See:
-
pwd
-
get pwd - current working directory of the shell
-
time
-
get time - the timestamp UTC epoch time as dayjs
-
timeString
-
get timeString - the formatted timestamp UTC epoch time
- Source:
- See:
-
- constructor
- time
- https://github.com/iamkun/dayjs
-
totalmem
-
get totalmem - total system memory
- Source:
- See:
-
type
-
get type - operating system type
- Source:
- See:
-
user
-
get user - the logged-in user's name
Methods
-
<static> D(a, b)
-
determine whether given arguments share dir locations
Parameters:
Name Type Description a
Constamp The first Constamp to compare
b
Constamp The other Constamp to compare
-
<static> sameDirs()
-
- Source:
- See:
-
<static> sameTimes()
-
- Source:
- See:
-
<static> sameWhos()
-
- Source:
- See:
-
<static> T(a, b)
-
determine whether given arguments share epoch timestamps
Parameters:
Name Type Description a
Constamp The first Constamp to compare
b
Constamp The other Constamp to compare
-
<static> W(a, b)
-
determine whether given arguments share user/platform
Parameters:
Name Type Description a
Constamp The first Constamp to compare
b
Constamp The other Constamp to compare
-
sharesDWith(b)
-
sharesDWith - determine whether this instance has the same directories as another Constamp instance
Parameters:
Name Type Description b
Constamp the other instance to compare with
Returns:
true IFF d hashes equal
- Type
- boolean
-
sharesTimeWith(b)
-
sharesTimeWith - determine whether this instance has the same epoch time as another Constamp instance
Parameters:
Name Type Description b
Constamp the other instance to compare with
Returns:
true IFF timestamps equal
- Type
- boolean
-
sharesWWith(b)
-
sharesWWith - determine whether this instance has the same who as another Constamp instance
Parameters:
Name Type Description b
Constamp the other instance to compare with
Returns:
true IFF w hashes equal
- Type
- boolean
-
toJson()
-
toJson - serialize as a JSON string containg the fields:
- d: hash,
- t: utc, and
- w: hash.
Returns:
JSON
- Type
- string
-
toString()
-
toString - a hash string representation of instance
Returns:
hash hex
- Type
- string
-
valueOf()
-
valueOf - the timestamp UTC epoch time as number
- Source:
- See:
Returns:
UTC epoch ms
- Type
- number