Sha256: d50c31f7f55d4b7287257f7906682caa47f44e0fde32aad8b845148e9100d3b9
Contents?: true
Size: 1006 Bytes
Versions: 1
Compression:
Stored size: 1006 Bytes
Contents
/** * @license Copyright 2016 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ 'use strict'; import {createServer} from 'http'; /** * Return a random, unused port. */ export function getRandomPort(): Promise<number> { return new Promise((resolve, reject) => { const server = createServer(); server.listen(0); server.once('listening', () => { const port = server.address().port; server.close(() => resolve(port)); }); server.once('error', reject); }); }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dragonfly_chrome_headless-0.2.0 | node_modules/chrome-launcher/random-port.ts |