MCPcopy Create free account
hub / github.com/DemonMartin/tlsClient / constructor

Method constructor

src/utils/client.ts:57–67  ·  view source on GitHub ↗

* @description Creates a new ModuleClient instance. * @param {ModuleClientOptions} [options] - Configuration options for the ModuleClient * @example const module = new ModuleClient(); * @example const module = new ModuleClient({ customLibraryPath: '/path/to/tls-library' });

(options?: ModuleClientOptions)

Source from the content-addressed store, hash-verified

55 * @example const module = new ModuleClient({ customLibraryPath: '/path/to/tls-library' });
56 */
57 constructor(options?: ModuleClientOptions) {
58 this.customPath = options?.customLibraryPath ? true : false;
59 this.tlsDependency = new TlsDependency();
60 this.tlsDependencyPath = this.tlsDependency.getTLSDependencyPath(options?.customLibraryDownloadPath);
61 const libPath = this.customPath ? options?.customLibraryPath : this.tlsDependencyPath?.TLS_LIB_PATH;
62 if (!libPath) {
63 throw new Error('TLS library path not available');
64 }
65 this.TLS_LIB_PATH = libPath;
66 this.maxThreads = options?.maxThreads ?? Math.max(os.cpus()?.length ?? 12, 1) * 2;
67 }
68
69 /**
70 * @description Checks if the TLS library exists.

Callers

nothing calls this directly

Calls 1

getTLSDependencyPathMethod · 0.80

Tested by

no test coverage detected