mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
15 lines
359 B
JavaScript
15 lines
359 B
JavaScript
const portfinder = require('portfinder')
|
|
|
|
function checkPort(port, callback) {
|
|
portfinder.getPort({ port: port, stopPort: port }, (err, res) => {
|
|
if (err !== null) {
|
|
console.error(`Port ${port} already in use`);
|
|
callback(false);
|
|
} else {
|
|
callback(true);
|
|
}
|
|
});
|
|
}
|
|
|
|
module.exports = checkPort;
|