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

serve

Package Overview
Dependencies
Maintainers
4
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serve - npm Package Compare versions

Comparing version 10.1.1 to 10.1.2

23

bin/serve.js

@@ -9,3 +9,2 @@ #!/usr/bin/env node

const {parse} = require('url');
const dns = require('dns');
const os = require('os');

@@ -28,5 +27,6 @@

const readFile = promisify(fs.readFile);
const lookup = promisify(dns.lookup);
const compressionHandler = promisify(compression());
const interfaces = os.networkInterfaces();
const warning = (message) => chalk`{yellow WARNING:} ${message}`;

@@ -159,2 +159,13 @@ const info = (message) => chalk`{magenta INFO:} ${message}`;

const getNetworkAddress = () => {
for (const name of Object.keys(interfaces)) {
for (const interface of interfaces[name]) {
const {address, family, internal} = interface;
if (family === 'IPv4' && !internal) {
return address;
}
}
}
};
const startEndpoint = (endpoint, config, args, previous) => {

@@ -194,10 +205,6 @@ const {isTTY} = process.stdout;

const address = details.address === '::' ? 'localhost' : details.address;
const ip = getNetworkAddress();
localAddress = `http://${address}:${details.port}`;
try {
const {address: ip} = await lookup(os.hostname());
networkAddress = `http://${ip}:${details.port}`;
} catch (err) {
console.error(error(`DNS lookup failed: ${err.message}`));
}
networkAddress = `http://${ip}:${details.port}`;
}

@@ -204,0 +211,0 @@

{
"name": "serve",
"version": "10.1.1",
"version": "10.1.2",
"description": "Static file serving and directory listing",

@@ -46,5 +46,5 @@ "scripts": {

"compression": "1.7.3",
"serve-handler": "5.0.7",
"serve-handler": "5.0.8",
"update-check": "1.5.2"
}
}
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