Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

can-bind-to-host

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-bind-to-host - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

7

dist/index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc