From 9f809513f11aad509e77bc2bb01d39d43e44ae74 Mon Sep 17 00:00:00 2001
From: FoxxMD
Disposable that removes the abort listener.
Alias for emitter.on(eventName, listener).
v0.1.26
+v0.1.26
Adds the listener function to the end of the listeners array for the
event named eventName. No checks are made to see if the listener has
already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple
@@ -124,8 +124,8 @@ times.
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a
-The name of the event.
-The callback function
+v0.1.101
Adds a one-timelistener function for the event named eventName. The
next time eventName is triggered, this listener is removed and then invoked.
eventName is triggered, this listener is removed and then
event listener to the beginning of the listeners array.
const myEE = new EventEmitter();
myEE.once('foo', () => console.log('a'));
myEE.prependOnceListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a
-The name of the event.
-The callback function
+v0.3.0
Removes the specified listener from the listener array for the event namedeventName.
const callback = (stream) => {
console.log('someone connected!');
};
server.on('connection', callback);
// ...
server.removeListener('connection', callback);
@@ -162,9 +162,9 @@ recently added instance. In the example the once('ping')lis
const ee = new EventEmitter();
function pong() {
console.log('pong');
}
ee.on('ping', pong);
ee.once('ping', pong);
ee.removeListener('ping', pong);
ee.emit('ping');
ee.emit('ping');
Returns a reference to the EventEmitter, so that calls can be chained.
-v0.1.26
+v0.1.26
Alias for emitter.removeListener().
v10.0.0
+v10.0.0
Removes all listeners, or those of the specified eventName.
It is bad practice to remove listeners added elsewhere in the code,
particularly when the EventEmitter instance was created by some other
@@ -180,26 +180,26 @@ modified for this specific EventEmitter instance. The value can be
Returns the current max listener value for the EventEmitter which is either
set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.
v1.0.0
-Returns a copy of the array of listeners for the event named eventName.
server.on('connection', (stream) => {
console.log('someone connected!');
});
console.log(util.inspect(server.listeners('connection')));
// Prints: [ [Function] ]
-v0.1.26
-Returns a copy of the array of listeners for the event named eventName,
including any wrappers (such as those created by .once()).
const emitter = new EventEmitter();
emitter.once('log', () => console.log('log once'));
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
const listeners = emitter.rawListeners('log');
const logFnWrapper = listeners[0];
// Logs "log once" to the console and does not unbind the `once` event
logFnWrapper.listener();
// Logs "log once" to the console and removes the listener
logFnWrapper();
emitter.on('log', () => console.log('log persistently'));
// Will return a new Array with a single function bound by `.on()` above
const newListeners = emitter.rawListeners('log');
// Logs "log persistently" twice
newListeners[0]();
emitter.emit('log');
-v9.4.0
+v9.4.0
Synchronously calls each of the listeners registered for the event namedeventName, in the order they were registered, passing the supplied arguments
to each.
Returns true if the event had listeners, false otherwise.
const EventEmitter = require('events');
const myEmitter = new EventEmitter();
// First listener
myEmitter.on('event', function firstListener() {
console.log('Helloooo! first listener');
});
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
});
// Third listener
myEmitter.on('event', function thirdListener(...args) {
const parameters = args.join(', ');
console.log(`event with parameters ${parameters} in third listener`);
});
console.log(myEmitter.listeners('event'));
myEmitter.emit('event', 1, 2, 3, 4, 5);
// Prints:
// [
// [Function: firstListener],
// [Function: secondListener],
// [Function: thirdListener]
// ]
// Helloooo! first listener
// event with parameters 1, 2 in second listener
// event with parameters 1, 2, 3, 4, 5 in third listener
-v0.1.26
+v0.1.26
Returns the number of listeners listening to the event named eventName.
If listener is provided, it will return how many times the listener
is found in the list of the listeners of the event.
The name of the event being listened for
-Optional listener: Listener<K, T, Function>The event handler function
+v3.2.0
Adds the listener function to the beginning of the listeners array for the
event named eventName. No checks are made to see if the listener has
@@ -208,16 +208,16 @@ times.
server.prependListener('connection', (stream) => {
console.log('someone connected!');
});
Returns a reference to the EventEmitter, so that calls can be chained.
The name of the event.
-The callback function
+v6.0.0
Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this
listener is removed, and then invoked.
server.prependOnceListener('connection', (stream) => {
console.log('Ah, we have our first user!');
});
Returns a reference to the EventEmitter, so that calls can be chained.
The name of the event.
-The callback function
+v6.0.0
Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or Symbols.
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Optional extras: LoggerAppExtrasGenerated using TypeDoc
Optional extras: LoggerAppExtrasGenerated using TypeDoc
Optional extras: LoggerAppExtrasGenerated using TypeDoc
Optional extras: LoggerAppExtrasGenerated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Optional hideHide objects from output (but not error object).
false
@@ -56,7 +56,7 @@ to translate time to yyyy-mm-dd HH:MM:ss.l o in system timezone.Optional minimumThe minimum log level to include in the output.
"trace"
-Optional messageFormat output of message, e.g. {level} - {pid} will output message: INFO - 1123
+Optional messageFormat output of message, e.g. {level} - {pid} will output message: INFO - 1123
false
{
messageFormat: (log, messageKey) => {
const message = log[messageKey];
if (log.requestId) return `[${log.requestId}] ${message}`;
return message;
}
}
@@ -87,7 +87,7 @@ Will be overridden by the option include if include is presented.
Optional syncMakes messaging synchronous.
false
-Optional destinationThe file, file descriptor, or stream to write to. Defaults to 1 (stdout).
+Optional destinationThe file, file descriptor, or stream to write to. Defaults to 1 (stdout).
1
Optional appendOpens the file with the 'a' flag.
@@ -96,11 +96,11 @@ Will be overridden by the option include if include is presented.Optional mkdirEnsure directory for destination file exists.
false
-Optional customProvides the ability to add a custom prettify function for specific log properties. +
Optional customProvides the ability to add a custom prettify function for specific log properties.
customPrettifiers is an object, where keys are log properties that will be prettified
and value is the prettify function itself.
For example, if a log line contains a query property, you can specify a prettifier for it:
Optional level?: Prettifier<LevelPrettifierExtras>{}
+Optional level?: Prettifier<LevelPrettifierExtras>{}
{
customPrettifiers: {
query: prettifyQuery
}
}
//...
const prettifyQuery = value => {
// do some prettify magic
}
diff --git a/interfaces/index._internal_.WritableStream.html b/interfaces/factory._internal_.WritableStream.html
similarity index 64%
rename from interfaces/index._internal_.WritableStream.html
rename to interfaces/factory._internal_.WritableStream.html
index 9053554..6c2261a 100644
--- a/interfaces/index._internal_.WritableStream.html
+++ b/interfaces/factory._internal_.WritableStream.html
@@ -1,25 +1,25 @@
-Optional [captureAlias for emitter.on(eventName, listener).
Optional [captureAlias for emitter.on(eventName, listener).
Rest ...args: any[]v0.1.26
-Adds the listener function to the end of the listeners array for the
+
Adds the listener function to the end of the listeners array for the
event named eventName. No checks are made to see if the listener has
already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple
times.
The name of the event.
The callback function
Rest ...args: any[]v0.1.101
-Adds a one-timelistener function for the event named eventName. The
+
Adds a one-timelistener function for the event named eventName. The
next time eventName is triggered, this listener is removed and then invoked.
server.once('connection', (stream) => {
console.log('Ah, we have our first user!');
});
@@ -45,7 +45,7 @@ event listener to the beginning of the listeners array.
The name of the event.
The callback function
Rest ...args: any[]v0.3.0
-Removes the specified listener from the listener array for the event namedeventName.
Removes the specified listener from the listener array for the event namedeventName.
const callback = (stream) => {
console.log('someone connected!');
};
server.on('connection', callback);
// ...
server.removeListener('connection', callback);
removeListener() will remove, at most, one instance of a listener from the
@@ -69,7 +69,7 @@ recently added instance. In the example the once('ping')lis
Returns a reference to the EventEmitter, so that calls can be chained.
Rest ...args: any[]v0.1.26
-Alias for emitter.removeListener().
Alias for emitter.removeListener().
Rest ...args: any[]v10.0.0
Returns a copy of the array of listeners for the event named eventName.
Returns a copy of the array of listeners for the event named eventName.
server.on('connection', (stream) => {
console.log('someone connected!');
});
console.log(util.inspect(server.listeners('connection')));
// Prints: [ [Function] ]
v0.1.26
-Returns a copy of the array of listeners for the event named eventName,
+
Returns a copy of the array of listeners for the event named eventName,
including any wrappers (such as those created by .once()).
const emitter = new EventEmitter();
emitter.once('log', () => console.log('log once'));
// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
const listeners = emitter.rawListeners('log');
const logFnWrapper = listeners[0];
// Logs "log once" to the console and does not unbind the `once` event
logFnWrapper.listener();
// Logs "log once" to the console and removes the listener
logFnWrapper();
emitter.on('log', () => console.log('log persistently'));
// Will return a new Array with a single function bound by `.on()` above
const newListeners = emitter.rawListeners('log');
// Logs "log persistently" twice
newListeners[0]();
emitter.emit('log');
v9.4.0
-Synchronously calls each of the listeners registered for the event namedeventName, in the order they were registered, passing the supplied arguments
+
Synchronously calls each of the listeners registered for the event namedeventName, in the order they were registered, passing the supplied arguments
to each.
Returns true if the event had listeners, false otherwise.
const EventEmitter = require('events');
const myEmitter = new EventEmitter();
// First listener
myEmitter.on('event', function firstListener() {
console.log('Helloooo! first listener');
});
// Second listener
myEmitter.on('event', function secondListener(arg1, arg2) {
console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
});
// Third listener
myEmitter.on('event', function thirdListener(...args) {
const parameters = args.join(', ');
console.log(`event with parameters ${parameters} in third listener`);
});
console.log(myEmitter.listeners('event'));
myEmitter.emit('event', 1, 2, 3, 4, 5);
// Prints:
// [
// [Function: firstListener],
// [Function: secondListener],
// [Function: thirdListener]
// ]
// Helloooo! first listener
// event with parameters 1, 2 in second listener
// event with parameters 1, 2, 3, 4, 5 in third listener
Rest ...args: AnyRestv0.1.26
-Returns the number of listeners listening to the event named eventName.
Returns the number of listeners listening to the event named eventName.
If listener is provided, it will return how many times the listener
is found in the list of the listeners of the event.
The name of the event being listened for
Optional listener: FunctionThe event handler function
v3.2.0
-Adds the listener function to the beginning of the listeners array for the
+
Adds the listener function to the beginning of the listeners array for the
event named eventName. No checks are made to see if the listener has
already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple
times.
The name of the event.
The callback function
Rest ...args: any[]v6.0.0
-Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this
+
Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this
listener is removed, and then invoked.
server.prependOnceListener('connection', (stream) => {
console.log('Ah, we have our first user!');
});
@@ -130,4 +130,4 @@ listeners. The values in the array are strings or Symbols.
const EventEmitter = require('events');
const myEE = new EventEmitter();
myEE.on('foo', () => {});
myEE.on('bar', () => {});
const sym = Symbol('symbol');
myEE.on(sym, () => {});
console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
v6.0.0
-Optional cb: ((err?) => void)Optional err: ErrorOptional encoding: BufferEncodingOptional cb: ((err?) => void)Optional err: ErrorOptional cb: (() => void)Optional cb: (() => void)Optional encoding: BufferEncodingOptional cb: (() => void)Generated using TypeDoc
Optional cb: ((err?) => void)Optional err: ErrorOptional encoding: BufferEncodingOptional cb: ((err?) => void)Optional err: ErrorOptional cb: (() => void)Optional cb: (() => void)Optional encoding: BufferEncodingOptional cb: (() => void)Generated using TypeDoc
'10MB'
-Optional frequencyThe amount of time a given rolling log file is used. Can be combined with size.
+Optional frequencyThe amount of time a given rolling log file is used. Can be combined with size.
Use daily or hourly to rotate file every day (or every hour). Existing file within the current day (or hour) will be re-used.
Numerical values will be considered as a number of milliseconds. Using a numerical value will always create a new file upon startup.
'daily'
-Optional timestampFor rolling log files
+Optional timestampFor rolling log files
When
path from LogOptions is a string) and'auto'
-Optional pathThe path and filename to use for log files.
+Optional pathThe path and filename to use for log files.
If using rolling files the filename will be appended with .N (a number) BEFORE the extension based on rolling status.
May also be specified using env LOG_PATH or a function that returns a string.
If path is relative the absolute path will be derived from the current working directory.
'CWD/logs/app.log'
-Optional levelSpecify the minimum log level to output to rotating files. If false no log files will be created.
Generated using TypeDoc
Optional levelSpecify the minimum log level to output to rotating files. If false no log files will be created.
Generated using TypeDoc
Optional levelSpecify the minimum log level for all log outputs without their own level specified.
Defaults to env LOG_LEVEL or info if not specified.
'info'
-Optional fileSpecify the minimum log level to output to rotating files or file output options. If false no log files will be created.
Optional consoleSpecify the minimum log level streamed to the console (or docker container)
-Generated using TypeDoc
Optional fileSpecify the minimum log level to output to rotating files or file output options. If false no log files will be created.
Optional consoleSpecify the minimum log level streamed to the console (or docker container)
+Generated using TypeDoc
Optional prettyAdditional pino-pretty options that are applied to the built-in console/log streams
-Optional destinationsAdditional logging destinations to use alongside the built-in console/log stream. These can be any created by buildDestination* functions or other Pino Transports
-Generated using TypeDoc
Optional prettyAdditional pino-pretty options that are applied to the built-in console/log streams
+Optional destinationsAdditional logging destinations to use alongside the built-in console/log stream. These can be any created by buildDestination* functions or other Pino Transports
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
'10MB'
-Optional frequencyThe amount of time a given rolling log file is used. Can be combined with size.
+Optional frequencyThe amount of time a given rolling log file is used. Can be combined with size.
Use daily or hourly to rotate file every day (or every hour). Existing file within the current day (or hour) will be re-used.
Numerical values will be considered as a number of milliseconds. Using a numerical value will always create a new file upon startup.
'daily'
-Optional timestampFor rolling log files
+Optional timestampFor rolling log files
When
path from LogOptions is a string) and'auto'
-Specify the minimum log level to output to rotating files. If false no log files will be created.
The path and filename to use for log files.
+Specify the minimum log level to output to rotating files. If false no log files will be created.
The path and filename to use for log files.
If using rolling files the filename will be appended with .N (a number) BEFORE the extension based on rolling status.
May also be specified using env LOG_PATH or a function that returns a string.
If path is relative the absolute path will be derived from the current working directory.
'CWD/logs/app.log'
-Generated using TypeDoc
Generated using TypeDoc
'10MB'
-Optional frequencyThe amount of time a given rolling log file is used. Can be combined with size.
+Optional frequencyThe amount of time a given rolling log file is used. Can be combined with size.
Use daily or hourly to rotate file every day (or every hour). Existing file within the current day (or hour) will be re-used.
Numerical values will be considered as a number of milliseconds. Using a numerical value will always create a new file upon startup.
'daily'
-Optional timestampFor rolling log files
+Optional timestampFor rolling log files
When
path from LogOptions is a string) and'auto'
-Optional pathThe path and filename to use for log files.
+Optional pathThe path and filename to use for log files.
If using rolling files the filename will be appended with .N (a number) BEFORE the extension based on rolling status.
May also be specified using env LOG_PATH or a function that returns a string.
If path is relative the absolute path will be derived from the current working directory.
'CWD/logs/app.log'
-Generated using TypeDoc
Generated using TypeDoc
Optional sizeThe maximum size of a given rolling log file.
Can be combined with frequency. Use k, m and g to express values in KB, MB or GB.
Numerical values will be considered as MB.
'10MB'
-Optional frequencyThe amount of time a given rolling log file is used. Can be combined with size.
+Optional frequencyThe amount of time a given rolling log file is used. Can be combined with size.
Use daily or hourly to rotate file every day (or every hour). Existing file within the current day (or hour) will be re-used.
Numerical values will be considered as a number of milliseconds. Using a numerical value will always create a new file upon startup.
'daily'
-Generated using TypeDoc
Generated using TypeDoc
Optional timestampFor rolling log files
When
'auto'
-Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Const Additional level colors included in @foxxmd/logging as a string
+Const Additional level colors included in @foxxmd/logging as a string
These are always applied when using prettyOptsFactory() but can be overridden
-Generated using TypeDoc
Generated using TypeDoc
Const Additional level colors included in @foxxmd/logging as an object
+Const Additional level colors included in @foxxmd/logging as an object
These are always applied when using prettyOptsFactory() but can be overridden
-Generated using TypeDoc
Generated using TypeDoc
Const Use on translateTime pino-pretty option to print timestamps in ISO8601 format
Generated using TypeDoc
Generated using TypeDoc
Const Additional levels included in @foxxmd/logging as an object
+Const Additional levels included in @foxxmd/logging as an object
These are always applied when using prettyOptsFactory() but can be overridden
-Generated using TypeDoc
Generated using TypeDoc
Const Additional levels included in @foxxmd/logging as a string
+Const Additional levels included in @foxxmd/logging as a string
These are always applied when using prettyOptsFactory() but can be overridden
-Generated using TypeDoc
Generated using TypeDoc
Const Pre-defined pretty options for use with console/stream output
+Const Pre-defined pretty options for use with console/stream output
const prettyConsole: PrettyOptions = prettyOptsFactory({sync: true})
-Generated using TypeDoc
Generated using TypeDoc
Const Pre-defined pretty options for use with file output
+Const Pre-defined pretty options for use with file output
const prettyFile: PrettyOptions = prettyOptsFactory({
colorize: false,
sync: false,
})
-Generated using TypeDoc
Generated using TypeDoc
Const Generated using TypeDoc
Const Generated using TypeDoc
Const A logger that ONLY logs to console at minimum 'debug' level. Useful for logging during startup before a loggerApp has been initialized
const loggerDebug = buildLogger('debug', [buildDestinationStdout('debug')])
-Generated using TypeDoc
Generated using TypeDoc
Const A noop (no output) logger for use when testing a component that requires a Logger
const loggerTest = buildLogger('silent', [buildDestinationStdout('debug')])
-Generated using TypeDoc
Generated using TypeDoc
Since
v18.18.0