-
Notifications
You must be signed in to change notification settings - Fork 0
Check if port is available, otherwise suggest nearby
License
imlinus/is-port-available
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
▀ █▀ █▀█ █▀█ █▀█ ▀█▀ ▄▀█ █ █ ▄▀█ ▀ █ ▄▀█ █▄▄ █ █▀█ █ ▄█ █▀▀ █▄█ █ █ █▀█ ▀▄▀ █▀█ █ █▄ █▀█ █▄█ █▄ █▄▄ Checks if port is available, otherwise suggests nearby ``` import http from 'http' import isPortAvailable from './modules/is-port-available/source/index.js' class Server { constructor () {} async init (port = 1337) { const availablePort = await isPortAvailable(port) http.listen(availablePort) } } ```
About
Check if port is available, otherwise suggest nearby