Skip to content

NodeEmbeddingPlatform.CreateThreadRuntime method

Creates a new Node.js embedding runtime with a dedicated main thread.

C#
public NodeEmbeddingThreadRuntime CreateThreadRuntime(string? baseDir = null, 
    NodeEmbeddingRuntimeSettings? settings = null)
parameterdescription
baseDirOptional directory that is used as the base directory when resolving imported modules, and also as the value of the global __dirname property. If unspecified, importing modules is not enabled and __dirname is undefined.
mainScriptOptional script to run in the environment. (Literal script content, not a path to a script file.)

Return Value

A new NodeEmbeddingThreadRuntime instance.

See Also

Released under the MIT license