normalize-port
A handy function that normalizes a port into a number, string, or false.
install
npm install --save normalize-port
usage
const http = ;const normalizePort = ; const port = ; const server = http
credit
I just pulled this little function out of the default express-generator template.