How to use the inheritAsync function from hoek

Find comprehensive JavaScript hoek.inheritAsync code examples handpicked from public code repositorys.

7
8
9
10
11
12
13
14
15
16
var internals = {};


module.exports.Monitor = internals.ProcessMonitor = function () {

    Hoek.inheritAsync(internals.ProcessMonitor, process, ['uptime', 'memoryUsage']);
};


internals.ProcessMonitor.prototype.memory = function (callback) {
fork icon165
star icon1
watch icon2

+ 3 other calls in file

8
9
10
11
12
13
14
15
16
17
var internals = {};


module.exports.Monitor = internals.OSMonitor = function () {

    Hoek.inheritAsync(internals.OSMonitor, Os, ['loadavg', 'uptime', 'freemem', 'totalmem', 'cpus']);
};


internals.OSMonitor.prototype.mem = function (callback) {
fork icon165
star icon1
watch icon2

18
19
20
21
22
23
24
25
26
    Hoek.assert(this.constructor === internals.OSMonitor, 'OSMonitor must be instantiated using new');

    this.builtins = ['loadavg', 'uptime', 'freemem', 'totalmem', 'cpus'];

    // Expose Node os functions as async fns
    Hoek.inheritAsync(internals.OSMonitor, Os, this.public_methods);

    return this;
};
fork icon165
star icon0
watch icon1

19
20
21
22
23
24
25
26
27
28
options = options || {};

this.builtins = ['uptime', 'memoryUsage'];

// Expose Node os functions as async fns
Hoek.inheritAsync(internals.ProcessMonitor, process, this.builtins);

this._leaks = [];
if (options.leakDetection) {
    this._logLeaks();
fork icon165
star icon0
watch icon1