- AppendOnlyStackedSet
- AssetBytesGenerator
- AssetBytesParser
- AssetGenerator
- AssetParser
- AssetSourceGenerator
- AssetSourceParser
- AsyncHook
- AsyncParallelHook
- AsyncQueue
- AsyncResource
- AsyncSeriesBailHook
- AsyncSeriesHook
- AsyncSeriesWaterfallHook
- AsyncWebAssemblyParser
- BasicEvaluatedExpression
- BlockList
- ByTypeGenerator
- CacheFacade
- ChunkTemplate
- ConstDependencyTemplate
- ContextDependency
- ContextElementDependency
- ContextModuleFactory
- CssGenerator
- CssModule
- CssParser
- DependenciesBlock
- DependencyTemplate
- DependencyTemplates
- Duplex
- EntryDependency
- EventEmitter
- ExportInfo
- ExportMode
- ExportsInfo
- FileSystemInfo
- GlobalScope
- HarmonyExportImportedSpecifierDependency
- HarmonyImportDependencyTemplate
- HarmonyStarExportsList
- Hash
- HelperRuntimeModule
- Hook
- HookMap
- IncomingMessage
- ItemCacheFacade
- JavascriptGenerator
- JsonData
- JsonGenerator
- JsonParser
- KeyObject
- LocalModule
- MainTemplate
- ModuleExternalInitFragment
- ModuleProfile
- ModuleTemplate
- MultiHook
- MultiWatching
- NormalModuleFactory
- NormalReexportItem
- NullDependencyTemplate
- OptionsApply
- OutgoingMessage
- Parser
- Profiler
- Readable
- Reference
- Replacement
- RequestShortener
- ResolverFactory
- RestoreProvidedData
- RuntimeTemplate
- RuntimeValue
- Scope
- ScopeManager
- Serializer
- SerializerMiddleware
- Server
- Server
- Server
- Server
- ServerResponse
- Snapshot
- Socket
- SocketAddress
- SortableSet
- StackedMap
- StatsFactory
- StatsPrinter
- Stream
- SyncBailHook
- SyncHook
- SyncWaterfallHook
- TLSSocket
- Token
- TokenType
- TypedHookMap
- UnsetAdditionalOptions
- Variable
- VariableInfo
- WeakTupleMap
- WebAssemblyParser
- WebpackLogger
- Writable
- X509Certificate
<Configuration><Compiler>
|
<null><Configuration><Compiler><MultiConfiguration><MultiCompiler>
|
<null><MultiConfiguration><MultiCompiler>- {SchemaObject}
- {AsyncSchema}
[x: {string}]<any>
<AbortSignal>- {ListenOptions}
- {ReadableOperatorOptions}
- [
<StreamOptions>](/Stream.html#interface-streamoptions) - [
<FinishedOptions>](/Stream.html#interface-finishedoptions) - {PipelineOptions}
- [
<OnOptions>](/EventEmitter.html#interface-onoptions) - [
<OnceOptions>](/EventEmitter.html#interface-onceoptions)
<AbortSignal>[index: {string}]<any>
<object><number>- {RsaHashedImportParams}
- {EcKeyImportParams}
- {HmacImportParams}
<string>[index: {string}]{AliasOptionNewRequest}
<AssetInfo><string><string><object>Options for scope analysis.
<number>5
,
2015
,
2022
).<object>childVisitorKeys
is not specified.<boolean>eval()
calls, which normally create scopes.<boolean>"use strict"
.<boolean><boolean><boolean>- {Class}
body{ClassBody}end<number>id<null>loc<null>range{Tuple<number, number>}start<number>superClass<null>type{"ClassDeclaration"}
- {BaseExpression}
<null[]><Comment[]><null><Comment[]>- {IteratorObject<T, BuiltinIteratorReturn, unknown>}
[toStringTag]<string>
<number>Creates an iterator whose values are the values from this iterator after skipping the provided count.
<object><boolean>Determines whether all the members of this iterator satisfy the specified test.
Call Signature
<object>Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
Call Signature
<object>Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
Call Signature
<object><undefined>Returns the value of the first element in this iterator where predicate is true, and undefined otherwise.
Call Signature
<object><undefined><object>Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.
<object>Performs the specified action for each element in the iterator.
<object>Creates an iterator whose values are the result of applying the callback to the values from this iterator.
__namedParameters{Tuple|Tuple } - Returns: {IteratorResult<T, undefined>}
Call Signature
<object>Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Call Signature
<object>Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
<undefined><object><boolean>Determines whether the specified callback function returns true for any element of this iterator.
<number>Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.
<any>Creates a new array from the values yielded by this iterator.
[n: {number}]{T}
<number>- {BasePattern}
<null[]><Comment[]><null><Comment[]>- {BaseExpression}.{BaseFunction}
<boolean><boolean><boolean><Comment[]><null><Comment[]>sourceType{"css-url"}
Options object for data url generation.
encoding{false|"base64"} Asset encoding (defaults to base64).mimetype<string>Asset mimetype (getting from file extension by default).
Generator options for asset/inline modules.
Options object for DataUrl condition.
<number>Parser options for asset modules.
<object>Generator options for asset/resource modules.
<boolean><boolean>- {BaseExpression}
<Comment[]><null><Comment[]>- {BasePattern}
<Comment[]><null><Comment[]>- {Property}
<boolean><Comment[]><null><boolean><boolean><Comment[]><number><string><string><number><string><bigint><number>Describes a user-defined AsyncIterator that is also async iterable.
- {AsyncIterator<T, TReturn, TNext>}
__namedParameters{Tuple|Tuple } - Returns: {Promise<IteratorResult<T, TReturn>>}
value{TReturn|PromiseLike} - Returns: {Promise<IteratorResult<T, TReturn>>}
<any>- {AsyncIterableIterator}
__namedParameters{Tuple|Tuple } - Returns: {Promise<IteratorResult<T, TReturn>>}
value{TReturn|PromiseLike} - Returns: {Promise<IteratorResult<T, TReturn>>}
<any>- [
<EventEmitterAsyncResourceOptions>](/EventEmitter.html#interface-eventemitterasyncresourceoptions)
<boolean>emitDestroy
when the object is garbage collected.
This usually does not need to be set (even if
emitDestroy
is called
manually), unless the resource's
asyncId
is retrieved and the
sensitive API's
emitDestroy
is called with it.<number>- {_SchemaObject}
[x: {string}]<any>
<boolean>- {BaseExpression}
argument{Expression}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"AwaitExpression"}
argument{Expression}end<number>loc<null>range{Tuple<number, number>}start<number>type{"AwaitExpression"}
- {BaseExpression}
- {SimpleCallExpression}
- {NewExpression}
arguments{Expression|SpreadElement[]}callee{Expression|Super}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type<string>
- {BaseNode}
- {ClassExpression}
- {MaybeNamedClassDeclaration}
body{ClassBody}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}superClass<null>trailingComments<Comment[]>type<string>
- {BaseStatement}
- {MaybeNamedFunctionDeclaration}
- {VariableDeclaration}
- {MaybeNamedClassDeclaration}
<Comment[]><null><Comment[]><string>- {BaseNode}
- {UnaryExpression}
- {ImportExpression}
- {ArrayExpression}
- {ArrowFunctionExpression}
- {AssignmentExpression}
- {AwaitExpression}
- {BinaryExpression}
- {ChainExpression}
- {ClassExpression}
- {ConditionalExpression}
- {FunctionExpression}
- {Identifier}
- {SimpleLiteral}
- {RegExpLiteral}
- {BigIntLiteral}
- {LogicalExpression}
- {MemberExpression}
- {MetaProperty}
- {ObjectExpression}
- {SequenceExpression}
- {TaggedTemplateExpression}
- {TemplateLiteral}
- {ThisExpression}
- {UpdateExpression}
- {YieldExpression}
- {BaseCallExpression}
<Comment[]><null><Comment[]><string>- {BaseStatement}
- {ForInStatement}
- {ForOfStatement}
body{Statement}leadingComments<Comment[]>left{Pattern|VariableDeclaration}loc<null>range{Tuple<number, number>}right{Expression}trailingComments<Comment[]>type<string>
- {BaseNode}
- {ArrowFunctionExpression}
- {FunctionExpression}
- {MaybeNamedFunctionDeclaration}
<boolean><boolean><Comment[]><null><Comment[]><string>- {BaseNode}
- {ImportDeclaration}
- {ExportNamedDeclaration}
- {ExportAllDeclaration}
- {ExportDefaultDeclaration}
<Comment[]><null><Comment[]><string>- {BaseNode}
- {ImportSpecifier}
- {ImportDefaultSpecifier}
- {ImportNamespaceSpecifier}
<Comment[]><null><Comment[]><string>- {BaseNodeWithoutComments}
- {Identifier}
- {SimpleLiteral}
- {RegExpLiteral}
- {BigIntLiteral}
- {SpreadElement}
- {PrivateIdentifier}
- {Super}
- {MethodDefinition}
- {PropertyDefinition}
- {VariableDeclarator}
- {Program}
- {SwitchCase}
- {CatchClause}
- {Property}
- {Directive}
- {BaseModuleDeclaration}
- {ImportAttribute}
- {BaseExpression}
- {ClassBody}
- {TemplateElement}
- {BaseFunction}
- {BaseClass}
- {BasePattern}
- {BaseStatement}
- {JSXIdentifier}
- {BaseModuleSpecifier}
<Comment[]><null><Comment[]><string>- {BaseNode}
- {Identifier}
- {MemberExpression}
- {AssignmentPattern}
- {ObjectPattern}
- {ArrayPattern}
- {RestElement}
<Comment[]><null><Comment[]><string><string><string><string><string><string><boolean><boolean><string><string><null>- {BaseNode}
- {ExpressionStatement}
- {BlockStatement}
- {EmptyStatement}
- {DebuggerStatement}
- {WithStatement}
- {ReturnStatement}
- {LabeledStatement}
- {BreakStatement}
- {ContinueStatement}
- {IfStatement}
- {SwitchStatement}
- {ThrowStatement}
- {TryStatement}
- {WhileStatement}
- {DoWhileStatement}
- {ForStatement}
- {BaseDeclaration}
- {BaseForXStatement}
<Comment[]><null><Comment[]><string>- {BaseNode}.{BaseExpression}
<string><Comment[]><null><string><Comment[]>- {BaseExpression}
<Comment[]><null><Comment[]><Blob>endings{"native"|"transparent"}type<string>
- {BaseStatement}
body{Statement[]}innerComments<Comment[]>leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"BlockStatement"}
body{Statement[]}end<number>loc<null>range{Tuple<number, number>}start<number>type{"BlockStatement"}
<string[]><boolean><string[]><string[]><string[]>- {BaseStatement}
<null><Comment[]><null><Comment[]><string><string[]><string><string[]><number>buffer{Buffer} bufferhash{string|Buffer[]} hash maps{Map<string, BufferEntry>} mapssize<number>sizesource<boolean>source
<ChunkGraph><ModuleGraph><string><object><boolean><object><string><string><number><number><number><number><boolean><boolean>[index: {string}]<undefined>
<WebpackError>
|
<null><null><WebpackError>
|
<null>arguments{Expression|SpreadElement[]}callee{Expression|Super}end<number>loc<null>optional<boolean>range{Tuple<number, number>}start<number>type{"CallExpression"}
call{CallExpression}calleeName<string>getCalleeMembers<object>getMemberRanges<object>getMembers<object>getMembersOptionals<object>name<string>rootInfo<string>| [<VariableInfo>](/VariableInfo.html) type{"call"}
<string>
|
<undefined><Function>
|
<undefined><number><string><boolean><boolean><boolean><boolean><boolean><boolean>- {BaseNode}
body{BlockStatement}leadingComments<Comment[]>loc<null>param<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"CatchClause"}
body{BlockStatement}end<number>loc<null>param<null>range{Tuple<number, number>}start<number>type{"CatchClause"}
- {Dict<string|string[]>}
[key: {string}]<string>|<string[]>|<undefined>
<string>
|
<string[]><string>
|
<string[]><string>
|
<string[]><string>
|
<string[]><string>
|
<string[]><string>
|
<string[]>- {BaseExpression}
expression{ChainElement}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"ChainExpression"}
[index: {string}]{ChunkId[]}
[index: {string}]{ChunkChildIdsByOrdersMap}
chunks{Set} onChunks<Chunk[]>
<ChunkGroup><string><ChunkGraph><CodeGenerationResults><ModuleGraph><RuntimeTemplate>
](
contentHash{Record<ChunkId, Record<string, string>>}hash{Record<ChunkId, string>}name{Record<ChunkId, string>}
[index: {string}]<string>
-
[index: {number}]{IdToHashMap} -
[index: {string}]{IdToHashMap}
-
[index: {number}]{ChunkId[]} -
[index: {string}]{ChunkId[]}
-
[index: {number}]{ModuleId[]} -
[index: {string}]{ModuleId[]}
-
[index: {number}]{ModuleId[]} -
[index: {string}]{ModuleId[]}
hash{chunkModuleHashMap}id{ChunkModuleIdMapEs5Alias_1}
contentHash{Record<string, string>}contentHashWithLength{Record<string, object>}hash<string>hashWithLength<object>id<string>|<number>name<string>
<Chunk><ChunkGraph><CodeGenerationResults><Source><RuntimeTemplate>
](
<string><Chunk><ChunkGraph><CodeGenerationResults><DependencyTemplates>
](
<ModuleGraph><RuntimeTemplate>
](
<boolean>- {ClassExpression}
- {ClassDeclaration}
- {AnonymousClassDeclaration}
body{ClassBody}end<number>id<null>loc<null>range{Tuple<number, number>}start<number>superClass<null>type<string>
- {BaseNode}
body{MethodDefinition|PropertyDefinition|StaticBlock[]}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"ClassBody"}
body{MethodDefinition|PropertyDefinition|StaticBlock[]}end<number>loc<null>range{Tuple<number, number>}start<number>type{"ClassBody"}
- {MaybeNamedClassDeclaration}
body{ClassBody}id{Identifier} It is null when a class declaration is a part of theexport default classstatementleadingComments<Comment[]>loc<null>range{Tuple<number, number>}superClass<null>trailingComments<Comment[]>type{"ClassDeclaration"}
- {Class}
body{ClassBody}end<number>id{Identifier}loc<null>range{Tuple<number, number>}start<number>superClass<null>type{"ClassDeclaration"}
- {BaseClass}.{BaseExpression}
body{ClassBody}id<null>leadingComments<Comment[]>loc<null>range{Tuple<number, number>}superClass<null>trailingComments<Comment[]>type{"ClassExpression"}
- {Class}
body{ClassBody}end<number>id<null>loc<null>range{Tuple<number, number>}start<number>superClass<null>type{"ClassExpression"}
Advanced options for cleaning assets.
keep{SyncBailHook<Tuple, boolean|void>} when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
<ChunkGraph><CodeGenerationResults><Compilation><ConcatenationScope><DependencyTemplates>
](
<ModuleGraph><RuntimeTemplate>
](
data{CodeGenerationResultData} the resulting data for all source typeshash<string>a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)runtimeRequirements{ReadonlySet|null} the runtime requirements sources{Map<string, Source>} the resulting sources for all source types
- {BaseNodeWithoutComments}
- {TlsOptions}
- {TLSSocketOptions}
ALPNProtocols{string[]|ArrayBufferView} An array of strings, or a single Buffer,TypedArray, orDataViewcontaining the supported ALPN protocols. Buffers should have the format[len][name][len][name]...e.g.'\x08http/1.1\x08http/1.0', where thelenbyte is the length of the next protocol name. Passing an array is usually much simpler, e.g.['http/1.1', 'http/1.0']. Protocols earlier in the list have higher preference than those later.enableTrace<boolean>When enabled, TLS packet trace information is written tostderr. This can be used to debug TLS connection problems.rejectUnauthorized<boolean>If true the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if requestCert is true.requestCert<boolean>If true the server will request a certificate from clients that connect and attempt to verify that certificate. Defaults to false.requestOCSP<boolean>If true, specifies that the OCSP status request extension will be added to the client hello and an 'OCSPResponse' event will be emitted on the socket before establishing a secure communication.secureContext{SecureContext} An optional TLS context object from tls.createSecureContext()SNICallback<object>SNICallback(servername, cb)A function that will be called if the client supports SNI TLS extension. Two arguments will be passed when called: servername and cb. SNICallback should invoke cb(null, ctx), where ctx is a SecureContext instance. (tls.createSecureContext(...) can be used to get a proper SecureContext.) If SNICallback wasn't provided the default callback with high-level API will be used (see below).
a{T}b{T}- Returns: {-1|0|1}
declaration{CompatibilitySettingsDeclaration}name<string>
loc{DependencyLocation}range{Tuple<number, number>}updated<boolean>
[index: {string}]<Source>
renderModuleContent{SyncWaterfallHook<Tuple<Source, Module, WebAssemblyRenderContext>, Source>}
chunkHash{SyncHook<Tuple<Chunk, Hash, ChunkHashContext>>}renderModulePackage{SyncWaterfallHook<Tuple<Source, Module, ChunkRenderContextCssModulesPlugin>, Source>}
chunkHash{SyncHook<Tuple<Chunk, Hash, ChunkHashContext>>}embedInRuntimeBailout{SyncBailHook<Tuple<Module, RenderContextJavascriptModulesPlugin>, string|void>}inlineInRuntimeBailout{SyncBailHook<Tuple<Module, Partial>, string|void>} render{SyncWaterfallHook<Tuple<Source, RenderContextJavascriptModulesPlugin>, Source>}renderChunk{SyncWaterfallHook<Tuple<Source, RenderContextJavascriptModulesPlugin>, Source>}renderContent{SyncWaterfallHook<Tuple<Source, RenderContextJavascriptModulesPlugin>, Source>}renderMain{SyncWaterfallHook<Tuple<Source, RenderContextJavascriptModulesPlugin>, Source>}renderModuleContainer{SyncWaterfallHook<Tuple<Source, Module, ModuleRenderContext>, Source>}renderModuleContent{SyncWaterfallHook<Tuple<Source, Module, ModuleRenderContext>, Source>}renderModulePackage{SyncWaterfallHook<Tuple<Source, Module, ModuleRenderContext>, Source>}renderRequire{SyncWaterfallHook<Tuple<string, RenderBootstrapContext>, string>}renderStartup{SyncWaterfallHook<Tuple<Source, Module, StartupRenderContext>, Source>}strictRuntimeBailout{SyncBailHook<Tuple, string|void>} useSourceMap{SyncBailHook<Tuple<Chunk, RenderContextJavascriptModulesPlugin>, boolean|void>}
addContainerEntryDependency{SyncHook} addFederationRuntimeDependency{SyncHook}
updateHash{SyncBailHook<Tuple<Buffer[], string>, string|void>}
contextModuleFactory[<ContextModuleFactory>](/ContextModuleFactory.html) normalModuleFactory[<NormalModuleFactory>](/NormalModuleFactory.html)
[n: {number}]{T}
<number><string><string>ast{Program}chunkInitFragments{InitFragment[]} concatenationScope<ConcatenationScope>exportMap{Map<string, string>}globalScope{Scope<Variable, Reference>} index<number>internalNames{Map<string, string>}internalSource<Source>interopDefaultAccessName<string>runtime namespace object that detects "__esModule"interopDefaultAccessUsed<boolean>runtime namespace object that detects "__esModule"interopNamespaceObject2Name<string>"default-only" namespaceinteropNamespaceObject2Used<boolean>"default-only" namespaceinteropNamespaceObjectName<string>"default-with-named" namespaceinteropNamespaceObjectUsed<boolean>"default-with-named" namespacemodule<Module>moduleScope{Scope<Variable, Reference>} namespaceExportSymbol<string>namespaceObjectName<string>rawExportMap{Map<string, string>}runtimeRequirements{ReadonlySet} source<ReplaceSource>type{"concatenated"}
<ChunkGraph><ModuleGraph>- {BaseExpression}
alternate{Expression}consequent{Expression}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}test{Expression}trailingComments<Comment[]>type{"ConditionalExpression"}
alternate{Expression}consequent{Expression}end<number>loc<null>range{Tuple<number, number>}start<number>test{Expression}type{"ConditionalExpression"}
new Constructor(...params): any<any[]><any>Advanced configuration for modules that should be consumed from share scope.
<boolean><string><string><string><string><string><boolean><boolean>Options for consuming shared modules.
consumes{Consumes} Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.shareScope<string>Share scope name used for all consumed modules (defaults to 'default').
Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
[index: {string}]<string>
exposes{Exposes} Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.filename<string>The filename for this container relative path inside theoutput.pathdirectory.library<LibraryOptions>Options for library.name<string>The name for this container.runtime<string>The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.shareScope<string>The name of the share scope which is shared with the host (defaults to 'default').
remotes{Remotes} Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.remoteType{ExternalsType} The external type of the remote containers.shareScope<string>The name of the share scope shared with all remotes (defaults to 'default').
- {Dict
}
[key: {string}]<any>
resolved{ResolvedContextFileSystemInfoEntry}safeTime<number>symlinks{Set} timestampHash<string>
<ResolveOptions><string>
|
<string[]><string><string><string><ContextDependency[]>
](
<string><ResolveOptions>- {BaseStatement}
<null><Comment[]><null><Comment[]>algorithm{KeyAlgorithm}extractable<boolean>type{KeyType}usages{KeyUsage[]}
<boolean>Generator options for css modules.
createStylesheet{SyncWaterfallHook<Tuple<string, Chunk>, string>}linkPrefetch{SyncWaterfallHook<Tuple<string, Chunk>, string>}linkPreload{SyncWaterfallHook<Tuple<string, Chunk>, string>}
Generator options for css/module modules.
<boolean><object><boolean><string><number><string><Hash>
](
<string>Parser options for css/module modules.
<boolean>@keyframes
.<boolean>@container
names.<boolean><boolean><boolean>@function
names.<boolean><boolean>@import
at-rules handling.<boolean><boolean>url()
/
image-set()
/
src()
/
image()
functions handling.Parser options for css modules.
exportType{"link"|"text"|"css-style-sheet"|"style"} Configure how CSS content is exported as default.import<boolean>Enable/disable@importat-rules handling.namedExports<boolean>Use ES modules named export for css exports.url<boolean>Enable/disableurl()/image-set()/src()/image()functions handling.
- {BaseStatement}
<Comment[]><null><Comment[]>definitions{SyncWaterfallHook<Tuple<Record<string, CodeValue>>, Record<string, CodeValue>>}
[index: {string}]{CodeValue}
<AsyncDependenciesBlock[]><Dependency[]>new DependencyConstructor(...args): Dependency<any[]><Dependency><ChunkGraph><CodeGenerationResults><ConcatenationScope><DependencyTemplates>
](
<Module><ModuleGraph><RuntimeTemplate>
](
Helper function for joining two ranges into a single range. This is useful when working with AST nodes, as it allows you to combine the ranges of child nodes to create the range of the parent node.
- {PeerCertificate}
For EC keys: The key size in bits.
<boolean>true
if a Certificate Authority (CA),
false
otherwise.<string><string[]><string>:
separated hexadecimal string.<string>:
separated hexadecimal string.<string>:
separated hexadecimal string.subject
.<string><string><string><string>subject
names.<string><string><string><boolean><boolean><number><number><object>- {Context}
- {IncomingHttpHeaders}
- {OutgoingHttpHeaders}
- {Certificate}
[key: {string}]<undefined>
- {BaseNode}
<string><Comment[]><null><Comment[]><object><object><object><object><object><object><object><string><string>- {IteratorObject}
<string><boolean><boolean><string><string><string>The mappings from request to module info.
[index: {string}]<object>
An object containing content, name and type.
content{DllReferencePluginOptionsContent} The mappings from request to module info.name<string>The name where the dll is exposed (external name).type{"global"|"commonjs"|"jsonp"|"this"|"var"|"assign"|"window"|"commonjs2"|"commonjs-module"|"amd"|"amd-require"|"umd"|"umd2"|"system"} The type how the dll is exposed (external type).
Options for Dotenv plugin.
<string><string>
|
<string[]><string[]>- {BaseStatement}
body{Statement}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}test{Expression}trailingComments<Comment[]>type{"DoWhileStatement"}
body{Statement}end<number>loc<null>range{Tuple<number, number>}start<number>test{Expression}type{"DoWhileStatement"}
- {Algorithm}
attributes{Record<string, string>}compiler<string>dependency<string>descriptionData{JsonObjectTypes}issuer<string>issuerLayer<string>mimetype<string>realResource<string>resource<string>resourceFragment<string>resourceQuery<string>scheme<string>
type{EffectUseType}value<object>
No generator options are supported for this module type.
No parser options are supported for this module type.
- {BaseStatement}
<Comment[]><null><Comment[]><object><Dependency[]><Dependency[]><EntryOptions>An object with entry point description.
<boolean><string><string><string>
|
<string[]><LibraryOptions><string><string>An object with entry point description.
<boolean><string><string><string[]><string[]><LibraryOptions><string><string>Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
[index: {string}]{EntryDescriptionNormalized}
[index: {string}]{EnumValue}
The abilities of the environment where the webpack generated code should run.
<boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean>import.meta.dirname
and
import.meta.filename
.<boolean><boolean><boolean>node:
prefix for Node.js core modules.<boolean><boolean>cause{unknown}code<string>errno<number>message<string>name<string>path<string>stack<string>syscall<string>
data{unknown}instancePath<string>keyword{K}message<string>params{P}parentSchema{AnySchemaObject}propertyName<string>schema{S}schemaPath<string>
<object>The Symbol.for('nodejs.rejection') method is called in case a
promise rejection happens when emitting an event and
captureRejections is enabled on the emitter.
It is possible to use events.captureRejectionSymbol in
place of Symbol.for('nodejs.rejection').
import { EventEmitter, captureRejectionSymbol } from 'node:events';
class MyClass extends EventEmitter {
constructor() {
super({ captureRejections: true });
}
[captureRejectionSymbol](err, event, ...args) {
console.log('rejection happened for', event, 'with', err, ...args);
this.destroy(err);
}
destroy(err) {
// Tear the resource down here.
}
}eventName{IfEventMap<T, unknown|unknown|E>}listener{IfEventMap<T, object>}- Returns:
<this>
Alias for emitter.on(eventName, listener).
eventName{IfEventMap<T, unknown|unknown|E>}args{IfEventMap<T, T|EventEmitterEventMap|any[]>}- Returns:
<boolean>
Synchronously calls each of the listeners registered for the event named
eventName, in the order they were registered, passing the supplied arguments
to each.
Returns true if the event had listeners, false otherwise.
import { EventEmitter } from 'node: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<string>
|
<symbol[]>Returns an array listing the events for which the emitter has registered listeners.
import { EventEmitter } from 'node: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) ]<number>Returns the current max listener value for the EventEmitter which is either
set by emitter.setMaxListeners(n) or defaults to
events.defaultMaxListeners.
eventName{IfEventMap<T, unknown|unknown|E>} The name of the event being listened forlistener{IfEventMap<T, object, object>} The event handler function- Returns:
<number>
Returns the number of listeners listening for 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.
eventName{IfEventMap<T, unknown|unknown|E>}- Returns: {IfEventMap<T, object, object>[]}
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] ]eventName{IfEventMap<T, unknown|unknown|E>}listener{IfEventMap<T, object>}- Returns:
<this>
Alias for emitter.removeListener().
eventName{IfEventMap<T, unknown|unknown|E>} The name of the event.listener{IfEventMap<T, object>} The callback function- Returns:
<this>
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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.on('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// aeventName{IfEventMap<T, unknown|unknown|E>} The name of the event.listener{IfEventMap<T, object>} The callback function- Returns:
<this>
Adds a one-time listener 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!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependOnceListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.once('foo', () => console.log('a'));
myEE.prependOnceListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// aeventName{IfEventMap<T, unknown|unknown|E>} The name of the event.listener{IfEventMap<T, object>} The callback function- Returns:
<this>
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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.prependListener('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
eventName{IfEventMap<T, unknown|unknown|E>} The name of the event.listener{IfEventMap<T, object>} The callback function- Returns:
<this>
Adds a one-time listener 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.
eventName{IfEventMap<T, unknown|unknown|E>}- Returns: {IfEventMap<T, object, object>[]}
Returns a copy of the array of listeners for the event named eventName,
including any wrappers (such as those created by .once()).
import { EventEmitter } from 'node:events';
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');eventName{IfEventMap<T, unknown|unknown|E, string|symbol>}- Returns:
<this>
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
component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter, so that calls can be chained.
eventName{IfEventMap<T, unknown|unknown|E>}listener{IfEventMap<T, object>}- Returns:
<this>
Removes the specified listener from the listener array for the event named
eventName.
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
listener array. If any single listener has been added multiple times to the
listener array for the specified eventName, then removeListener() must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
time of emitting are called in order. This implies that any
removeListener() or removeAllListeners() calls after emitting and
before the last listener finishes execution will not remove them from
emit() in progress. Subsequent events behave as expected.
import { EventEmitter } from 'node:events';
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
const callbackA = () => {
console.log('A');
myEmitter.removeListener('event', callbackB);
};
const callbackB = () => {
console.log('B');
};
myEmitter.on('event', callbackA);
myEmitter.on('event', callbackB);
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
myEmitter.emit('event');
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
myEmitter.emit('event');
// Prints:
// ABecause listeners are managed using an internal array, calling this will
change the position indexes of any listener registered after the listener
being removed. This will not impact the order in which listeners are called,
but it means that any copies of the listener array as returned by
the emitter.listeners() method will need to be recreated.
When a single function has been added as a handler multiple times for a single
event (as in the example below), removeListener() will remove the most
recently added instance. In the example the once('ping')
listener is removed:
import { EventEmitter } from 'node:events';
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.
<number><this>By default EventEmitters will print a warning if more than 10 listeners are
added for a particular event. This is a useful default that helps finding
memory leaks. The emitter.setMaxListeners() method allows the limit to be
modified for this specific EventEmitter instance. The value can be set to
Infinity (or 0) to indicate an unlimited number of listeners.
Returns a reference to the EventEmitter, so that calls can be chained.
newListener{Tuple<eventName, listener>}removeListener{Tuple<eventName, listener>}
- [
<EventEmitterAsyncResourceOptions>](/EventEmitter.html#interface-eventemitterasyncresourceoptions)
<boolean>codeGenerationResult{CodeGenerationResult}module<Module>moduleObject{ExecuteModuleObject}
__webpack_require__{WebpackRequire}assets{Map<string, object>}chunk<Chunk>chunkGraph<ChunkGraph>
<EntryOptions>assets{Map<string, object>}buildDependencies{LazySet} cacheable<boolean>contextDependencies{LazySet} exports<any>fileDependencies{LazySet} missingDependencies{LazySet}
Enables/Disables experiments (experimental features with relax SemVer compatibility).
<boolean><boolean><boolean><boolean><boolean><boolean>Enables/Disables experiments (experimental features with relax SemVer compatibility).
[index: {string}]<any>
<string>
|
<RegExp>
|
<object[]><boolean><boolean><boolean>Enables/Disables experiments (experimental features with relax SemVer compatibility).
buildHttp{HttpUriOptions} Build http(s): urls using a lockfile and resource content cache.css<boolean>Enable css support.deferImport<boolean>Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.lazyCompilation{false|LazyCompilationOptions} Compile entrypoints and import()s only when they are accessed.
- {BaseModuleDeclaration}
attributes{ImportAttribute[]}exported<null>leadingComments<Comment[]>loc<null>range{Tuple<number, number>}source{Literal}trailingComments<Comment[]>type{"ExportAllDeclaration"}
attributes{ImportAttribute[]}end<number>exported<null>loc<null>range{Tuple<number, number>}source{Literal}start<number>type{"ExportAllDeclaration"}
- {BaseModuleDeclaration}
declaration{MaybeNamedClassDeclaration|Expression|MaybeNamedFunctionDeclaration}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"ExportDefaultDeclaration"}
declaration{Expression|FunctionDeclaration|ClassDeclaration|AnonymousFunctionDeclaration|AnonymousClassDeclaration}end<number>loc<null>range{Tuple<number, number>}start<number>type{"ExportDefaultDeclaration"}
- {BaseModuleDeclaration}
attributes{ImportAttribute[]}declaration<null>leadingComments<Comment[]>loc<null>range{Tuple<number, number>}source<null>specifiers{ExportSpecifier[]}trailingComments<Comment[]>type{"ExportNamedDeclaration"}
attributes{ImportAttribute[]}declaration<null>end<number>loc<null>range{Tuple<number, number>}source<null>specifiers{ExportSpecifier[]}start<number>type{"ExportNamedDeclaration"}
<boolean><string[]>
|
<null><string><boolean><string><number><boolean>Construct a type with the properties of T except for those in type K.
- {Omit<BaseModuleSpecifier, "local">}
exported{Identifier|Literal}leadingComments<Comment[]>loc<null>local{Identifier|Literal}range{Tuple<number, number>}trailingComments<Comment[]>type{"ExportSpecifier"}
<boolean><Module[]><number><boolean>Advanced configuration for modules that should be exposed by this container.
<string>
|
<string[]><string>Modules that should be exposed by this container. Property names are used as public paths.
[index: {string}]<string>|<string[]>
ArrayExpression{ArrayExpression}ArrowFunctionExpression{ArrowFunctionExpression}AssignmentExpression{AssignmentExpression}AwaitExpression{AwaitExpression}BinaryExpression{BinaryExpression}CallExpression{CallExpression}ChainExpression{ChainExpression}ClassExpression{ClassExpression}ConditionalExpression{ConditionalExpression}FunctionExpression{FunctionExpression}Identifier{Identifier}ImportExpression{ImportExpression}Literal{Literal}LogicalExpression{LogicalExpression}MemberExpression{MemberExpression}MetaProperty{MetaProperty}NewExpression{NewExpression}ObjectExpression{ObjectExpression}SequenceExpression{SequenceExpression}TaggedTemplateExpression{TaggedTemplateExpression}TemplateLiteral{TemplateLiteral}ThisExpression{ThisExpression}UnaryExpression{UnaryExpression}UpdateExpression{UpdateExpression}YieldExpression{YieldExpression}
- {BaseStatement}
expression{Expression}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"ExpressionStatement"}
<string>
|
<string[]><string>[index: {string}]<string>|<string[]>
chunkCondition{SyncBailHook<Tuple<Chunk, Compilation>, boolean>}
<boolean><string><string><boolean><number><string><boolean><string><boolean><string><boolean><Module><string><boolean>Enable presets of externals for specific targets.
<boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><string><ModuleProfile>
](
<Dependency[]><ModuleFactory><boolean><boolean><boolean>lstat{LStatTypes} lstat methodreaddir{ReaddirTypes} readdir methodreadFile{ReadFileTypes} read file methodreadJson<object>read json methodreadlink{ReadlinkTypes} read link methodrealpath{RealPathTypes} realpath methodstat{StatTypes} stat method
[index: {string}]<Argument>
A typed array of 16-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised.
[index: {number}]<number>
[toStringTag]{"Float16Array"}buffer{TArrayBuffer} The ArrayBuffer instance referenced by the array.byteLength<number>The length in bytes of the array.byteOffset<number>The offset in bytes of the array.BYTES_PER_ELEMENT<number>The size in bytes of each element in the array.length<number>The length of the array.
<number><number>
|
<undefined>Returns the item located at the specified index.
<number><number><number><this>Returns the this object after copying a section of the array identified by start and end to the same array starting at position target
Returns an array of key, value pairs for every entry in the array
<object><any><boolean>Determines whether all the members of an array satisfy the specified test.
<this>Changes all array elements from start to end index to a static value and returns the modified array
Returns the elements of an array that meet the condition specified in a callback function.
<object><any><number>
|
<undefined>Returns the value of the first element in the array where predicate is true, and undefined otherwise.
<object><any><number>Returns the index of the first element in the array where predicate is true, and -1 otherwise.
Call Signature
<object><any><undefined>Returns the value of the last element in the array where predicate is true, and undefined otherwise.
Call Signature
<number>
|
<undefined><object><any><number>Returns the index of the last element in the array where predicate is true, and -1 otherwise.
Performs the specified action for each element in an array.
<boolean>Determines whether an array includes a certain element, returning true or false as appropriate.
<number>Returns the index of the first occurrence of a value in an array.
<string><string>Adds all the elements of an array separated by the specified separator string.
Returns an list of keys in the array
<number>Returns the index of the last occurrence of a value in an array.
Calls a defined callback function on each element of an array, and returns an array that contains the results.
Call Signature
<object><number>Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<number>Call Signature
<object>Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object><number>Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<number>Call Signature
<object>Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
<this>Reverses the elements in an Array.
array{ArrayLike} A typed or untyped array of values to set. offset<number>The index in the current array at which the values are to be written.- Returns: {void}
Sets a value or an array of values.
Returns a section of an array.
<object><any><boolean>Determines whether the specified callback function returns true for any element of an array.
<object>[11,2,22,1].sort((a, b) => a - b)<this>Sorts an array.
Gets a new Float16Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive.
<string>
|
<string[]><string>Converts a number to a string by using the current locale.
Copies the array and returns the copy with the elements in reverse order.
<object>const myNums = Float16Array.from([11.25, 2, -22.5, 1]);
myNums.toSorted((a, b) => a - b) // Float16Array(4) [-22.5, 1, 2, 11.5]Copies and sorts the array.
<string>Returns a string representation of an array.
<this>Returns the primitive value of the specified object.
Returns an list of values in the array
Copies the array and inserts the given number at the provided index.
new Float16ArrayConstructor(length?): Float16Array<ArrayBuffer><number>new Float16ArrayConstructor(array): voidarray{ArrayLike|Iterable<number, any, any>} - Returns: {Float16Array
}
new Float16ArrayConstructor(buffer, byteOffset?, length?): voidnew Float16ArrayConstructor(buffer, byteOffset?, length?): Float16Array<ArrayBuffer>new Float16ArrayConstructor(array): voidarray{ArrayBuffer|ArrayLike} - Returns: {Float16Array
}
<number>Call Signature
arrayLike{ArrayLike} An array-like object to convert to an array. - Returns: {Float16Array
}
Creates an array from an array-like or iterable object.
Call Signature
arrayLike{ArrayLike} An array-like object to convert to an array. mapfn<object>A mapping function to call on every element of the array.thisArg<any>Value of 'this' used to invoke the mapfn.- Returns: {Float16Array
}
Creates an array from an array-like or iterable object.
Call Signature
elements{Iterable} An iterable object to convert to an array. - Returns: {Float16Array
}
Creates an array from an array-like or iterable object.
Call Signature
elements{Iterable} An iterable object to convert to an array. mapfn<object>A mapping function to call on every element of the array.thisArg<any>Value of 'this' used to invoke the mapfn.- Returns: {Float16Array
}
Creates an array from an array-like or iterable object.
<number[]>Returns a new array from a set of elements.
- {BaseForXStatement}
body{Statement}leadingComments<Comment[]>left{Pattern|VariableDeclaration}loc<null>range{Tuple<number, number>}right{Expression}trailingComments<Comment[]>type{"ForInStatement"}
body{Statement}end<number>left{VariableDeclaration|Pattern}loc<null>range{Tuple<number, number>}right{Expression}start<number>type{"ForInStatement"}
- {BaseForXStatement}
<boolean><Comment[]><null><Comment[]>- {BaseStatement}
body{Statement}init<null>leadingComments<Comment[]>loc<null>range{Tuple<number, number>}test<null>trailingComments<Comment[]>type{"ForStatement"}update<null>
body{Statement}end<number>init<null>loc<null>range{Tuple<number, number>}start<number>test<null>type{"ForStatement"}update<null>
[index: {string}]<string>
- {FunctionExpression}
- {ArrowFunctionExpression}
- {FunctionDeclaration}
- {AnonymousFunctionDeclaration}
- {MaybeNamedFunctionDeclaration}
<boolean><boolean>export default function
statement<Comment[]><null><Comment[]>- {BaseFunction}.{BaseExpression}
<boolean><boolean><null><Comment[]><null><Comment[]><ChunkGraph><CodeGenerationResults><ConcatenationScope><DependencyTemplates>
](
<object><ModuleGraph><RuntimeTemplate>
](
<string>[index: {string}]<any>
Specify options for each generator.
[index: {string}]<object>
result{T}callback<object>- Returns: {void}
<boolean><boolean><string><Dependency[]><ModuleFactory><boolean>attributes{Record<string, string>}await<boolean>ids<string[]>name<string>phase{ImportPhaseType}source<string>sourceOrder<number>
guards{AppendOnlyStackedSet}
<object><string><number><string><Hash>
](
- {Algorithm}
hotAcceptCallback{SyncBailHook<Tuple<ClassExpression|Identifier|SimpleLiteral|RegExpLiteral|BigIntLiteral|ArrayExpression|ArrowFunctionExpression|AssignmentExpression|AwaitExpression|BinaryExpression|SimpleCallExpression|NewExpression|ChainExpression|ConditionalExpression|FunctionExpression|ImportExpression|LogicalExpression|MemberExpression|MetaProperty|ObjectExpression|SequenceExpression|TaggedTemplateExpression|TemplateLiteral|ThisExpression|UnaryExpression|UpdateExpression|YieldExpression|SpreadElement, string[]>, void>}hotAcceptWithoutCallback{SyncBailHook<Tuple<CallExpression, string[]>, void>}
<object>These properties are added by the HotModuleReplacementPlugin
<boolean>Options for building http resources.
<string>
|
<RegExp>
|
<object[]><string><boolean><string><string><boolean>- {BaseNode}.{BaseExpression}.{BasePattern}
<Comment[]><null><string><Comment[]>- {BaseStatement}
<null><Comment[]><null><Comment[]>- {BaseNode}
key{Identifier|Literal}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"ImportAttribute"}value{Literal}
- {BaseModuleDeclaration}
attributes{ImportAttribute[]}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}source{Literal}specifiers{ImportSpecifier|ImportDefaultSpecifier|ImportNamespaceSpecifier[]}trailingComments<Comment[]>type{"ImportDeclaration"}
attributes{ImportAttribute[]}end<number>loc<null>range{Tuple<number, number>}source{Literal}specifiers{ImportSpecifier|ImportDefaultSpecifier|ImportNamespaceSpecifier[]}start<number>type{"ImportDeclaration"}
- {BaseModuleSpecifier}
<Comment[]><null><Comment[]>attributes{Record<string, string>}externalType{"module"|"import"}
- {BaseExpression}
<Comment[]><null><null><Comment[]>- {BaseModuleSpecifier}
<Comment[]><null><Comment[]>expression{ImportExpressionJavascriptParser}references{string[][]}
- {BaseModuleSpecifier}
imported{Identifier|Literal}leadingComments<Comment[]>loc<null>local{Identifier}range{Tuple<number, number>}trailingComments<Comment[]>type{"ImportSpecifier"}
- {Dict<string|string[]>}
[key: {string}]<string>|<string[]>|<undefined>
<string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string[]><string><string><string><string><string><string><string><string><string><string>- [
<ReadableEventMap>](/Stream.html#interface-readableeventmap)
aborted{Tuple} close{Tuple} data{Tuple} end{Tuple} error{Tuple} pause{Tuple} readable{Tuple} resume{Tuple}
Options for infrastructure level logging.
<boolean><boolean><Console><WritableStream>
|
<object>Session{Session}
Internal
This is the interface from which event-emitting Node.js APIs inherit in the types package. It is not intended for consumer use.
It provides event-mapped definitions similar to EventEmitter, except that its signatures are deliberately permissive: they provide type hinting, but not rigid type-checking, for compatibility reasons.
Classes that inherit directly from EventEmitter in JavaScript can inherit directly from
this interface in the type definitions. Classes that are more than one inheritance level
away from EventEmitter (eg. net.Socket > stream.Duplex > EventEmitter) must instead
copy these method definitions into the derived class. Search "#region InternalEventEmitter"
for examples.
- [
<EventEmitter>](/EventEmitter-1.html)
- [
<Server>](/Server.html)
The Symbol.for('nodejs.rejection') method is called in case a
promise rejection happens when emitting an event and
captureRejections is enabled on the emitter.
It is possible to use events.captureRejectionSymbol in
place of Symbol.for('nodejs.rejection').
import { EventEmitter, captureRejectionSymbol } from 'node:events';
class MyClass extends EventEmitter {
constructor() {
super({ captureRejections: true });
}
[captureRejectionSymbol](err, event, ...args) {
console.log('rejection happened for', event, 'with', err, ...args);
this.destroy(err);
}
destroy(err) {
// Tear the resource down here.
}
}Call Signature
Alias for emitter.on(eventName, listener).
Call Signature
<this>Alias for emitter.on(eventName, listener).
Call Signature
eventName{E}args{T}- Returns:
<boolean>
Synchronously calls each of the listeners registered for the event named
eventName, in the order they were registered, passing the supplied arguments
to each.
Returns true if the event had listeners, false otherwise.
import { EventEmitter } from 'node: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 listenerCall Signature
<boolean>Synchronously calls each of the listeners registered for the event named
eventName, in the order they were registered, passing the supplied arguments
to each.
Returns true if the event had listeners, false otherwise.
import { EventEmitter } from 'node: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<string>
|
<symbol[]>Returns an array listing the events for which the emitter has registered listeners.
import { EventEmitter } from 'node: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) ]<number>Returns the current max listener value for the EventEmitter which is either
set by emitter.setMaxListeners(n) or defaults to
events.defaultMaxListeners.
Call Signature
eventName{E} The name of the event being listened forlistener<object>The event handler function- Returns:
<number>
Returns the number of listeners listening for 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.
Call Signature
<number>Returns the number of listeners listening for 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.
Call Signature
eventName{E}- Returns:
<object[]>
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] ]Call Signature
<object[]>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] ]Call Signature
Alias for emitter.removeListener().
Call Signature
<this>Alias for emitter.removeListener().
Call Signature
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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.on('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// aCall Signature
<this>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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.on('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// aCall Signature
Adds a one-time listener 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!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependOnceListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.once('foo', () => console.log('a'));
myEE.prependOnceListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// aCall Signature
<this>Adds a one-time listener 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!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependOnceListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.once('foo', () => console.log('a'));
myEE.prependOnceListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// aCall Signature
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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.prependListener('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
Call Signature
<this>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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.prependListener('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
Call Signature
Adds a one-time listener 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.
Call Signature
<this>Adds a one-time listener 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.
Call Signature
eventName{E}- Returns:
<object[]>
Returns a copy of the array of listeners for the event named eventName,
including any wrappers (such as those created by .once()).
import { EventEmitter } from 'node:events';
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');Call Signature
<object[]>Returns a copy of the array of listeners for the event named eventName,
including any wrappers (such as those created by .once()).
import { EventEmitter } from 'node:events';
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');Call Signature
eventName{E}- Returns:
<this>
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
component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter, so that calls can be chained.
Call Signature
<this>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
component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter, so that calls can be chained.
Call Signature
Removes the specified listener from the listener array for the event named
eventName.
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
listener array. If any single listener has been added multiple times to the
listener array for the specified eventName, then removeListener() must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
time of emitting are called in order. This implies that any
removeListener() or removeAllListeners() calls after emitting and
before the last listener finishes execution will not remove them from
emit() in progress. Subsequent events behave as expected.
import { EventEmitter } from 'node:events';
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
const callbackA = () => {
console.log('A');
myEmitter.removeListener('event', callbackB);
};
const callbackB = () => {
console.log('B');
};
myEmitter.on('event', callbackA);
myEmitter.on('event', callbackB);
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
myEmitter.emit('event');
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
myEmitter.emit('event');
// Prints:
// ABecause listeners are managed using an internal array, calling this will
change the position indexes of any listener registered after the listener
being removed. This will not impact the order in which listeners are called,
but it means that any copies of the listener array as returned by
the emitter.listeners() method will need to be recreated.
When a single function has been added as a handler multiple times for a single
event (as in the example below), removeListener() will remove the most
recently added instance. In the example the once('ping')
listener is removed:
import { EventEmitter } from 'node:events';
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.
Call Signature
<this>Removes the specified listener from the listener array for the event named
eventName.
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
listener array. If any single listener has been added multiple times to the
listener array for the specified eventName, then removeListener() must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
time of emitting are called in order. This implies that any
removeListener() or removeAllListeners() calls after emitting and
before the last listener finishes execution will not remove them from
emit() in progress. Subsequent events behave as expected.
import { EventEmitter } from 'node:events';
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
const callbackA = () => {
console.log('A');
myEmitter.removeListener('event', callbackB);
};
const callbackB = () => {
console.log('B');
};
myEmitter.on('event', callbackA);
myEmitter.on('event', callbackB);
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
myEmitter.emit('event');
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
myEmitter.emit('event');
// Prints:
// ABecause listeners are managed using an internal array, calling this will
change the position indexes of any listener registered after the listener
being removed. This will not impact the order in which listeners are called,
but it means that any copies of the listener array as returned by
the emitter.listeners() method will need to be recreated.
When a single function has been added as a handler multiple times for a single
event (as in the example below), removeListener() will remove the most
recently added instance. In the example the once('ping')
listener is removed:
import { EventEmitter } from 'node:events';
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.
<number><this>By default EventEmitters will print a warning if more than 10 listeners are
added for a particular event. This is a useful default that helps finding
memory leaks. The emitter.setMaxListeners() method allows the limit to be
modified for this specific EventEmitter instance. The value can be set to
Infinity (or 0) to indicate an unlimited number of listeners.
Returns a reference to the EventEmitter, so that calls can be chained.
<AssetInfo><string><string><Date><number><Date><number><number><number><Date><number><number><number><number><object><object><object><object><object><object><object><number><Date><number><number><number><number><number><Date><Date><Date><object><object><object><object><object><object><object><Date>[index: {string}]<string>|<string[]>
Describes a user-defined Iterator that is also iterable.
- {Iterator<T, TReturn, TNext>}
__namedParameters{Tuple|Tuple } - Returns: {IteratorResult<T, TReturn>}
value{TReturn}- Returns: {IteratorResult<T, TReturn>}
<any>- {Iterator<T, TReturn, TNext>}.{Disposable}
- {SetIterator}
__namedParameters{Tuple|Tuple } - Returns: {IteratorResult<T, TReturn>}
value{TReturn}- Returns: {IteratorResult<T, TReturn>}
<any>done{true}value{TReturn}
done{false}value{TYield}
Parser options for javascript modules.
<object>require.amd
and
define.amd
. Or disable AMD support.<boolean><boolean><boolean><boolean><boolean><boolean><boolean><string><boolean><boolean><boolean><boolean><object><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><string><boolean><boolean>
|
<string[]><boolean><boolean><RegExp>Generator options for json modules.
<boolean>JSON.parse
when the JSON string is longer than 20 characters.[index: {string}]<string>|<number>|<boolean>|<null>|<undefined>
[index: {string}]<string>|<number>|<boolean>|<null>|<undefined>
Parser options for JSON modules.
linkPrefetch{SyncWaterfallHook<Tuple<string, Chunk>, string>}linkPreload{SyncWaterfallHook<Tuple<string, Chunk>, string>}
JSON Schema V4
[k: {string}]<any>
This provides a definition for additional items in an array instance when tuple definitions of the items is provided. This can be false to indicate additional items in the array are not allowed, or it can be a schema that defines the schema of the additional items.
<boolean><object><object><string><boolean><boolean><string>
|
<string[]>Conceptually, the behavior of extends can be seen as validating an instance against all constraints in the extending schema as well as the extended schema(s).
When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema.
When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST conform to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the "additionalItems" (Section 5.6) attribute using the same rules as "additionalProperties" (Section 5.4) for objects.
<number><number><number><number><number><number><number><number><number><string><object><object><boolean>
|
<string[]><string><boolean>- {Array
}
[n: {number}]{JSONSchema4Type}
[unscopables]<object>Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.length<number>Gets or sets the length of the array. This is a number one higher than the highest index in the array.
Iterator
<number><undefined>Returns the item located at the specified index.
Call Signature
items{ConcatArray[]} Additional arrays and/or items to add to the end of the array. - Returns: {JSONSchema4Type[]}
Combines two or more arrays. This method returns a new array without modifying any existing arrays.
Call Signature
items{JSONSchema4Type|ConcatArray[]} Additional arrays and/or items to add to the end of the array. - Returns: {JSONSchema4Type[]}
Combines two or more arrays. This method returns a new array without modifying any existing arrays.
<number><number><number><this>Returns the this object after copying a section of the array identified by start and end to the same array starting at position target
Returns an iterable of key, value pairs for every entry in the array
Call Signature
<object><any><this>Determines whether all the members of an array satisfy the specified test.
Call Signature
<object><any><boolean>Determines whether all the members of an array satisfy the specified test.
value{JSONSchema4Type} value to fill array section withstart<number>index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.end<number>index to stop filling the array at. If end is negative, it is treated as length+end.- Returns:
<this>
Changes all array elements from start to end index to a static value and returns the modified array
Call Signature
Returns the elements of an array that meet the condition specified in a callback function.
Call Signature
Returns the elements of an array that meet the condition specified in a callback function.
Call Signature
<object><any><undefined>Returns the value of the first element in the array where predicate is true, and undefined otherwise.
Call Signature
<undefined><object><any><number>Returns the index of the first element in the array where predicate is true, and -1 otherwise.
Call Signature
<object><any><undefined>Returns the value of the last element in the array where predicate is true, and undefined otherwise.
Call Signature
<undefined><object><any><number>Returns the index of the last element in the array where predicate is true, and -1 otherwise.
this{A}depth{D} The maximum recursion depth- Returns: {FlatArray<A, D>[]}
Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.
Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.
Performs the specified action for each element in an array.
searchElement{JSONSchema4Type} The element to search for.fromIndex<number>The position in this array at which to begin searching for searchElement.- Returns:
<boolean>
Determines whether an array includes a certain element, returning true or false as appropriate.
searchElement{JSONSchema4Type} The value to locate in the array.fromIndex<number>The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.- Returns:
<number>
Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
<string><string>Adds all the elements of an array into a string, separated by the specified separator string.
Returns an iterable of keys in the array
searchElement{JSONSchema4Type} The value to locate in the array.fromIndex<number>The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.- Returns:
<number>
Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.
Calls a defined callback function on each element of an array, and returns an array that contains the results.
<undefined>Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
items{JSONSchema4Type[]} New elements to add to the array.- Returns:
<number>
Appends new elements to the end of an array, and returns the new length of the array.
Call Signature
<object>Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Call Signature
<object>Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Call Signature
<object>Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.
<undefined>Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
<number><number>Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.
<object><any><boolean>Determines whether the specified callback function returns true for any element of an array.
<object>[11,2,22,1].sort((a, b) => a - b)<this>Sorts an array in place. This method mutates the array and returns a reference to the same array.
Call Signature
<number><number>Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
Call Signature
<number><number>Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
Call Signature
<string>Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
Call Signature
<string>
|
<string[]><string>Returns a copy of an array with its elements reversed.
<object>[11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22]Returns a copy of an array with its elements sorted.
Call Signature
Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array.
Call Signature
Copies an array and removes elements while returning the remaining elements.
<string>Returns a string representation of an array.
items{JSONSchema4Type[]} Elements to insert at the start of the array.- Returns:
<number>
Inserts new elements at the start of an array, and returns the new length of the array.
Returns an iterable of values in the array
<number>Copies an array, then overwrites the value at the provided index with the given value. If the index is negative, then it replaces from the end of the array.
[key: {string}]{JSONSchema4Type}
<string><string><string><object><object><string><number><number><string><number><number><number><number><number><number><number><number><number><string><object><object><string[]><string><boolean>- {Array
}
[n: {number}]{JSONSchema6Type}
[unscopables]<object>Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.length<number>Gets or sets the length of the array. This is a number one higher than the highest index in the array.
Iterator
<number><undefined>Returns the item located at the specified index.
Call Signature
items{ConcatArray[]} Additional arrays and/or items to add to the end of the array. - Returns: {JSONSchema6Type[]}
Combines two or more arrays. This method returns a new array without modifying any existing arrays.
Call Signature
items{JSONSchema6Type|ConcatArray[]} Additional arrays and/or items to add to the end of the array. - Returns: {JSONSchema6Type[]}
Combines two or more arrays. This method returns a new array without modifying any existing arrays.
<number><number><number><this>Returns the this object after copying a section of the array identified by start and end to the same array starting at position target
Returns an iterable of key, value pairs for every entry in the array
Call Signature
<object><any><this>Determines whether all the members of an array satisfy the specified test.
Call Signature
<object><any><boolean>Determines whether all the members of an array satisfy the specified test.
value{JSONSchema6Type} value to fill array section withstart<number>index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.end<number>index to stop filling the array at. If end is negative, it is treated as length+end.- Returns:
<this>
Changes all array elements from start to end index to a static value and returns the modified array
Call Signature
Returns the elements of an array that meet the condition specified in a callback function.
Call Signature
Returns the elements of an array that meet the condition specified in a callback function.
Call Signature
<object><any><undefined>Returns the value of the first element in the array where predicate is true, and undefined otherwise.
Call Signature
<undefined><object><any><number>Returns the index of the first element in the array where predicate is true, and -1 otherwise.
Call Signature
<object><any><undefined>Returns the value of the last element in the array where predicate is true, and undefined otherwise.
Call Signature
<undefined><object><any><number>Returns the index of the last element in the array where predicate is true, and -1 otherwise.
this{A}depth{D} The maximum recursion depth- Returns: {FlatArray<A, D>[]}
Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.
Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.
Performs the specified action for each element in an array.
searchElement{JSONSchema6Type} The element to search for.fromIndex<number>The position in this array at which to begin searching for searchElement.- Returns:
<boolean>
Determines whether an array includes a certain element, returning true or false as appropriate.
searchElement{JSONSchema6Type} The value to locate in the array.fromIndex<number>The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.- Returns:
<number>
Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
<string><string>Adds all the elements of an array into a string, separated by the specified separator string.
Returns an iterable of keys in the array
searchElement{JSONSchema6Type} The value to locate in the array.fromIndex<number>The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.- Returns:
<number>
Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.
Calls a defined callback function on each element of an array, and returns an array that contains the results.
<undefined>Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
items{JSONSchema6Type[]} New elements to add to the array.- Returns:
<number>
Appends new elements to the end of an array, and returns the new length of the array.
Call Signature
<object>Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Call Signature
<object>Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Call Signature
<object>Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.
<undefined>Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
<number><number>Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.
<object><any><boolean>Determines whether the specified callback function returns true for any element of an array.
<object>[11,2,22,1].sort((a, b) => a - b)<this>Sorts an array in place. This method mutates the array and returns a reference to the same array.
Call Signature
<number><number>Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
Call Signature
<number><number>Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
Call Signature
<string>Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
Call Signature
<string>
|
<string[]><string>Returns a copy of an array with its elements reversed.
<object>[11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22]Returns a copy of an array with its elements sorted.
Call Signature
Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array.
Call Signature
Copies an array and removes elements while returning the remaining elements.
<string>Returns a string representation of an array.
items{JSONSchema6Type[]} Elements to insert at the start of the array.- Returns:
<number>
Inserts new elements at the start of an array, and returns the new length of the array.
Returns an iterable of values in the array
<number>Copies an array, then overwrites the value at the provided index with the given value. If the index is negative, then it replaces from the end of the array.
[key: {string}]{JSONSchema6Type}
<string><object><string><string><string><string><string><object><object><string><number><number><string><number><number><number><number><number><number><number><number><number><string><object><object><boolean><string[]><string><boolean><boolean>- {Array
}
[n: {number}]{JSONSchema7Type}
[unscopables]<object>Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.length<number>Gets or sets the length of the array. This is a number one higher than the highest index in the array.
Iterator
<number><undefined>Returns the item located at the specified index.
Call Signature
items{ConcatArray[]} Additional arrays and/or items to add to the end of the array. - Returns: {JSONSchema7Type[]}
Combines two or more arrays. This method returns a new array without modifying any existing arrays.
Call Signature
items{JSONSchema7Type|ConcatArray[]} Additional arrays and/or items to add to the end of the array. - Returns: {JSONSchema7Type[]}
Combines two or more arrays. This method returns a new array without modifying any existing arrays.
<number><number><number><this>Returns the this object after copying a section of the array identified by start and end to the same array starting at position target
Returns an iterable of key, value pairs for every entry in the array
Call Signature
<object><any><this>Determines whether all the members of an array satisfy the specified test.
Call Signature
<object><any><boolean>Determines whether all the members of an array satisfy the specified test.
value{JSONSchema7Type} value to fill array section withstart<number>index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.end<number>index to stop filling the array at. If end is negative, it is treated as length+end.- Returns:
<this>
Changes all array elements from start to end index to a static value and returns the modified array
Call Signature
Returns the elements of an array that meet the condition specified in a callback function.
Call Signature
Returns the elements of an array that meet the condition specified in a callback function.
Call Signature
<object><any><undefined>Returns the value of the first element in the array where predicate is true, and undefined otherwise.
Call Signature
<undefined><object><any><number>Returns the index of the first element in the array where predicate is true, and -1 otherwise.
Call Signature
<object><any><undefined>Returns the value of the last element in the array where predicate is true, and undefined otherwise.
Call Signature
<undefined><object><any><number>Returns the index of the last element in the array where predicate is true, and -1 otherwise.
this{A}depth{D} The maximum recursion depth- Returns: {FlatArray<A, D>[]}
Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.
Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.
Performs the specified action for each element in an array.
searchElement{JSONSchema7Type} The element to search for.fromIndex<number>The position in this array at which to begin searching for searchElement.- Returns:
<boolean>
Determines whether an array includes a certain element, returning true or false as appropriate.
searchElement{JSONSchema7Type} The value to locate in the array.fromIndex<number>The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.- Returns:
<number>
Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
<string><string>Adds all the elements of an array into a string, separated by the specified separator string.
Returns an iterable of keys in the array
searchElement{JSONSchema7Type} The value to locate in the array.fromIndex<number>The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.- Returns:
<number>
Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.
Calls a defined callback function on each element of an array, and returns an array that contains the results.
<undefined>Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
items{JSONSchema7Type[]} New elements to add to the array.- Returns:
<number>
Appends new elements to the end of an array, and returns the new length of the array.
Call Signature
<object>Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Call Signature
<object>Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Call Signature
<object>Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.
<undefined>Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
<number><number>Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.
<object><any><boolean>Determines whether the specified callback function returns true for any element of an array.
<object>[11,2,22,1].sort((a, b) => a - b)<this>Sorts an array in place. This method mutates the array and returns a reference to the same array.
Call Signature
<number><number>Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
Call Signature
<number><number>Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
Call Signature
<string>Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
Call Signature
<string>
|
<string[]><string>Returns a copy of an array with its elements reversed.
<object>[11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22]Returns a copy of an array with its elements sorted.
Call Signature
Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array.
Call Signature
Copies an array and removes elements while returning the remaining elements.
<string>Returns a string representation of an array.
items{JSONSchema7Type[]} Elements to insert at the start of the array.- Returns:
<number>
Inserts new elements at the start of an array, and returns the new length of the array.
Returns an iterable of values in the array
<number>Copies an array, then overwrites the value at the provided index with the given value. If the index is negative, then it replaces from the end of the array.
[key: {string}]{JSONSchema7Type}
- {BaseNode}
<Comment[]><null><string><Comment[]>format{"jwk"}
<string><string><string>
|
<string[]><string>
|
<string[]><boolean><string>
|
<string[]><boolean><boolean><boolean><boolean><boolean><string>
|
<string[]><number><string><boolean><AssetInfo><boolean><boolean><string><string><string><string><boolean><JsonData>
](
<string><string><boolean><boolean><string><Snapshot>
](
<null>
using in ContextModule<boolean><boolean><boolean><boolean><boolean><boolean><string[]><boolean>noResolve{SyncHook<Tuple<ResolveRequest, Error>>} no resolve hookresolve{AsyncSeriesBailHook<Tuple<ResolveRequest, ResolveContext>, ResolveRequest|null>} resolve hookresolveStep{SyncHook<Tuple<AsyncSeriesBailHook<Tuple<ResolveRequest, ResolveContext>, ResolveRequest|null, UnsetAdditionalOptions>, ResolveRequest>>} resolve step hookresult{AsyncSeriesHook<Tuple<ResolveRequest, ResolveContext>>} result hook
harmonyNamedExports{Set} harmonyStarExports[<HarmonyStarExportsList>](/HarmonyStarExportsList.html) lastHarmonyImportOrder<number>localModules[<LocalModule[]>](/LocalModule.html)
deferredImportVarMap{Map<Module, string>}importVarMap{Map<Module, string>}
<string><number><boolean><boolean><boolean><boolean><number><boolean><string><number><string><string><boolean><boolean><object[]><object[]><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><object[]><boolean><string><number><string><number><boolean><RequestShortener>
](
<boolean><object[]>aggressiveSplits{SplitData[]}chunkHashes{ChunkHashes}chunkModuleHashes{ChunkModuleHashes}chunkModuleIds{ChunkModuleIds}chunkRuntime{ChunkRuntime}chunks{RecordsChunks}fullHashChunkModuleHashes{FullHashChunkModuleHashes}hash<string>hotIndex<number>modules{RecordsModules}
<string[]><boolean><string[]><boolean><boolean><number><AssetInfo><boolean><string><StatsAsset[]><number><string><string[]><boolean><string[]><number><string><string[]><boolean><StatsModule[]><string[]><StatsChunkOrigin[]><string><boolean><boolean><string[]><number><object[]><number><object[]><number><number><number><boolean><StatsAsset[]><number><StatsCompilation[]><StatsChunk[]><any><StatsError[]><number><number><number><number><number><string><StatsModule[]><string><boolean><string><string><number><string><StatsError[]><number>cause{KnownStatsError}chunkEntry<boolean>chunkId<string>|<number>chunkInitial<boolean>chunkName<string>compilerPath<string>details<string>errors{KnownStatsError[]}file<string>loc<string>message<string>moduleId<string>|<number>moduleIdentifier<string>moduleName<string>moduleTrace<StatsModuleTraceItem[]>stack<string>
<object><object><Compilation><object><string><any[]><StatsLoggingEntry[]><string><number><string[]><string><string[]><boolean><boolean><boolean><boolean><boolean><boolean><number><boolean><number><string><number><number><StatsModuleIssuer[]>
|
<null><StatsModule[]><string><string><string[]><boolean><boolean><number><number><StatsProfile><string[]>
|
<null><StatsModuleReason[]><number><string><boolean>
|
<string[]>
|
<null><number><boolean><string><StatsAsset><StatsChunk><StatsChunkGroup><string><StatsCompilation><StatsError><StatsLogging><StatsModule><StatsModuleIssuer><StatsModuleReason><StatsModuleTraceDependency><StatsModuleTraceItem><StatsProfile><string>factoryMeta{FactoryMeta} factory metageneratorOptions{GeneratorOptions}parserOptions{ParserOptions}resolveOptions<ResolveOptions>resolve options
- {BaseStatement}
body{Statement}label{Identifier}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"LabeledStatement"}
body{Statement}end<number>label{Identifier}loc<null>range{Tuple<number, number>}start<number>type{"LabeledStatement"}
Options for the default backend.
<string>Options for compiling entrypoints and import()s only when they are accessed.
[index: {string}]<any>
<string><boolean><boolean><string><string><string>Set explicit comments for commonjs, commonjs2, amd, and root.
Description object for all UMD variants of the library name.
<string><string><string>
|
<string[]>- {Abortable}
Custom values available in the loader context.
[index: {string}]<any>
[index: {string}]<any>
These properties are added by the LoaderPlugin
Call Signature
Call Signature
<string>Resolves the given request to a module, applies all configured loaders and calls back with the generated source, the sourceMap and the module instance (usually an instance of NormalModule). Use this function if you need to know the source code of another module to generate the result.
The properties are added by https://github.com/webpack/loader-runner
<object><string><string><any><number><object[]><string><string><string><string><string><string><string><string><string><string>Add a directory as dependency of the loader result.
<string>Adds a file as dependency of the loader result in order to make them watchable. For example, html-loader uses this technique as it finds src and src-set attributes. Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
<string><object>Make this loader async.
<boolean>Make this loader result cacheable. By default it's cacheable. A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed. This means the loader shouldn't have other dependencies than specified with this.addDependency. Most loaders are deterministic and cacheable.
Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
<string>alias of addDependency Adds a file as dependency of the loader result in order to make them watchable. For example, html-loader uses this technique as it finds src and src-set attributes. Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
<string[]><string[]><string[]>createScript{SyncWaterfallHook<Tuple<string, Chunk>, string>}
<any[]><number><string[]>- {BaseExpression}
<Comment[]><null><Comment[]><boolean>true
, the callback returns all resolved addresses in an array. Otherwise, returns a single address.<number>4
,
6
, or
0
. For backward compatibility reasons,
'IPv4'
and
'IPv6'
are interpreted
as
4
and
6
respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value
0
is used
with
{ all: true } (see below)
, both IPv4 and IPv6 addresses are returned.<number>getaddrinfo
flags. Multiple flags may be
passed by bitwise
OR
ing their values.verbatim
, the resolved addresses are return unsorted. When
ipv4first
, the resolved addresses are sorted
by placing IPv4 addresses before IPv6 addresses. When
ipv6first
, the resolved addresses are sorted by placing IPv6
addresses before IPv4 addresses. Default value is configurable using
setDefaultResultOrder or
--dns-result-order
.<boolean>true
, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When
false
, IPv4
addresses are placed before IPv6 addresses. This option will be deprecated in favor of
order
. When both are specified,
order
has higher precedence. New code should only use
order
. Default value is configurable using setDefaultResultOrderpath{PathLikeFs}callback<object>- Returns: {void}
path{PathLikeFs}options<object>|<undefined>callback<object>- Returns: {void}
path{PathLikeFs}options<undefined>callback<object>- Returns: {void}
path{PathLikeFs}options<undefined>- Returns: {IStats}
path{PathLikeFs}options<object>- Returns:
<undefined>
path{PathLikeFs}options<object>- Returns:
<undefined>
path{PathLikeFs}options<object>- Returns: {IStats}
path{PathLikeFs}options<object>- Returns: {IBigIntStats}
path{PathLikeFs}options<object>- Returns: {IStats|IBigIntStats}
path{PathLikeFs}options{StatSyncOptions}- Returns:
<undefined>
path{PathLikeTypes}callback<object>- Returns: {void}
path{PathLikeTypes}options<object>|<undefined>callback<object>- Returns: {void}
path{PathLikeTypes}options<undefined>callback<object>- Returns: {void}
<Chunk><ChunkGraph><CodeGenerationResults><DependencyTemplates>
](
<string><ModuleGraph><RuntimeTemplate>
](
<boolean>Describes a manifest entrypoint.
<string[]><string[]>Describes a manifest asset that links the emitted path to the producing asset.
The manifest object.
[index: {string}]<any>
assets{Record<string, ManifestItem>} Contains the names of assets.entrypoints{Record<string, ManifestEntrypoint>} Contains the names of entrypoints.
<boolean><string>manifest.json
inside the 'output.path' directory.<object><object><string><object>- {BaseClass}.{BaseDeclaration}
- {ClassDeclaration}
body{ClassBody}id<null>It is null when a class declaration is a part of theexport default classstatementleadingComments<Comment[]>loc<null>range{Tuple<number, number>}superClass<null>trailingComments<Comment[]>type{"ClassDeclaration"}
- {BaseFunction}.{BaseDeclaration}
- {FunctionDeclaration}
<boolean><boolean><null>export default function
statement<Comment[]><null><Comment[]>- {BaseExpression}.{BasePattern}
<boolean><Comment[]><null><boolean><Comment[]><number>- {BaseExpression}
<Comment[]><null><Comment[]>- {BaseNode}
<boolean><Comment[]><null><boolean><Comment[]>file{PathLikeFs}options<string>|<number>|<object>|<null>|<undefined>callback<object>- Returns: {void}
file{PathLikeFs}options<string>|<number>|<null>|<undefined>callback<object>- Returns: {void}
file{PathLikeFs}callback<object>- Returns: {void}
path{PathLikeFs}options<object>- Returns:
<string>|<undefined>
path{PathLikeFs}options<string>|<number>|<null>- Returns:
<string>|<undefined>
inheritance{Tuple<CssLayer, Supports, Media>[]} - The inheritance chainsource<CachedSource>- The cached sourceundoPath<string>- The undo path to the CSS file
<string><Dependency[]><ResolveOptions><string><string>output.path
directory.<LibraryOptions><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string>buildInfo{BuildInfo}memCache{WeakTupleMap<any[], any>}references{WeakMap<Dependency, Module>}
Options affecting the normal modules (NormalModuleFactory).
<"...">
|
<RuleSetRule>
|
<null>
|
<undefined[]><"...">
|
<RuleSetRule>
|
<null>
|
<undefined[]><boolean><boolean><boolean><boolean><string[]><Chunk><ChunkGraph><CodeGenerationResults><DependencyTemplates>
](
<boolean><boolean>factory
is set to false<ModuleGraph><boolean><RuntimeTemplate>
](
<boolean><boolean><object><string><object><ResolveOptions><boolean><string>javascript[<ModuleTemplate>](/ModuleTemplate.html)
<string><Compilation><FileSystemInfo>
](
[index: {string}]<string>
- {BaseCallExpression}
arguments{Expression|SpreadElement[]}callee{Expression|Super}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"NewExpression"}
arguments{Expression|SpreadElement[]}callee{Expression}end<number>loc<null>range{Tuple<number, number>}start<number>type{"NewExpression"}
- {Program}
- {Identifier}
- {Literal}
- {ThisExpression}
- {ArrayExpression}
- {ObjectExpression}
- {UnaryExpression}
- {UpdateExpression}
- {BinaryExpression}
- {AssignmentExpression}
- {LogicalExpression}
- {MemberExpression}
- {ConditionalExpression}
- {CallExpression}
- {NewExpression}
- {SequenceExpression}
- {YieldExpression}
- {TemplateLiteral}
- {TaggedTemplateExpression}
- {MetaProperty}
- {AwaitExpression}
- {ChainExpression}
- {ImportExpression}
- {ParenthesizedExpression}
- {ExpressionStatement}
- {BlockStatement}
- {EmptyStatement}
- {DebuggerStatement}
- {WithStatement}
- {ReturnStatement}
- {LabeledStatement}
- {BreakStatement}
- {ContinueStatement}
- {IfStatement}
- {SwitchStatement}
- {ThrowStatement}
- {TryStatement}
- {WhileStatement}
- {DoWhileStatement}
- {ForStatement}
- {ForInStatement}
- {ForOfStatement}
- {ImportDeclaration}
- {ExportNamedDeclaration}
- {ExportDefaultDeclaration}
- {ExportAllDeclaration}
- {SpreadElement}
- {Property}
<Function>- {PrivateIdentifier}
- {Super}
- {TemplateElement}
- {Class}
- {ClassBody}
- {SwitchCase}
- {CatchClause}
- {VariableDeclaration}
- {ImportSpecifier}
- {ImportDefaultSpecifier}
- {ImportNamespaceSpecifier}
- {ImportAttribute}
- {ExportSpecifier}
- {ObjectPattern}
- {ArrayPattern}
- {RestElement}
- {AssignmentPattern}
- {MethodDefinition}
- {PropertyDefinition}
- {StaticBlock}
- {VariableDeclarator}
- {AssignmentProperty}
infrastructureLogging{InfrastructureLogging} infrastructure logging options
AssignmentProperty{AssignmentProperty}CatchClause{CatchClause}Class{Class}ClassBody{ClassBody}Expression{Expression}Function<Function>Identifier{Identifier}Literal{Literal}MethodDefinition{MethodDefinition}ModuleDeclaration{ModuleDeclaration}ModuleSpecifier{ModuleSpecifier}Pattern{Pattern}PrivateIdentifier{PrivateIdentifier}Program{Program}Property{Property}PropertyDefinition{PropertyDefinition}SpreadElement{SpreadElement}Statement{Statement}Super{Super}SwitchCase{SwitchCase}TemplateElement{TemplateElement}VariableDeclarator{VariableDeclarator}
Options object for node compatibility features.
<boolean>[index: {string}]{VirtualModule}
beforeLoaders{SyncHook<Tuple<LoaderItem[], NormalModule, AnyLoaderContext>>}beforeParse{SyncHook<Tuple>} beforeSnapshot{SyncHook<Tuple>} loader{SyncHook<Tuple<AnyLoaderContext, NormalModule>>}needBuild{AsyncSeriesBailHook<Tuple<NormalModule, NeedBuildContext>, boolean>}processResult{SyncWaterfallHook<Tuple<Tuple<string|Buffer, string|RawSourceMap|undefined, PreparsedAst|undefined>, NormalModule>, Tuple<string|Buffer , string|RawSourceMap|undefined, PreparsedAst|undefined>>} readResource{HookMap<AsyncSeriesBailHook<Tuple, string|Buffer |null, UnsetAdditionalOptions>>} readResourceForScheme{HookMap<FakeHook<AsyncSeriesBailHook<Tuple<string, NormalModule>, string|Buffer|null, UnsetAdditionalOptions>>>}
<string><boolean><Generator><string><string><string><string><ResolveOptions><string><string><string>These properties are added by the NormalModule
<Compilation><Compiler><NormalModule><string><number><string><string><boolean><object><number><boolean><string><Error><Error><string><WebpackLogger>
](
Call Signature
Call Signature
schema{Schema}- Returns: {OptionsType}
options{ResolveOptionsWithDependencyType}- Returns:
<object>
[index: {string}]<any>
<null>- {BaseExpression}
<Comment[]><null><Comment[]>- {BasePattern}
<Comment[]><null><Comment[]><boolean><boolean><number>buffer{Uint8Array|object}
<number><Uint8Array><boolean>This function is called for every chunk of incoming data.
Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer.
Return false from this function to implicitly pause() the socket.
file{PathLikeFs}flags<string>|<number>|<undefined>mode<string>|<number>|<null>|<undefined>callback<object>- Returns: {void}
file{PathLikeFs}flags<string>|<number>|<undefined>callback<object>- Returns: {void}
file{PathLikeFs}callback<object>- Returns: {void}
Enables/Disables integrated optimizations.
<boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><"...">
|
<WebpackPluginInstance>
|
<object>
|
<null>
|
<undefined[]><string><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean>Enables/Disables integrated optimizations.
<boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><boolean><"...">
|
<WebpackPluginInstance>
|
<object[]><string><boolean><boolean><boolean><boolean><boolean><boolean><object><boolean><boolean>Options object for describing behavior of a cache group selecting modules that should be cached together.
<string><boolean><string><number><number><number><number><boolean><boolean>Options object for splitting chunks into smaller chunks.
<string><object><string[]><object><boolean><number><number><number><boolean><object><string><string[]><string><string><boolean>await
identifiers are allowed to appear at the top-level scope only if
ecmaVersion
>= 2022.
When enabled, await identifiers are allowed to appear at the top-level scope,
but they are still not allowed in non-async functions.<boolean><boolean><boolean>allowReserved
to a boolean value to explicitly turn this on
an off. When this option has the value "never", reserved words
and keywords can also not be used as property names.<boolean><boolean><boolean><string>ecmaVersion
indicates the ECMAScript version to parse. Can be a
number, either in year (
2022
) or plain version number (
6
) form,
or
"latest"
(the latest the library supports). This influences
support for strict mode, the set of reserved words, and support for
new syntax features.<boolean>locations
is on,
loc
properties holding objects with
start
and
end
properties as
Position
objects will be attached to the
nodes.<object>
|
<Comment[]>When a export function is passed, Acorn will call that export function with (block, text, start, end) parameters whenever a comment is skipped. block is a
boolean indicating whether this is a block (/* */) comment,
text is the content of the comment, and start and end are
character offsets that denote the start and end of the comment.
When the locations option is on, two more parameters are
passed, the full locations of Position export type of the start and
end of the comments.
When a array is passed, each found comment of Comment export type is pushed to the array.
Note that you are not allowed to call the parser from the callback—that will corrupt its internal state.
<object><object><Token[]>
](
tokenizer().getToken()
. Note
that you are not allowed to call the parser from the
callback—that will corrupt its internal state.<object>onInsertedSemicolon
, but for trailing commas<boolean><Node>program
option in subsequent parses. This will add the
toplevel forms of the parsed file to the
Program
(top) node
of an existing parse tree.<boolean>start
and
end
properties (directly on the node, rather than
the
loc
object, which holds line/column data. To also add a
[semi-standardized][range]
range
property holding a
[start, end]
array with the same numbers, set the
ranges
option to
true
.<string>loc
object.sourceType
indicates the mode the code should be parsed in.
Can be either
"script"
,
"module"
or
"commonjs"
. This influences global
strict mode and parsing of
import
and
export
declarations.- {Dict
}
[key: {string}]<undefined>
<string>
|
<string[]><string>
|
<string[]><string>
|
<string[]><string>
|
<string[]><string><string><string><string><string><string><string><string><string><string><string><string><string><string><string>
|
<string[]><string><string><string><string><string><string><string><string><string>
|
<string[]><string><string>
|
<string[]><string><string><string><string><string><string><string><string><string><string><string><string><string><string>
|
<string[]><string><string><string><string>
|
<string[]><string>
|
<string[]><string><string><string><string><string><string><string><string><string><string>
|
<string[]><string><string>
|
<string[]><string><string><string>
|
<string[]><string><string><string><string><string><string><string><string><string>
|
<string[]><string><string>
|
<string[]><string><string><string><string>- [
<WritableEventMap>](/Stream.html#interface-writableeventmap)
close{Tuple} drain{Tuple} error{Tuple} finish{Tuple} pipe{Tuple} prefinish{Tuple} unpipe{Tuple}
Options affecting the output of the compilation. output options tell webpack how to write the compiled files to disk.
<string><boolean><string><boolean><string><string><string><number><boolean><boolean>output.devtoolModuleFilenameTemplate
, but used in the case of duplicate module identifiers.<string>output.library
if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.<string[]><string[]><string[]><string><string><number><string><Hash>
](
<string><string><string><string><boolean><boolean><string><string><string>
|
<string[]>
|
<LibraryOptions><string>
|
<string[]><string><boolean><string><boolean><string><string><boolean><boolean><string>
|
<TrustedTypes><boolean>output.libraryTarget
is set to umd and
output.library
is set, setting this to true will name the AMD module.<string><string><string><string><string><string>Normalized options affecting the output of the compilation. output options tell webpack how to write the compiled files to disk.
<boolean><boolean><string><string><string><number><boolean><boolean>output.devtoolModuleFilenameTemplate
, but used in the case of duplicate module identifiers.<string>output.library
if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.<string[]><string[]><string[]><string><string><number><string><Hash>
](
<string><string><string><string><boolean><boolean><string><string><LibraryOptions><boolean><string><boolean><string><string><boolean><boolean><TrustedTypes><string><string><string><string><string><string>tArg{TArg}- Returns: {Comparator
}
ast{Program}comments{CommentJavascriptParser[]}semicolons{Set}
[index: {string}]<any>
Specify options for each parser.
[index: {string}]<object>
<Compilation><NormalModule><NormalModule>- {DetailedPeerCertificate}
For EC keys: The key size in bits.
<boolean>true
if a Certificate Authority (CA),
false
otherwise.<string><string[]><string>:
separated hexadecimal string.<string>:
separated hexadecimal string.<string>:
separated hexadecimal string.subject
.<string><string><string><string>subject
names.<string><string>Configuration object for web performance recommendations.
<object><number><number><boolean><object>[index: {string}]<any>
- {BaseNode}
<Comment[]><null><string><Comment[]><string>path.resolve(__dirname, 'profiling/events.json')
. Defaults to
events.json
.- {BaseNode}
body{ModuleDeclaration|Statement|Directive[]}comments<Comment[]>leadingComments<Comment[]>loc<null>range{Tuple<number, number>}sourceType{"module"|"script"}trailingComments<Comment[]>type{"Program"}
body{Statement|ModuleDeclaration[]}end<number>loc<null>range{Tuple<number, number>}sourceType{"module"|"script"}start<number>type{"Program"}
Options object for the ProgressPlugin.
<boolean><boolean><number><boolean><object><boolean><number><null>Attaches callbacks for the resolution and/or rejection of the Promise.
- {BaseNode}
- {AssignmentProperty}
<boolean><Comment[]><null><boolean><boolean><Comment[]>- {BaseNode}
<boolean><Comment[]><null><boolean><Comment[]><null>Advanced configuration for modules that should be provided as shared modules to the share scope.
<boolean><string><string><string>provides{Provides} Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key.shareScope<string>Share scope name used for all provided modules (defaults to 'default').
Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
[index: {string}]<string>
format{"pem"|"der"}type{T}
buf{string|Buffer} PFX or PKCS12 encoded private key and certificate chain. passphrase<string>Optional passphrase.
<number>chunk{T}- Returns:
<number>
<string><string><number[]><string><string[]><string><string[]><string[]><number><ReadableStreamBYOBRequest>
|
<null>chunk{NonSharedArrayBufferView}- Returns: {void}
<any><boolean>false
, calling
return
on the async iterator,
or exiting a
for await...of
iteration using a
break
,
return
, or
throw
will not destroy the stream.- {Abortable}
- [
<ArrayOptions>](/Stream.html#interface-arrayoptions)
<number>fn
to call
on the stream at once.<number><AbortSignal>- {StreamOptions
}
- [
<DuplexOptions>](/Stream.html#interface-duplexoptions)
- [
<EventEmitter>](/EventEmitter-1.html)
- {ReadWriteStream}
<boolean>The Symbol.for('nodejs.rejection') method is called in case a
promise rejection happens when emitting an event and
captureRejections is enabled on the emitter.
It is possible to use events.captureRejectionSymbol in
place of Symbol.for('nodejs.rejection').
import { EventEmitter, captureRejectionSymbol } from 'node:events';
class MyClass extends EventEmitter {
constructor() {
super({ captureRejections: true });
}
[captureRejectionSymbol](err, event, ...args) {
console.log('rejection happened for', event, 'with', err, ...args);
this.destroy(err);
}
destroy(err) {
// Tear the resource down here.
}
}<this>Alias for emitter.on(eventName, listener).
<boolean>Synchronously calls each of the listeners registered for the event named
eventName, in the order they were registered, passing the supplied arguments
to each.
Returns true if the event had listeners, false otherwise.
import { EventEmitter } from 'node: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<string>
|
<symbol[]>Returns an array listing the events for which the emitter has registered listeners.
import { EventEmitter } from 'node: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) ]<number>Returns the current max listener value for the EventEmitter which is either
set by emitter.setMaxListeners(n) or defaults to
events.defaultMaxListeners.
<boolean><number>Returns the number of listeners listening for 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.
<object[]>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] ]<this>Alias for emitter.removeListener().
<this>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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.on('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a<this>Adds a one-time listener 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!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependOnceListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.once('foo', () => console.log('a'));
myEE.prependOnceListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a<this>destination{T}options<object>- Returns: {T}
<this>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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.prependListener('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
<this>Adds a one-time listener 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.
<object[]>Returns a copy of the array of listeners for the event named eventName,
including any wrappers (such as those created by .once()).
import { EventEmitter } from 'node:events';
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');<number><this>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
component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter, so that calls can be chained.
<this>Removes the specified listener from the listener array for the event named
eventName.
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
listener array. If any single listener has been added multiple times to the
listener array for the specified eventName, then removeListener() must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
time of emitting are called in order. This implies that any
removeListener() or removeAllListeners() calls after emitting and
before the last listener finishes execution will not remove them from
emit() in progress. Subsequent events behave as expected.
import { EventEmitter } from 'node:events';
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
const callbackA = () => {
console.log('A');
myEmitter.removeListener('event', callbackB);
};
const callbackB = () => {
console.log('B');
};
myEmitter.on('event', callbackA);
myEmitter.on('event', callbackB);
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
myEmitter.emit('event');
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
myEmitter.emit('event');
// Prints:
// ABecause listeners are managed using an internal array, calling this will
change the position indexes of any listener registered after the listener
being removed. This will not impact the order in which listeners are called,
but it means that any copies of the listener array as returned by
the emitter.listeners() method will need to be recreated.
When a single function has been added as a handler multiple times for a single
event (as in the example below), removeListener() will remove the most
recently added instance. In the example the once('ping')
listener is removed:
import { EventEmitter } from 'node:events';
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.
<this>encoding{BufferEncoding}- Returns:
<this>
<number><this>By default EventEmitters will print a warning if more than 10 listeners are
added for a particular event. This is a useful default that helps finding
memory leaks. The emitter.setMaxListeners() method allows the limit to be
modified for this specific EventEmitter instance. The value can be set to
Infinity (or 0) to indicate an unlimited number of listeners.
Returns a reference to the EventEmitter, so that calls can be chained.
<WritableStream><this>chunk{string|Uint8Array} encoding{BufferEncoding}- Returns: {void}
<ReadableStream><this><boolean>options{ReadableStreamIteratorOptions}- Returns: {ReadableStreamAsyncIterator
}
<any>Call Signature
<object><ReadableStreamBYOBReader>Call Signature
Call Signature
options{ReadableStreamGetReaderOptions}- Returns: {ReadableStreamReader
}
transform{ReadableWritablePair<T, R>}options{StreamPipeOptions}- Returns: {ReadableStream
}
destination{WritableStream} options{StreamPipeOptions}- Returns: {Promise
}
options{ReadableStreamIteratorOptions}- Returns: {ReadableStreamAsyncIterator
}
- {AsyncIterator[
<<T, NodeJS.BuiltinIteratorReturn, unknown>>](<T, NodeJS.html#class-t-nodejsbuiltiniteratorreturn-unknown)}
__namedParameters{Tuple|Tuple } - Returns: {Promise<IteratorResult<T, undefined>>}
value{PromiseLike} - Returns: {Promise<IteratorResult<T, undefined>>}
<any>- {ReadableStreamGenericReader}
closed{Promise}
<any>view{T}options{ReadableStreamBYOBReaderReadOptions}- Returns: {Promise<ReadableStreamReadResult
>}
<number><null><number>view{NonSharedArrayBufferView}- Returns: {void}
chunk{R}- Returns: {void}
<any>- {ReadableStreamGenericReader}
closed{Promise}
<any>closed{Promise}
<any>mode{"byob"}
<boolean>done{true}value<undefined>
done{false}value{T}
strategy{QueuingStrategy} type{"bytes"}
readable{ReadableStream} writable{WritableStream}
path{PathLikeFs}options<object>|<null>|<undefined>callback<object>- Returns: {void}
path{PathLikeFs}options<object>|<null>|<undefined>callback<object>- Returns: {void}
path{PathLikeFs}callback<object>- Returns: {void}
path{PathLikeFs}options<object>|<null>- Returns:
<string[]>
path{PathLikeFs}options<object>- Returns: {Buffer
[]}
path{PathLikeFs}options<object>- Returns: {Dirent
[]}
path{PathLikeFs}options<object>- Returns: {Dirent<Buffer
>[]}
path{PathLikeTypes}options<object>|<null>|<undefined>callback<object>- Returns: {void}
path{PathLikeTypes}options<object>|<null>|<undefined>callback<object>- Returns: {void}
path{PathLikeTypes}callback<object>- Returns: {void}
<boolean>path{PathOrFileDescriptorFs}options<object>|<null>|<undefined>callback<object>- Returns: {void}
path{PathOrFileDescriptorFs}options<object>|<null>|<undefined>callback<object>- Returns: {void}
path{PathOrFileDescriptorFs}callback<object>- Returns: {void}
path{PathOrFileDescriptorTypes}options<object>|<null>|<undefined>callback<object>- Returns: {void}
path{PathOrFileDescriptorTypes}options<object>|<null>|<undefined>callback<object>- Returns: {void}
path{PathOrFileDescriptorTypes}callback<object>- Returns: {void}
path{PathLikeFs}options{EncodingOption}callback<object>- Returns: {void}
path{PathLikeFs}options{BufferEncodingOption}callback<object>- Returns: {void}
path{PathLikeFs}options{EncodingOption}callback<object>- Returns: {void}
path{PathLikeFs}callback<object>- Returns: {void}
path{PathLikeFs}options{EncodingOption}- Returns:
<string>
path{PathLikeFs}options{BufferEncodingOption}- Returns: {Buffer}
path{PathLikeFs}options{EncodingOption}- Returns: {string|Buffer
}
path{PathLikeTypes}options{EncodingOption}callback<object>- Returns: {void}
path{PathLikeTypes}options{BufferEncodingOption}callback<object>- Returns: {void}
path{PathLikeTypes}options{EncodingOption}callback<object>- Returns: {void}
path{PathLikeTypes}callback<object>- Returns: {void}
<number>value{T}- Returns:
<boolean>a boolean indicating whether an element with the specified value exists in the set-like or not.
Despite its name, returns an iterator of the values in the set-like.
The Symbol.for('nodejs.rejection') method is called in case a
promise rejection happens when emitting an event and
captureRejections is enabled on the emitter.
It is possible to use events.captureRejectionSymbol in
place of Symbol.for('nodejs.rejection').
import { EventEmitter, captureRejectionSymbol } from 'node:events';
class MyClass extends EventEmitter {
constructor() {
super({ captureRejections: true });
}
[captureRejectionSymbol](err, event, ...args) {
console.log('rejection happened for', event, 'with', err, ...args);
this.destroy(err);
}
destroy(err) {
// Tear the resource down here.
}
}<this>Alias for emitter.on(eventName, listener).
<boolean>Synchronously calls each of the listeners registered for the event named
eventName, in the order they were registered, passing the supplied arguments
to each.
Returns true if the event had listeners, false otherwise.
import { EventEmitter } from 'node: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 listenerCall Signature
<object><this>Call Signature
Call Signature
<this><string>
|
<symbol[]>Returns an array listing the events for which the emitter has registered listeners.
import { EventEmitter } from 'node: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) ]<number>Returns the current max listener value for the EventEmitter which is either
set by emitter.setMaxListeners(n) or defaults to
events.defaultMaxListeners.
<boolean><number>Returns the number of listeners listening for 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.
<object[]>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] ]<this>Alias for emitter.removeListener().
<this>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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.on('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a<this>Adds a one-time listener 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!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependOnceListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.once('foo', () => console.log('a'));
myEE.prependOnceListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a<this>destination{T}options<object>- Returns: {T}
<this>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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.prependListener('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
<this>Adds a one-time listener 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.
<object[]>Returns a copy of the array of listeners for the event named eventName,
including any wrappers (such as those created by .once()).
import { EventEmitter } from 'node:events';
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');<number><this>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
component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter, so that calls can be chained.
<this>Removes the specified listener from the listener array for the event named
eventName.
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
listener array. If any single listener has been added multiple times to the
listener array for the specified eventName, then removeListener() must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
time of emitting are called in order. This implies that any
removeListener() or removeAllListeners() calls after emitting and
before the last listener finishes execution will not remove them from
emit() in progress. Subsequent events behave as expected.
import { EventEmitter } from 'node:events';
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
const callbackA = () => {
console.log('A');
myEmitter.removeListener('event', callbackB);
};
const callbackB = () => {
console.log('B');
};
myEmitter.on('event', callbackA);
myEmitter.on('event', callbackB);
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
myEmitter.emit('event');
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
myEmitter.emit('event');
// Prints:
// ABecause listeners are managed using an internal array, calling this will
change the position indexes of any listener registered after the listener
being removed. This will not impact the order in which listeners are called,
but it means that any copies of the listener array as returned by
the emitter.listeners() method will need to be recreated.
When a single function has been added as a handler multiple times for a single
event (as in the example below), removeListener() will remove the most
recently added instance. In the example the once('ping')
listener is removed:
import { EventEmitter } from 'node:events';
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.
<this>encoding{BufferEncoding}- Returns:
<this>
<number><this>By default EventEmitters will print a warning if more than 10 listeners are
added for a particular event. This is a useful default that helps finding
memory leaks. The emitter.setMaxListeners() method allows the limit to be
modified for this specific EventEmitter instance. The value can be set to
Infinity (or 0) to indicate an unlimited number of listeners.
Returns a reference to the EventEmitter, so that calls can be chained.
<WritableStream><this>chunk{string|Uint8Array} encoding{BufferEncoding}- Returns: {void}
<ReadableStream><this>Call Signature
Call Signature
<boolean><string>end{SourcePosition}index<number>start{SourcePosition}
path{PathLikeFs}options{EncodingOption}callback<object>- Returns: {void}
path{PathLikeFs}options{BufferEncodingOption}callback<object>- Returns: {void}
path{PathLikeFs}options{EncodingOption}callback<object>- Returns: {void}
path{PathLikeFs}callback<object>- Returns: {void}
path{PathLikeFs}options{EncodingOption}- Returns:
<string>
path{PathLikeFs}options{BufferEncodingOption}- Returns: {Buffer}
path{PathLikeFs}options{EncodingOption}- Returns: {string|Buffer
}
path{PathLikeTypes}options{EncodingOption}callback<object>- Returns: {void}
path{PathLikeTypes}options{BufferEncodingOption}callback<object>- Returns: {void}
path{PathLikeTypes}options{EncodingOption}callback<object>- Returns: {void}
path{PathLikeTypes}callback<object>- Returns: {void}
byName{Record<string, number>}bySource{Record<string, number>}usedIds<number[]>
byIdentifier{Record<string, number>}usedIds<number[]>
<boolean><string[]>- {BaseNode}.{BaseExpression}
<Comment[]><null><string><object><Comment[]>Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
<string>
|
<string[]><string>Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
[index: {string}]<string>|<string[]>
<Chunk><ChunkGraph><CodeGenerationResults><string><ModuleGraph><RuntimeTemplate>
](
<Chunk><ChunkGraph><CodeGenerationResults><CssModule[]>
](
<RuntimeTemplate>
](
<string><string><Chunk><ChunkGraph><CodeGenerationResults><DependencyTemplates>
](
<ModuleGraph><RuntimeTemplate>
](
<boolean><boolean><TemplatePath><string><string><AssetInfo><PathData><object>[index: {string}]<string>|<string[]>
directories{Set} list of directories files{Set} list of files missing{Set} list of missing entries resolveDependencies{ResolveDependencies} dependencies of the resolvingresolveResults{Map<string, string|false|undefined>} stored resolve results
contextDependencies{WriteOnlySet} directories that was found on file system fileDependencies{WriteOnlySet} files that was found on file system log<object>log functionmissingDependencies{WriteOnlySet} dependencies that was not found on file system stack{Set} set of hooks' calls. For instance, resolve → parsedResolve → describedResolve,yield<object>yield result, if provided plugins can return several results
directories{Set} list of directories files{Set} list of files missing{Set} list of missing entries
platform{false|PlatformTargetProperties} - platform target properties
alias{AliasOption[]} aliasaliasFields{Set<string|string[]>} alias fieldscachePredicate<object>cache predicatecacheWithContext<boolean>cache with contextconditionNames{Set} A list of exports field condition names. descriptionFiles<string[]>description filesenforceExtension<boolean>enforce extensionexportsFields{Set<string|string[]>} exports fieldsextensionAlias{ExtensionAliasOption[]} extension aliasextensions{Set} extensions fallback{AliasOption[]} fallbackfileSystem<FileSystem>fileSystemfullySpecified<boolean>fully specifiedimportsFields{Set<string|string[]>} imports fieldsmainFields<object[]>main fieldsmainFiles{Set} main files modules<string>modulesplugins<Plugin[]>pluginspnpApi<null>pnp APIpreferAbsolute<boolean>prefer absolutepreferRelative<boolean>prefer relativeresolver<Resolver>resolverresolveToContext<boolean>resolve to contextrestrictions{Set<string|RegExp>} restrictionsroots{Set} roots symlinks<boolean>symlinkstsconfig<string>|<boolean>tsconfig file path or config objectunsafeCache{false|CacheTypes} unsafe cache
alias{AliasOption[]|AliasOptions} A list of module alias configurations or an object which maps key to valuealiasFields<string>A list of alias fields in description filescachePredicate<object>A function which decides whether a request should be cached or not. An object is passed with at leastpathandrequestproperties.cacheWithContext<boolean>Whether or not the unsafeCache should include request context as part of the cache key.conditionNames<string[]>A list of exports field condition names.descriptionFiles<string[]>A list of description files to read fromenforceExtension<boolean>Enforce that a extension from extensions must be usedexportsFields<string>A list of exports fields in description filesextensionAlias{ExtensionAliasOptions} An object which maps extension to extension aliasesextensions<string[]>A list of extensions which should be tried for filesfallback{AliasOption[]|AliasOptions} A list of module alias configurations or an object which maps key to value, applied only after modules optionfileSystem<FileSystem>The file system which should be usedfullySpecified<boolean>The request is already fully specified and no extensions or directories are resolved for itimportsFields<string>A list of imports fields in description filesmainFields<string>|<string[]>|<object[]>A list of main fields in description filesmainFiles<string[]>A list of main files in directoriesmodules<string>|<string[]>A list of directories to resolve modules from, can be absolute path or folder nameplugins<Plugin[]>A list of additional resolve plugins which should be appliedpnpApi<null>A PnP API that should be used - null is "never", undefined is "auto"preferAbsolute<boolean>Prefer to resolve server-relative urls as absolute paths before falling back to resolve in rootspreferRelative<boolean>Prefer to resolve module requests as relative requests before falling back to modulesresolver<Resolver>A prepared Resolver to which the plugins are attachedresolveToContext<boolean>Resolve to a context instead of a filerestrictions<string>|<RegExp[]>A list of resolve restrictionsroots<string[]>A list of root pathssymlinks<boolean>Resolve symlinks to their symlinked locationtsconfig<string>|<boolean>TypeScript config file path or config object with configFile and referencesunsafeCache<boolean>Use this cache object to unsafely cache the successful requestsuseSyncFileSystemCalls<boolean>Use only the sync constraints of the file system calls
direct{WeakMap<ResolveOptionsWithDependencyType, ResolverWithOptions>}stringified{Map<string, ResolverWithOptions>}
- {BasePattern}
argument{Pattern}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"RestElement"}
argument{Pattern}end<number>loc<null>range{Tuple<number, number>}start<number>type{"RestElement"}
- {BaseStatement}
<null><Comment[]><null><Comment[]>- {Algorithm}
hash{AlgorithmIdentifier}name<string>
<object>Logic operators used in a condition matcher.
Logic operators used in a condition matcher.
<string>
|
<RegExp>
|
<RuleSetConditionAbsolute[]>
|
<object><ChunkGraph><CodeGenerationResults><string[]><string[]><string[]><string[]>- {_SchemaObject}
[x: {string}]<any>
Helper function for joining two ranges into a single range. This is useful when working with AST nodes, as it allows you to combine the ranges of child nodes to create the range of the parent node.
definitions{StackedMap<string, VariableInfo|ScopeInfo>}inShorthand<string>|<boolean>inTaggedTemplateTag<boolean>inTry<boolean>isAsmJs<boolean>isStrict<boolean>terminated{2|1}topLevelScope<boolean>
<any>- {TlsOptions}
- {TLSSocketOptions}
<boolean><object>servername
and
protocols
fields,
respectively containing the server name from the SNI extension (if any) and an array of
ALPN protocol name strings. The callback must return either one of the strings listed in
protocols
,
which will be returned to the client as the selected ALPN protocol, or
undefined
,
to reject the connection with a fatal alert. If a string is returned that does not match one of
the client's ALPN protocols, an error will be thrown.
This option cannot be used with the
ALPNProtocols
option, and setting both options will throw an error.<string><string>'auto'
or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy.
If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available.
ECDHE-based perfect forward secrecy will still be available.<string><boolean>'TLSv1.3'
,
'TLSv1.2'
,
'TLSv1.1'
, or
'TLSv1'
. Cannot be specified along with the
secureProtocol
option, use one or the other.
Default:
'TLSv1.3'
, unless changed using CLI options. Using
--tls-max-v1.2
sets the default to
'TLSv1.2'
. Using
--tls-max-v1.3
sets the default to
'TLSv1.3'
. If multiple of the options are provided, the highest maximum is used.'TLSv1.3'
,
'TLSv1.2'
,
'TLSv1.1'
, or
'TLSv1'
. Cannot be specified along with the
secureProtocol
option, use one or the other. It is not recommended to use
less than TLSv1.2, but it may be required for interoperability.
Default:
'TLSv1.2'
, unless changed using CLI options. Using
--tls-v1.0
sets the default to
'TLSv1'
. Using
--tls-v1.1
sets the default to
'TLSv1.1'
. Using
--tls-min-v1.3
sets the default to
'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.<string><string><string><number><string><string><number><string>input{A}- Returns:
<null>|<undefined>
- {BaseExpression}
expressions{Expression[]}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"SequenceExpression"}
- {ServerEventMap}
- {ServerEventMap}
checkContinue{Tuple<request, response>}checkExpectation{Tuple<request, response>}clientError{Tuple<exception, socket>}close{Tuple} connect{Tuple<request, socket, head>}connection{Tuple} drop{Tuple}dropRequest{Tuple<request, socket>}error{Tuple} listening{Tuple} request{Tuple<request, response>}upgrade{Tuple<req, socket, head>}
- {ServerEventMap<Request, Response>}.{ServerEventMap}
checkContinue{Tuple<request, response>}checkExpectation{Tuple<request, response>}clientError{Tuple<exception, socket>}close{Tuple} connect{Tuple<request, socket, head>}connection{Tuple} drop{Tuple}dropRequest{Tuple<request, socket>}error{Tuple} keylog{Tuple<line, tlsSocket>}listening{Tuple} newSession{Tuple<sessionId, sessionData, callback>}OCSPRequest{Tuple<certificate, issuer, callback>}request{Tuple<request, response>}resumeSession{Tuple<sessionId, callback>}secureConnection{Tuple} tlsClientError{Tuple<exception, tlsSocket>}upgrade{Tuple<req, socket, head>}
- {ServerEventMap}
- {ServerEventMap}
close{Tuple} connection{Tuple} drop{Tuple}error{Tuple} listening{Tuple}
- {ServerEventMap}
- {ServerEventMap}
close{Tuple} connection{Tuple} drop{Tuple}error{Tuple} keylog{Tuple<line, tlsSocket>}listening{Tuple} newSession{Tuple<sessionId, sessionData, callback>}OCSPRequest{Tuple<certificate, issuer, callback>}resumeSession{Tuple<sessionId, callback>}secureConnection{Tuple} tlsClientError{Tuple<exception, tlsSocket>}
- {ServerOptions}
<number><number><number>socket
s'
readableHighWaterMark
and
writableHighWaterMark
.
This affects
highWaterMark
property of both
IncomingMessage
and
ServerResponse
.
Default:<Request>IncomingMessage
class to be used. Useful for extending the original
IncomingMessage
.<boolean>true
.
Using the insecure parser should be avoided.
See --insecure-http-parser for more information.<boolean>,
instead of discarding the duplicates.<boolean>true
, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
similarly on what is done in
socket.setKeepAlive([enable][, initialDelay])
.<number><number><number>server.keepAliveTimeout
to extend the internal socket timeout.<number>--max-http-header-size
for requests received by
this server, i.e. the maximum length of request headers in bytes.<boolean>true
, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.<boolean>true
, requests without
Content-Length
or
Transfer-Encoding
headers (indicating no body) will be initialized with an
already-ended body stream, so they will never emit any stream events
(like
'data'
or
'end'
). You can use
req.readableEnded
to detect this case.<boolean>true
, an error is thrown when writing to an HTTP response which does not have a body.<number><boolean>true
, it forces the server to respond with a 400 (Bad Request) status code
to any HTTP/1.1 request message that lacks a Host header (as mandated by the specification).<Response>ServerResponse
class to be used. Useful for extending the original
ServerResponse
.<object>'upgrade'
event (or
their sockets will be destroyed, if no listener is registered) while
rejected upgrades will fire a
'request'
event like any non-upgrade
request.<string>;
.- {ServerOptions<Request, Response>}.{TlsOptions}
<boolean><boolean><object>servername
and
protocols
fields,
respectively containing the server name from the SNI extension (if any) and an array of
ALPN protocol name strings. The callback must return either one of the strings listed in
protocols
,
which will be returned to the client as the selected ALPN protocol, or
undefined
,
to reject the connection with a fatal alert. If a string is returned that does not match one of
the client's ALPN protocols, an error will be thrown.
This option cannot be used with the
ALPNProtocols
option, and setting both options will throw an error.Buffer
,
TypedArray
, or
DataView
containing the supported
ALPN protocols. Buffers should have the format
[len][name][len][name]...
e.g.
'\x08http/1.1\x08http/1.0'
, where the
len
byte is the length of the
next protocol name. Passing an array is usually much simpler, e.g.
['http/1.1', 'http/1.0']
. Protocols earlier in the list have higher
preference than those later.<BlockList>
](
blockList
can be used for disabling inbound
access to specific IP addresses, IP ranges, or IP subnets. This does not
work if the server is behind a reverse proxy, NAT, etc. because the address
checked against the block list is the address of the proxy, or the one
specified by the NAT.<string><string><number>'auto'
or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy.
If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available.
ECDHE-based perfect forward secrecy will still be available.<string><boolean>stderr
. This can be
used to debug TLS connection problems.<number><number><number>socket
s'
readableHighWaterMark
and
writableHighWaterMark
.
This affects
highWaterMark
property of both
IncomingMessage
and
ServerResponse
.
Default:<boolean><Request>IncomingMessage
class to be used. Useful for extending the original
IncomingMessage
.<boolean>true
.
Using the insecure parser should be avoided.
See --insecure-http-parser for more information.<boolean>,
instead of discarding the duplicates.<boolean>true
, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
similarly on what is done in
socket.setKeepAlive([enable][, initialDelay])
.<number><number><number>server.keepAliveTimeout
to extend the internal socket timeout.<number>--max-http-header-size
for requests received by
this server, i.e. the maximum length of request headers in bytes.'TLSv1.3'
,
'TLSv1.2'
,
'TLSv1.1'
, or
'TLSv1'
. Cannot be specified along with the
secureProtocol
option, use one or the other.
Default:
'TLSv1.3'
, unless changed using CLI options. Using
--tls-max-v1.2
sets the default to
'TLSv1.2'
. Using
--tls-max-v1.3
sets the default to
'TLSv1.3'
. If multiple of the options are provided, the highest maximum is used.'TLSv1.3'
,
'TLSv1.2'
,
'TLSv1.1'
, or
'TLSv1'
. Cannot be specified along with the
secureProtocol
option, use one or the other. It is not recommended to use
less than TLSv1.2, but it may be required for interoperability.
Default:
'TLSv1.2'
, unless changed using CLI options. Using
--tls-v1.0
sets the default to
'TLSv1'
. Using
--tls-v1.1
sets the default to
'TLSv1.1'
. Using
--tls-min-v1.3
sets the default to
'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.<boolean>true
, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.<boolean>true
, requests without
Content-Length
or
Transfer-Encoding
headers (indicating no body) will be initialized with an
already-ended body stream, so they will never emit any stream events
(like
'data'
or
'end'
). You can use
req.readableEnded
to detect this case.<string><boolean><string><string><object><string>tlsClientError
will be
emitted with
ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED
code.<boolean>true
, an error is thrown when writing to an HTTP response which does not have a body.<boolean><boolean><boolean><number><boolean>true
, it forces the server to respond with a 400 (Bad Request) status code
to any HTTP/1.1 request message that lacks a Host header (as mandated by the specification).<number><string><Response>ServerResponse
class to be used. Useful for extending the original
ServerResponse
.<string><number><object>'upgrade'
event (or
their sockets will be destroyed, if no listener is registered) while
rejected upgrades will fire a
'request'
event like any non-upgrade
request.<string><object><string>;
.- {TlsOptions}
<boolean><BlockList>
](
blockList
can be used for disabling inbound
access to specific IP addresses, IP ranges, or IP subnets. This does not
work if the server is behind a reverse proxy, NAT, etc. because the address
checked against the block list is the address of the proxy, or the one
specified by the NAT.<number>net.Socket
s'
readableHighWaterMark
and
writableHighWaterMark
.<boolean>true
, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
similarly on what is done in
socket.setKeepAlive([enable][, initialDelay])
.<number><boolean>true
, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.<boolean>- {IteratorObject<T, undefined>}
__namedParameters{Tuple|Tuple } - Returns: {IteratorResult<T, undefined>}
<undefined><any>- {IteratorObject<T, BuiltinIteratorReturn, unknown>}
[toStringTag]<string>
<number>Creates an iterator whose values are the values from this iterator after skipping the provided count.
<object><boolean>Determines whether all the members of this iterator satisfy the specified test.
Call Signature
<object>Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
Call Signature
<object>Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
Call Signature
<object><undefined>Returns the value of the first element in this iterator where predicate is true, and undefined otherwise.
Call Signature
<object><undefined><object>Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.
<object>Performs the specified action for each element in the iterator.
<object>Creates an iterator whose values are the result of applying the callback to the values from this iterator.
__namedParameters{Tuple|Tuple } - Returns: {IteratorResult<T, undefined>}
Call Signature
<object>Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Call Signature
<object>Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
<undefined><object><boolean>Determines whether the specified callback function returns true for any element of this iterator.
<number>Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.
<any>Creates a new array from the values yielded by this iterator.
Advanced configuration for modules that should be shared in the share scope.
<boolean><string><string><string><string><string><boolean><boolean><string>Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
[index: {string}]<string>
Options for shared modules.
shared{Shared} Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.shareScope<string>Share scope name used for all shared modules (defaults to 'default').
- {BaseCallExpression}
arguments{Expression|SpreadElement[]}callee{Expression|Super}leadingComments<Comment[]>loc<null>optional<boolean>range{Tuple<number, number>}trailingComments<Comment[]>type{"CallExpression"}
- {BaseNode}.{BaseExpression}
<Comment[]><null><string><Comment[]>Options affecting how file system snapshots are created and validated.
<object><object><string>
|
<RegExp[]><string>
|
<RegExp[]><object><object><object><string>
|
<RegExp[]>Construct a type with the properties of T except for those in type K.
- {Omit[
<<stream.DuplexEventMap, "close">>](<stream.html#class-streamduplexeventmap-close)}
- {TLSSocketEventMap}
close{Tuple} connect{Tuple} connectionAttempt{Tuple<ip, port, family>}connectionAttemptFailed{Tuple<ip, port, family, error>}connectionAttemptTimeout{Tuple<ip, port, family>}data{Tuple}drain{Tuple} end{Tuple} error{Tuple} finish{Tuple} lookup{Tuple<err, address, family, host>}pause{Tuple} pipe{Tuple} readable{Tuple} ready{Tuple} resume{Tuple} timeout{Tuple} unpipe{Tuple}
a{T}b{T}- Returns:
<number>
<null><boolean><boolean><string><boolean><string><boolean><string><string><string><object><string[]><object><object><boolean><number><number><number><boolean>[index: {string}]<number>
- {BaseNode}
argument{Expression}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"SpreadElement"}
argument{Expression}end<number>loc<null>range{Tuple<number, number>}start<number>type{"SpreadElement"}
<Chunk><ChunkGraph><CodeGenerationResults><DependencyTemplates>
](
<boolean><boolean><ModuleGraph><boolean><RuntimeTemplate>
](
<boolean>path{PathLikeFs}callback<object>- Returns: {void}
path{PathLikeFs}options<object>|<undefined>callback<object>- Returns: {void}
path{PathLikeFs}options<undefined>callback<object>- Returns: {void}
Construct a type with the properties of T except for those in type K.
- {Omit<BlockStatement, "type">}
body{Statement[]}innerComments<Comment[]>leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"StaticBlock"}
body{Statement[]}end<number>loc<null>range{Tuple<number, number>}start<number>type{"StaticBlock"}
<boolean>extract{HookMap<SyncBailHook<Tuple<any, any, StatsFactoryContext>, void, UnsetAdditionalOptions>>}filter{HookMap<SyncBailHook<Tuple<any, StatsFactoryContext, number, number>, boolean|void, UnsetAdditionalOptions>>}filterResults{HookMap<SyncBailHook<Tuple<any, StatsFactoryContext, number, number>, boolean|void, UnsetAdditionalOptions>>}filterSorted{HookMap<SyncBailHook<Tuple<any, StatsFactoryContext, number, number>, boolean|void, UnsetAdditionalOptions>>}getItemFactory{HookMap<SyncBailHook<Tuple<any, StatsFactoryContext>, void|StatsFactory, UnsetAdditionalOptions>>}getItemName{HookMap<SyncBailHook<Tuple<any, StatsFactoryContext>, string|void, UnsetAdditionalOptions>>}groupResults{HookMap<SyncBailHook<Tuple<GroupConfig<any, any>[], StatsFactoryContext>, void, UnsetAdditionalOptions>>}merge{HookMap<SyncBailHook<Tuple<any[], StatsFactoryContext>, any, UnsetAdditionalOptions>>}result{HookMap<SyncBailHook<Tuple<any, StatsFactoryContext>, any, UnsetAdditionalOptions>>}sort{HookMap<SyncBailHook<Tuple<object[], StatsFactoryContext>, void, UnsetAdditionalOptions>>}sortResults{HookMap<SyncBailHook<Tuple<object[], StatsFactoryContext>, void, UnsetAdditionalOptions>>}
getItemName{HookMap<SyncBailHook<Tuple<any, StatsPrinterContext>, string|void, UnsetAdditionalOptions>>}print{HookMap<SyncBailHook<Tuple<any, StatsPrinterContext>, string|void|undefined, UnsetAdditionalOptions>>}printElements{HookMap<SyncBailHook<Tuple<PrintedElement[], StatsPrinterContext>, string|void|undefined, UnsetAdditionalOptions>>}printItems{HookMap<SyncBailHook<Tuple<string[], StatsPrinterContext>, string|undefined, UnsetAdditionalOptions>>}result{HookMap<SyncWaterfallHook<Tuple<string, StatsPrinterContext>, string, UnsetAdditionalOptions>>}sortElements{HookMap<SyncBailHook<Tuple<string[], StatsPrinterContext>, void, UnsetAdditionalOptions>>}sortItems{HookMap<SyncBailHook<Tuple<any[], StatsPrinterContext>, boolean|void, UnsetAdditionalOptions>>}
path{PathLikeFs}options<undefined>- Returns: {IStats}
path{PathLikeFs}options<object>- Returns:
<undefined>
path{PathLikeFs}options<object>- Returns:
<undefined>
path{PathLikeFs}options<object>- Returns: {IStats}
path{PathLikeFs}options<object>- Returns: {IBigIntStats}
path{PathLikeFs}options<object>- Returns: {IStats|IBigIntStats}
path{PathLikeFs}options{StatSyncOptions}- Returns:
<undefined>
path{PathLikeTypes}callback<object>- Returns: {void}
path{PathLikeTypes}options<object>|<undefined>callback<object>- Returns: {void}
path{PathLikeTypes}options<undefined>callback<object>- Returns: {void}
<object>- {BaseNode}
<Comment[]><null><Comment[]>- {BaseNode}
consequent{Statement[]}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}test<null>trailingComments<Comment[]>type{"SwitchCase"}
consequent{Statement[]}end<number>loc<null>range{Tuple<number, number>}start<number>test<null>type{"SwitchCase"}
- {BaseStatement}
cases{SwitchCase[]}discriminant{Expression}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"SwitchStatement"}
cases{SwitchCase[]}discriminant{Expression}end<number>loc<null>range{Tuple<number, number>}start<number>type{"SwitchStatement"}
format{"buffer"}
- {BaseExpression}
<Comment[]><null><Comment[]>data{Record<string, any>|TopLevelSymbol|HarmonySettings|ImportSettings|CommonJsImportSettings|CompatibilitySettings|HarmonySpecifierGuards}next{TagInfo}tag<symbol>
- {BaseNode}
<Comment[]><null><boolean><Comment[]><object>- {BaseExpression}
expressions{Expression[]}leadingComments<Comment[]>loc<null>quasis{TemplateElement[]}range{Tuple<number, number>}trailingComments<Comment[]>type{"TemplateLiteral"}
- {BaseExpression}
<Comment[]><null><Comment[]>- {BaseStatement}
argument{Expression}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"ThrowStatement"}
argument{Expression}end<number>loc<null>range{Tuple<number, number>}start<number>type{"ThrowStatement"}
- {SecureContextOptions}.{CommonConnectionOptions}.{ServerOpts}
- {ServerOptions}
<boolean><boolean><object>servername
and
protocols
fields,
respectively containing the server name from the SNI extension (if any) and an array of
ALPN protocol name strings. The callback must return either one of the strings listed in
protocols
,
which will be returned to the client as the selected ALPN protocol, or
undefined
,
to reject the connection with a fatal alert. If a string is returned that does not match one of
the client's ALPN protocols, an error will be thrown.
This option cannot be used with the
ALPNProtocols
option, and setting both options will throw an error.Buffer
,
TypedArray
, or
DataView
containing the supported
ALPN protocols. Buffers should have the format
[len][name][len][name]...
e.g.
'\x08http/1.1\x08http/1.0'
, where the
len
byte is the length of the
next protocol name. Passing an array is usually much simpler, e.g.
['http/1.1', 'http/1.0']
. Protocols earlier in the list have higher
preference than those later.<BlockList>
](
blockList
can be used for disabling inbound
access to specific IP addresses, IP ranges, or IP subnets. This does not
work if the server is behind a reverse proxy, NAT, etc. because the address
checked against the block list is the address of the proxy, or the one
specified by the NAT.<string><string>'auto'
or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy.
If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available.
ECDHE-based perfect forward secrecy will still be available.<string><boolean>stderr
. This can be
used to debug TLS connection problems.<number><number>net.Socket
s'
readableHighWaterMark
and
writableHighWaterMark
.<boolean><boolean>true
, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
similarly on what is done in
socket.setKeepAlive([enable][, initialDelay])
.<number>'TLSv1.3'
,
'TLSv1.2'
,
'TLSv1.1'
, or
'TLSv1'
. Cannot be specified along with the
secureProtocol
option, use one or the other.
Default:
'TLSv1.3'
, unless changed using CLI options. Using
--tls-max-v1.2
sets the default to
'TLSv1.2'
. Using
--tls-max-v1.3
sets the default to
'TLSv1.3'
. If multiple of the options are provided, the highest maximum is used.'TLSv1.3'
,
'TLSv1.2'
,
'TLSv1.1'
, or
'TLSv1'
. Cannot be specified along with the
secureProtocol
option, use one or the other. It is not recommended to use
less than TLSv1.2, but it may be required for interoperability.
Default:
'TLSv1.2'
, unless changed using CLI options. Using
--tls-v1.0
sets the default to
'TLSv1'
. Using
--tls-v1.1
sets the default to
'TLSv1.1'
. Using
--tls-min-v1.3
sets the default to
'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.<boolean>true
, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.<string><boolean><string><string><object><string>tlsClientError
will be
emitted with
ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED
code.<boolean><boolean><boolean><number><string><string><number><string><object>Construct a type with the properties of T except for those in type K.
- {SocketEventMap}
close{Tuple} connect{Tuple} connectionAttempt{Tuple<ip, port, family>}connectionAttemptFailed{Tuple<ip, port, family, error>}connectionAttemptTimeout{Tuple<ip, port, family>}data{Tuple}drain{Tuple} end{Tuple} error{Tuple} finish{Tuple} keylog{Tuple} lookup{Tuple<err, address, family, host>}OCSPResponse{Tuple} pause{Tuple} pipe{Tuple} readable{Tuple} ready{Tuple} resume{Tuple} secure{Tuple} secureConnect{Tuple} session{Tuple} timeout{Tuple} unpipe{Tuple}
- {SecureContextOptions}.{CommonConnectionOptions}
<boolean><object>servername
and
protocols
fields,
respectively containing the server name from the SNI extension (if any) and an array of
ALPN protocol name strings. The callback must return either one of the strings listed in
protocols
,
which will be returned to the client as the selected ALPN protocol, or
undefined
,
to reject the connection with a fatal alert. If a string is returned that does not match one of
the client's ALPN protocols, an error will be thrown.
This option cannot be used with the
ALPNProtocols
option, and setting both options will throw an error.Buffer
,
TypedArray
, or
DataView
containing the supported
ALPN protocols. Buffers should have the format
[len][name][len][name]...
e.g.
'\x08http/1.1\x08http/1.0'
, where the
len
byte is the length of the
next protocol name. Passing an array is usually much simpler, e.g.
['http/1.1', 'http/1.0']
. Protocols earlier in the list have higher
preference than those later.<string><string>'auto'
or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy.
If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available.
ECDHE-based perfect forward secrecy will still be available.<string><boolean>stderr
. This can be
used to debug TLS connection problems.<boolean><boolean>'TLSv1.3'
,
'TLSv1.2'
,
'TLSv1.1'
, or
'TLSv1'
. Cannot be specified along with the
secureProtocol
option, use one or the other.
Default:
'TLSv1.3'
, unless changed using CLI options. Using
--tls-max-v1.2
sets the default to
'TLSv1.2'
. Using
--tls-max-v1.3
sets the default to
'TLSv1.3'
. If multiple of the options are provided, the highest maximum is used.'TLSv1.3'
,
'TLSv1.2'
,
'TLSv1.1'
, or
'TLSv1'
. Cannot be specified along with the
secureProtocol
option, use one or the other. It is not recommended to use
less than TLSv1.2, but it may be required for interoperability.
Default:
'TLSv1.2'
, unless changed using CLI options. Using
--tls-v1.0
sets the default to
'TLSv1'
. Using
--tls-v1.1
sets the default to
'TLSv1.1'
. Using
--tls-min-v1.3
sets the default to
'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.<string><string><string><boolean><boolean><boolean><number><string><Server>
](
<string><number><string><object>cancel{TransformerCancelCallback}flush{TransformerFlushCallback} readableType<undefined>start{TransformerStartCallback} transform{TransformerTransformCallback<I, O>}writableType<undefined>
<any>controller{TransformStreamDefaultController} - Returns: {void|PromiseLike
}
controller{TransformStreamDefaultController} - Returns:
<any>
chunk{I}controller{TransformStreamDefaultController} - Returns: {void|PromiseLike
}
readable{ReadableStream} writable{WritableStream}
chunk{O}- Returns: {void}
<any>Use a Trusted Types policy to create urls for chunks.
onPolicyCreationFailure{"continue"|"stop"} If the call totrustedTypes.createPolicy(...)fails -- e.g., due to the policy name missing from the CSPtrusted-typeslist, or it being a duplicate name, etc. -- controls whether to continue with loading in the hope thatrequire-trusted-types-for 'script'isn't enforced yet, versus fail immediately. Default behavior is 'stop'.policyName<string>The name of the Trusted Types policy created by webpack to serve bundle chunks.
- {BaseStatement}
block{BlockStatement}finalizer<null>handler<null>leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"TryStatement"}
block{BlockStatement}end<number>finalizer<null>handler<null>loc<null>range{Tuple<number, number>}start<number>type{"TryStatement"}
<string><string><string[]>alias{AliasOption[]} tsconfig file datamodules<string[]>tsconfig file data
- {BaseExpression}
argument{Expression}leadingComments<Comment[]>loc<null>operator{UnaryOperator}prefix{true}range{Tuple<number, number>}trailingComments<Comment[]>type{"UnaryExpression"}
argument{Expression}end<number>loc<null>operator{UnaryOperator}prefix<boolean>range{Tuple<number, number>}start<number>type{"UnaryExpression"}
cancel{UnderlyingSourceCancelCallback}pull<object>start<object>type<undefined>
abort{UnderlyingSinkAbortCallback}close{UnderlyingSinkCloseCallback}start{UnderlyingSinkStartCallback}type<undefined>write{UnderlyingSinkWriteCallback}
<any><WritableStreamDefaultController><any>chunk{W}controller<WritableStreamDefaultController>- Returns: {void|PromiseLike
}
<number><any>controller{ReadableStreamController} - Returns: {void|PromiseLike
}
controller{ReadableStreamController} - Returns:
<any>
- {BaseExpression}
argument{Expression}leadingComments<Comment[]>loc<null>operator{UpdateOperator}prefix<boolean>range{Tuple<number, number>}trailingComments<Comment[]>type{"UpdateExpression"}
argument{Expression}end<number>loc<null>operator{UpdateOperator}prefix<boolean>range{Tuple<number, number>}start<number>type{"UpdateExpression"}
<ChunkGraph><RuntimeTemplate>
](
<ChunkGraph><NormalModule><RuntimeTemplate>
](
- {URL_url}
<string><string><number><string><string><string[]><boolean>- {Iterator[
<<T, NodeJS.BuiltinIteratorReturn, unknown>>](<T, NodeJS.html#class-t-nodejsbuiltiniteratorreturn-unknown)}
[toStringTag]<string>
<number>Creates an iterator whose values are the values from this iterator after skipping the provided count.
<object><boolean>Determines whether all the members of this iterator satisfy the specified test.
Call Signature
<object>Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
Call Signature
<object>Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
Call Signature
<object><undefined>Returns the value of the first element in this iterator where predicate is true, and undefined otherwise.
Call Signature
<object><undefined><object>Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.
<object>Performs the specified action for each element in the iterator.
<object>Creates an iterator whose values are the result of applying the callback to the values from this iterator.
__namedParameters{Tuple|Tuple } - Returns: {IteratorResult<T, undefined>}
Call Signature
<object>Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Call Signature
<object>Call Signature
<object>Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
<undefined><object><boolean>Determines whether the specified callback function returns true for any element of this iterator.
<number>Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.
<any>Creates a new array from the values yielded by this iterator.
[index: {string}]{Value[]}
- {BaseDeclaration}
declarations{VariableDeclarator[]}kind{"const"|"var"|"let"|"using"|"await using"}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"VariableDeclaration"}
declarations{VariableDeclarator[]}end<number>kind{"const"|"var"|"let"|"using"|"await using"}loc<null>range{Tuple<number, number>}start<number>type{"VariableDeclaration"}
- {BaseNode}
id{Pattern}init<null>leadingComments<Comment[]>loc<null>range{Tuple<number, number>}trailingComments<Comment[]>type{"VariableDeclarator"}
A virtual module definition.
[index: {string}]{VirtualModuleContent}
Options for building virtual resources.
<object><object><object><object><object><object><object>changes{Set|null} get current aggregated changes that have not yet send to callback contextTimeInfoEntries{Map<string, "ignore"|EntryTypesIndex|OnlySafeTimeEntry|ExistenceOnlyTimeEntryTypesIndex|null>} get info about directoriesfileTimeInfoEntries{Map<string, "ignore"|EntryTypesIndex|OnlySafeTimeEntry|ExistenceOnlyTimeEntryTypesIndex|null>} get info about filesremovals{Set|null} get current aggregated removals that have not yet send to callback
<object><string>
|
<RegExp[]>Options for the watcher.
<number><boolean><string>
|
<RegExp>
|
<string[]><boolean><Chunk><ChunkGraph><CodeGenerationResults><DependencyTemplates>
](
<ModuleGraph><RuntimeTemplate>
](
<string>
|
<object[]><string><any>c{Record<string, ExecuteModuleObject>}i<object[]>
- {BaseStatement}
body{Statement}leadingComments<Comment[]>loc<null>range{Tuple<number, number>}test{Expression}trailingComments<Comment[]>type{"WhileStatement"}
body{Statement}end<number>loc<null>range{Tuple<number, number>}start<number>test{Expression}type{"WhileStatement"}
<object>- {BaseStatement}
body{Statement}leadingComments<Comment[]>loc<null>object{Expression}range{Tuple<number, number>}trailingComments<Comment[]>type{"WithStatement"}
body{Statement}end<number>loc<null>object{Expression}range{Tuple<number, number>}start<number>type{"WithStatement"}
- {StreamOptions
}
- [
<DuplexOptions>](/Stream.html#interface-duplexoptions)
- [
<EventEmitter>](/EventEmitter-1.html)
- {ReadWriteStream}
<boolean>The Symbol.for('nodejs.rejection') method is called in case a
promise rejection happens when emitting an event and
captureRejections is enabled on the emitter.
It is possible to use events.captureRejectionSymbol in
place of Symbol.for('nodejs.rejection').
import { EventEmitter, captureRejectionSymbol } from 'node:events';
class MyClass extends EventEmitter {
constructor() {
super({ captureRejections: true });
}
[captureRejectionSymbol](err, event, ...args) {
console.log('rejection happened for', event, 'with', err, ...args);
this.destroy(err);
}
destroy(err) {
// Tear the resource down here.
}
}<this>Alias for emitter.on(eventName, listener).
<boolean>Synchronously calls each of the listeners registered for the event named
eventName, in the order they were registered, passing the supplied arguments
to each.
Returns true if the event had listeners, false otherwise.
import { EventEmitter } from 'node: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 listenerCall Signature
<object><this>Call Signature
Call Signature
<this><string>
|
<symbol[]>Returns an array listing the events for which the emitter has registered listeners.
import { EventEmitter } from 'node: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) ]<number>Returns the current max listener value for the EventEmitter which is either
set by emitter.setMaxListeners(n) or defaults to
events.defaultMaxListeners.
<number>Returns the number of listeners listening for 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.
<object[]>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] ]<this>Alias for emitter.removeListener().
<this>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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.on('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a<this>Adds a one-time listener 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!');
});Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The
emitter.prependOnceListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.once('foo', () => console.log('a'));
myEE.prependOnceListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a<this>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 eventName
and listener will result in the listener being added, and called, multiple
times.
server.prependListener('connection', (stream) => {
console.log('someone connected!');
});Returns a reference to the EventEmitter, so that calls can be chained.
<this>Adds a one-time listener 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.
<object[]>Returns a copy of the array of listeners for the event named eventName,
including any wrappers (such as those created by .once()).
import { EventEmitter } from 'node:events';
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');<this>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
component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter, so that calls can be chained.
<this>Removes the specified listener from the listener array for the event named
eventName.
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
listener array. If any single listener has been added multiple times to the
listener array for the specified eventName, then removeListener() must be
called multiple times to remove each instance.
Once an event is emitted, all listeners attached to it at the
time of emitting are called in order. This implies that any
removeListener() or removeAllListeners() calls after emitting and
before the last listener finishes execution will not remove them from
emit() in progress. Subsequent events behave as expected.
import { EventEmitter } from 'node:events';
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
const callbackA = () => {
console.log('A');
myEmitter.removeListener('event', callbackB);
};
const callbackB = () => {
console.log('B');
};
myEmitter.on('event', callbackA);
myEmitter.on('event', callbackB);
// callbackA removes listener callbackB but it will still be called.
// Internal listener array at time of emit [callbackA, callbackB]
myEmitter.emit('event');
// Prints:
// A
// B
// callbackB is now removed.
// Internal listener array [callbackA]
myEmitter.emit('event');
// Prints:
// ABecause listeners are managed using an internal array, calling this will
change the position indexes of any listener registered after the listener
being removed. This will not impact the order in which listeners are called,
but it means that any copies of the listener array as returned by
the emitter.listeners() method will need to be recreated.
When a single function has been added as a handler multiple times for a single
event (as in the example below), removeListener() will remove the most
recently added instance. In the example the once('ping')
listener is removed:
import { EventEmitter } from 'node:events';
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.
<number><this>By default EventEmitters will print a warning if more than 10 listeners are
added for a particular event. This is a useful default that helps finding
memory leaks. The emitter.setMaxListeners() method allows the limit to be
modified for this specific EventEmitter instance. The value can be set to
Infinity (or 0) to indicate an unlimited number of listeners.
Returns a reference to the EventEmitter, so that calls can be chained.
Call Signature
Call Signature
<boolean><boolean><any><AbortSignal><any><any>chunk{W}- Returns: {Promise
}
file{PathOrFileDescriptorFs}data{string|ArrayBufferView} options{WriteFileOptions}callback<object>- Returns: {void}
file{PathOrFileDescriptorFs}data{string|ArrayBufferView} callback<object>- Returns: {void}
<object>- {BaseExpression}
<null><boolean><Comment[]><null><Comment[]><object><object><string>
|
<string[]><string><string><string><string>
|
<string[]><string>
|
<string[]><object><string><string>
|
<NodeJS.ArrayBufferView><NodeJS.BufferSource>
|
<Blob>
|
<string><object><ArrayBuffer>The BufferSource type from the Web IDL specification.
Defines the TReturn type used for built-in iterators produced by Array, Map, Set, and others.
This is undefined when strictBuiltInIteratorReturn is true; otherwise, this is any.
<any><null><undefined><object><any><undefined>
|
<null>
|
<string>
|
<number>
|
<bigint>
|
<boolean>
|
<Function>
|
<RegExp><object><boolean><string><object><string><object><object><object><undefined>
|
<string>Represents a variable definition.
<ESTree.Identifier><string><string[]><string><string><string>content{DllReferencePluginOptionsContent} The mappings from request to module info.context<string>Context of requests in the manifest (or content property) as absolute path.extensions<string[]>Extensions used to resolve modules in the dll bundle (only used when using 'scope').name<string>The name where the dll is exposed (external name).scope<string>Prefix which is used for accessing the content of the dll.sourceType{"var"|"assign"|"this"|"window"|"global"|"commonjs"|"commonjs2"|"commonjs-module"|"amd"|"amd-require"|"umd"|"umd2"|"jsonp"|"system"} How the dll is exposed (libraryTarget).type{"object"|"require"} The way how the export of the dll bundle is used.
<undefined>
|
<null><string>
|
<string[]><string>
|
<EntryObject>
|
<string[]><string>Exclude from T those types that are assignable to U
<string><VariableInfo>
](
<string><string>
|
<string[]><object>electron{NonNullable<undefined|boolean>}electronMain{NonNullable<undefined|boolean>}electronPreload{NonNullable<undefined|boolean>}electronRenderer{NonNullable<undefined|boolean>}node{NonNullable<undefined|boolean>}nwjs{NonNullable<undefined|boolean>}web{NonNullable<undefined|boolean>}
<object><object><Function><EntryOptions><boolean><string><Hash>
](
key{K}- Returns: {H}
<object><object><object>phase{"defer"}
<undefined>
|
<null>
|
<string><object>appendOnly{NonNullable<undefined|boolean>}colors{NonNullable<undefined|boolean>}debug{NonNullable<undefined|string|boolean|RegExp|FilterItemTypes[]|object>}level{NonNullable<undefined|"none"|"verbose"|"error"|"warn"|"info"|"log">}stream<NodeJS.WritableStream>|<object>
<null><any>Obtain the return type of a constructor function type
<undefined>
|
<null>
|
<Module><boolean>JSON Schema V6
<boolean>JSON Schema v7
Primitive type
Primitive type
<object><string>
|
<string[]><string>
|
<string[]><undefined>
|
<string><object>@types/node no longer supports
TypeScript versions earlier than 5.7.@types/node no longer supports
TypeScript versions earlier than 5.7.@types/node no longer supports
TypeScript versions earlier than 5.7.Construct a type with the properties of T except for those in type K.
<object>avoidEntryIife{NonNullable<undefined|boolean>}checkWasmTypes{NonNullable<undefined|boolean>}chunkIds{NonNullable<undefined|false|"natural"|"named"|"deterministic"|"size"|"total-size">}concatenateModules{NonNullable<undefined|boolean>}emitOnErrors{NonNullable<undefined|boolean>}flagIncludedChunks{NonNullable<undefined|boolean>}innerGraph{NonNullable<undefined|boolean>}mangleExports{NonNullable<undefined|boolean|"deterministic"|"size">}mangleWasmImports{NonNullable<undefined|boolean>}mergeDuplicateChunks{NonNullable<undefined|boolean>}minimize{NonNullable<undefined|boolean>}minimizer<object>|<WebpackPluginInstance>|<"..."[]>moduleIds{NonNullable<undefined|false|"natural"|"named"|"deterministic"|"size"|"hashed">}nodeEnv{NonNullable<undefined|string|false>}portableRecords{NonNullable<undefined|boolean>}providedExports{NonNullable<undefined|boolean>}realContentHash{NonNullable<undefined|boolean>}removeAvailableModules{NonNullable<undefined|boolean>}removeEmptyChunks{NonNullable<undefined|boolean>}runtimeChunk{NonNullable<undefined|false|object>}sideEffects{NonNullable<undefined|boolean|"flag">}splitChunks{NonNullable<undefined|false|OptimizationSplitChunksOptions>}usedExports{NonNullable<undefined|boolean|"global">}
<number>
|
<string>
|
<string[]><object>assetModuleFilename{NonNullable<undefined|string|object>}asyncChunks{NonNullable<undefined|boolean>}charset{NonNullable<undefined|boolean>}chunkFilename{NonNullable<undefined|string|object>}chunkFormat{NonNullable<undefined|string|false>}chunkLoading{NonNullable<undefined|string|false>}chunkLoadingGlobal<string>chunkLoadTimeout<number>compareBeforeEmit{NonNullable<undefined|boolean>}crossOriginLoading{NonNullable<undefined|false|"anonymous"|"use-credentials">}cssChunkFilename{NonNullable<undefined|string|object>}cssFilename{NonNullable<undefined|string|object>}devtoolNamespace<string>environment{RecursiveNonNullable} filename{NonNullable<undefined|string|object>}globalObject<string>hashDigest<string>hashDigestLength<number>hashFunction{NonNullable<undefined|string|Hash>}hotUpdateChunkFilename<string>hotUpdateGlobal<string>hotUpdateMainFilename<string>iife{NonNullable<undefined|boolean>}importFunctionName<string>importMetaName<string>module{NonNullable<undefined|boolean>}path<string>pathinfo{NonNullable<undefined|boolean|"verbose">}publicPath{NonNullable<undefined|string|object>}scriptType{NonNullable<undefined|false|"module"|"text/javascript">}sourceMapFilename<string>strictModuleErrorHandling{NonNullable<undefined|boolean>}strictModuleExceptionHandling{NonNullable<undefined|boolean>}uniqueName<string>wasmLoading{NonNullable<undefined|string|false>}webassemblyModuleFilename<string>workerChunkLoading{NonNullable<undefined|string|false>}workerPublicPath<string>workerWasmLoading{NonNullable<undefined|string|false>}
Obtain the parameters of a function type in a tuple
Make all properties in T optional
<string>From T, pick a set of properties whose keys are in the union K
<undefined>
|
<null>
|
<object>
|
<object><string><string><object><string><string>Make all properties in T readonly
<StreamOptions>
](
<object>Construct a type with a set of properties K of type T
<string>request{InstanceType} response{InstanceType|object} - Returns: {void}
Make all properties in T required
<ResolveOptions>
|
<object><Resolver><any>Obtain the return type of a function type
<string>
|
<RegExp>
|
<object>
|
<RuleSetCondition[]>data{EffectData}- Returns:
<string>|<RuleSetUseFunction>|<object>|<undefined>|<null>|<string>|<RuleSetUseFunction>|<object[]>
<object>children{ErrorObject[]}
<"TLSv1.3">
|
<"TLSv1.2">
|
<"TLSv1.1"><string><undefined>
|
<string>
|
<boolean>
|
<string[]><object><object><string>
|
<RegExp[]><string>
|
<RegExp[]><object><object><object><string>
|
<RegExp[]><string><boolean>
|
<StatsOptions><undefined>
|
<string><object><string><string>
|
<TopLevelSymbol><string>
|
<string[]><string>infrastructureLogging{InfrastructureLoggingNormalizedWithDefaults}
target{NonNullable<undefined|string|false|string[]>}
output{OutputNormalizedWithDefaults}
optimization{OptimizationNormalizedWithDefaults}
devtool{NonNullable<undefined|string|false|object[]>}
stats{NonNullable}
node{NonNullable}
profile{NonNullable<undefined|boolean>}
<number>snapshot{SnapshotNormalizedWithDefaults}
externalsPresets{ExternalsPresetsNormalizedWithDefaults}
externalsType{NonNullable<undefined|"import"|"var"|"module"|"assign"|"this"|"window"|"self"|"global"|"commonjs"|"commonjs2"|"commonjs-module"|"commonjs-static"|"amd"|"amd-require"|"umd"|"umd2"|"jsonp"|"system"|"promise"|"module-import"|"script"|"node-commonjs"|"asset"|"css-import"|"css-url">}
watch{NonNullable<undefined|boolean>}
performance{NonNullable<undefined|false|PerformanceOptions>}
recordsInputPath{NonNullable<undefined|string|false>}
recordsOutputPath{NonNullable<undefined|string|false>}
dotenv{NonNullable<undefined|boolean|DotenvPluginOptions>}
<StreamOptions>
](
<object><string>
|
<object[]>blobParts{BlobPart[]}options{BlobPropertyBag}- Returns:
<Blob>
<symbol>type{"CatchClause"|"Parameter"|"FunctionName"|"ClassName"|"Variable"|"ImportBinding"|"ImplicitGlobalVariable"} The type of definition (e.g., 'Variable', 'Parameter').name{Identifier} The identifier node of the definition.node{CatchClause|ClassDeclaration|ClassExpression|ArrowFunctionExpression|AssignmentExpression|FunctionExpression|FunctionDeclaration|ImportSpecifier|ImportDefaultSpecifier|ImportNamespaceSpecifier|ForInStatement|ForOfStatement|VariableDeclarator} The AST node where the definition occurs.parent<null>The parent node, if applicable.index<number>|<null>The index of the definition in a pattern, if applicable.kind<string>|<null>The kind of variable (e.g., 'var', 'let', 'const'), if applicable.- Returns: {Definition}
Creates a new Definition instance.
<ReadableByteStreamController>-
underlyingSource{UnderlyingByteSource} -
strategy<object> -
Returns: {ReadableStream
} -
underlyingSource{UnderlyingDefaultSource} -
strategy{QueuingStrategy} -
Returns: {ReadableStream
} -
underlyingSource{UnderlyingSource} -
strategy{QueuingStrategy} -
Returns: {ReadableStream
}
stream{ReadableStream} - Returns:
<ReadableStreamBYOBReader>
<ReadableStreamBYOBRequest>stream{ReadableStream} - Returns: {ReadableStreamDefaultReader
}
<symbol>transformer{Transformer<I, O>}writableStrategy{QueuingStrategy}readableStrategy{QueuingStrategy} - Returns: {TransformStream<I, O>}
<symbol><symbol><URL>init{string|Record<string, string>|string[][]|URLSearchParams}- Returns:
<URLSearchParams>
underlyingSink{UnderlyingSink} strategy{QueuingStrategy} - Returns: {WritableStream
}
stream{WritableStream} - Returns: {WritableStreamDefaultWriter
}
schema{Schema} schemaoptions<object>|<object[]>optionsconfiguration{ValidationErrorConfiguration} configuration- Returns: {void}
- cache
- cli
- config
- container
- css
- debug
- dependencies
- electron
- esm
- experiments
- ids
- javascript
- library
- ModuleFilenameHelpers
- node
- OptimizationStages
- optimize
- prefetch
- runtime
- RuntimeGlobals
- sharing
- sources
- util
- wasm
- web
- webworker
- AsyncDependenciesBlock
- AutomaticPrefetchPlugin
- BannerPlugin
- Cache
- Chunk
- ChunkGraph
- ChunkGroup
- CleanPlugin
- CodeGenerationResults
- Compilation
- Compiler
- ConcatenationScope
- ContextExclusionPlugin
- ContextReplacementPlugin
- DefinePlugin
- DelegatedPlugin
- Dependency
- DllPlugin
- DllReferencePlugin
- DotenvPlugin
- DynamicEntryPlugin
- EntryOptionPlugin
- EntryPlugin
- Entrypoint
- EnvironmentPlugin
- EvalDevToolModulePlugin
- EvalSourceMapDevToolPlugin
- ExternalModule
- ExternalsPlugin
- Generator
- HotModuleReplacementPlugin
- HotUpdateChunk
- IgnorePlugin
- InitFragment
- JavascriptModulesPlugin
- LibManifestPlugin
- LibraryTemplatePlugin
- LoaderOptionsPlugin
- LoaderTargetPlugin
- ManifestPlugin
- Module
- ModuleFactory
- ModuleGraph
- ModuleGraphConnection
- MultiCompiler
- MultiStats
- NoEmitOnErrorsPlugin
- NormalModule
- NormalModuleReplacementPlugin
- Parser
- PlatformPlugin
- PrefetchPlugin
- ProgressPlugin
- ProvidePlugin
- Resolver
- RuntimeModule
- SourceMapDevToolPlugin
- Stats
- Template
- WatchIgnorePlugin
- Watching
- WebpackError
- WebpackOptionsApply
- WebpackOptionsDefaulter
- WebpackOptionsValidationError
webpack.validate(configuration): void<Configuration>
|
<MultiConfiguration>webpack.validateSchema(schema, options, validationConfiguration?): voidschema{Parameters} options{Parameters} validationConfiguration{ValidationErrorConfiguration}- Returns: {void}
<string>webpack(options, callback): void<Configuration><Compiler>
|
<null><Configuration><Compiler><MultiConfiguration><MultiCompiler>
|
<null><MultiConfiguration><MultiCompiler>