UNPKG

@fivetrandevelopers/zetasql

Version:
22 lines 882 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.terminateServer = exports.runServer = void 0; const child_process_1 = require("child_process"); let childProcess; function runServer(port) { const extension = (process.arch.startsWith('arm') ? '_arm' : '') + (process.platform === 'darwin' ? '' : '.so'); return new Promise(() => { childProcess = (0, child_process_1.execFile)(`${__dirname}/zetasql/remote_server${extension}`, [ 'localhost', port.toString(), ]); childProcess.stdout?.on('data', data => process.stdout.write(data)); childProcess.stderr?.on('data', data => process.stdout.write(data)); }); } exports.runServer = runServer; function terminateServer() { childProcess.kill('SIGKILL'); } exports.terminateServer = terminateServer; //# sourceMappingURL=server.js.map