microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
6e491635e08c261310d93f18da08074c210b3da2

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/common/extensionHelper.ts

14lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import * as path from "path";
5import * as fs from "fs";
6
7export function getExtensionVersion() {
8 const projectRoot = path.join(__dirname, "..", "..");
9 return JSON.parse(fs.readFileSync(path.join(projectRoot, "package.json"), "utf-8")).version;
10}
11
12export function generateRandomPortNumber() {
13 return Math.round(Math.random() * 40000 + 3000);
14}
15