hdckit
Version:
A pure Node.js client for the OpenHarmony Device Connector
25 lines (24 loc) • 800 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Client_1 = __importDefault(require("./hdc/Client"));
const isNaN_1 = __importDefault(require("licia/isNaN"));
class Hdc {
static createClient(options = {}) {
const opts = {
host: options.host,
port: options.port,
bin: options.bin,
};
if (!opts.port) {
const port = parseInt(process.env.OHOS_HDC_SERVER_PORT || '8710', 10);
if (!(0, isNaN_1.default)(port)) {
opts.port = port;
}
}
return new Client_1.default(opts);
}
}
exports.default = Hdc;