can-bind-to-host
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -11,14 +11,13 @@ "use strict"; | ||
if (port === void 0) { port = 0; } | ||
var server = null; | ||
return new Promise(function (res) { | ||
if (port >= 0 && port <= 65535) { | ||
server = net_1.default | ||
var server_1 = net_1.default | ||
.createServer() | ||
.listen({ | ||
host: host, | ||
port: 0, | ||
port: port, | ||
}) | ||
.addListener('error', function () { return res(false); }) | ||
.addListener('listening', function () { | ||
server === null || server === void 0 ? void 0 : server.close(); | ||
server_1.close(); | ||
res(true); | ||
@@ -25,0 +24,0 @@ }); |
{ | ||
"name": "can-bind-to-host", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Utility package to see if the node process can bind to the host or listen on a port. Can be used for checking if a host resolves to localhost.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6569
54