How to use the get-port.default function in get-port

To help you get started, we’ve selected a few get-port examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / vscode-java-test / src / runners / junit5Runner / JUnit5Runner.ts View on Github external
protected async launchTests(launchConfiguration: DebugConfiguration): Promise {
        const commandParams: string[] = [];
        if (launchConfiguration.vmArgs) {
            commandParams.push(...launchConfiguration.vmArgs);
        }

        const javaDebugPort: number = await getPort();
        if (!launchConfiguration.noDebug) {
            commandParams.push('-Xdebug', `-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${javaDebugPort}`);
        }

        if (launchConfiguration.encoding) {
            commandParams.push(`-Dfile.encoding=${launchConfiguration.encoding}`);
        }

        if (launchConfiguration.classPaths) {
            this.storagePathForCurrentSession = path.join(this.storagePath || os.tmpdir(), new Date().getTime().toString());
            commandParams.push('-cp', await classpathUtils.getClassPathString(launchConfiguration.classPaths, this.storagePathForCurrentSession));
        }

        if (launchConfiguration.mainClass) {
            commandParams.push(launchConfiguration.mainClass);
        }
github getgauge / gauge-vscode / src / execution / debug.ts View on Github external
public addDebugEnv(): Thenable {
        let env = Object.create(process.env);
        if (this.debug) {
            env.DEBUGGING = true;
            env.use_nested_specs = "false";
            env.SHOULD_BUILD_PROJECT = "true";
            return getPort.default({ port: this.debugPort }).then((port) => {
                if (this.config.getProject().isProjectLanguage(GaugeRunners.Dotnet)) {
                    env.GAUGE_CSHARP_PROJECT_CONFIG = "Debug";
                }
                if (this.config.getProject().isProjectLanguage(GaugeRunners.Java)) env.GAUGE_DEBUG_OPTS = port;
                env.DEBUG_PORT = port;
                this.debugPort = port;
                return env;
            });
        } else {
            return Promise.resolve(env);
        }
    }

get-port

Get an available port

MIT
Latest version published 8 months ago

Package Health Score

77 / 100
Full package analysis