How to use the emitWarning function from process
Find comprehensive JavaScript process.emitWarning code examples handpicked from public code repositorys.
39 40 41 42 43 44 45 46 47
// Process args const args = process.argv.slice(2); // Log a warning if there are more than 0 arguments if (args.length > 0) { emitWarning( 'No parameters needed, all the additional parameters will be ignored.', ); }
46
47
10
GitHub: smartcar/node-sdk
26 27 28 29 30 31 32 33 34 35
}; if (options.flags) { parameters.flags = util.getFlagsString(options.flags); } if (options.hasOwnProperty('testMode')) { emitWarning(// eslint-disable-next-line max-len 'The "testMode" parameter is deprecated, please use the "mode" parameter instead.', ); parameters.mode = options.testMode === true ? 'test' : 'live'; } else if (options.hasOwnProperty('mode')) {
10
41
19
GitHub: pinojs/pino-socket
36 37 38 39 40 41 42 43 44 45
enqueue (item) { const index = this.tail const size = this.opts.sizeCalculation(item) if (size > this.opts.maxSize) { emitWarning(`unable to enqueue item because item size ${size} is greater than maxSize ${this.opts.maxSize}`) return } this.sizes[index] = size const maxSize = this.opts.maxSize - size
17
39
0
GitHub: fibjs/fibjs
110 111 112 113 114 115 116 117 118
it("emitWarning", () => { var ev = new coroutine.Event(); var warnings = []; process.emitWarning('Something happened!', { code: 'MY_WARNING', detail: 'This is some additional information', });
311
0
0
17 18 19 20 21 22 23 24
() => {} ); } // Default is leave it as it is: Production. })().catch((err) => { process.emitWarning(err); process.exitCode = 1; });
1
0
1
process.exit is the most popular function in process (513 examples)