code: async function resolvePort (port) {
    const portfinder = require('portfinder')
    portfinder.basePort = parseInt(port) || 8080
    port = await portfinder.getPortPromise()
    return port
  }
docs: Resolve port.
  
  @param {number} port user's port
  @returns {Promise<number>}