asch-redeploy
Version:
A hassle-free local asch environment
18 lines (14 loc) • 448 B
JavaScript
let CheckPort = function (config, isPortAvailable) {
this.config = config
this.isPortAvailable = isPortAvailable
this.check = () => {
return isPortAvailable(config.node.port)
.then((status) => {
if (status === false) {
throw new Error(`port_in_use: port ${config.node.port} is is already in use. Do you have a asch-node already running?`)
}
return true
})
}
}
module.exports = CheckPort