API Docs for: 0.0.1
Show:

utils Class

Defined in: core/utils.js:3
Module: core

Item Index

Methods

Methods

currentTime

() Number static

Defined in core/utils.js:17

Returns:

Number:

Unix timestamp in milliseconds.

endpointType

(
  • endpoint
)
String

Defined in core/utils.js:95

Parameters:

Returns:

String:

tcp, ipc or inproc

getPath

(
  • object
  • path
)
Object static

Defined in core/utils.js:56

Returns the value of a path.

Parameters:

Returns:

Object:

The value of path in object.

randomId

() String static

Defined in core/utils.js:84

Get uuid v4.

Returns:

randRange

(
  • [a]
  • [b]
)
Number static

Defined in core/utils.js:26

Get a random integer.

Example:

var arr = ['a', 'b', 'c'];

// a random element from arr
var random = arr[randRange(arr.length)];

Parameters:

  • [a] Number=0 optional
  • [b] Number=10000000 optional

Returns:

Number:

Random integer in the interval [a, b).

Properties

_pathCache

Object private

Defined in core/utils.js:8

Caches path pieces from calls to utils.getPath()

EMPTY_BUFFER

Buffer

Defined in core/utils.js:110