sussudio
Version:
An unofficial VS Code Internal API
13 lines (12 loc) • 554 B
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* @returns Returns a random port between 1025 and 65535.
*/
export function randomPort() {
const min = 1025;
const max = 65535;
return min + Math.floor((max - min) * Math.random());
}