Guest User

Untitled

a guest
Dec 18th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function getPortSync (port = DEFAULT_PORT) {
  2. try {
  3. require('child_process').execSync(`lsof -i:${port}`, {encoding: 'utf-8'});
  4. return getPortSync(++port);
  5. } catch (e){
  6. return port;
  7. }
  8. }
Add Comment
Please, Sign In to add comment