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

sirv

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sirv - npm Package Compare versions

Comparing version 1.0.0-next.1 to 1.0.0-next.2

15

index.js
const fs = require('fs');
const { join, resolve } = require('path');
const list = require('totalist/sync');
const parser = require('@polka/url');

@@ -50,14 +51,2 @@ const mime = require('mime/lite');

function list(dir, fn, pre='') {
let i=0, abs, stats;
let arr = fs.readdirSync(dir);
for (; i < arr.length; i++) {
abs = join(dir, arr[i]);
stats = fs.statSync(abs);
stats.isDirectory()
? list(abs, fn, join(pre, arr[i]))
: fn(join(pre, arr[i]), abs, stats);
}
}
function send(req, res, file, stats, headers={}) {

@@ -130,3 +119,3 @@ let code=200, tmp, opts={}

list(dir, (name, abs, stats) => {
if (!opts.dotfiles && name.charAt(0) === '.') return;
if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return;

@@ -133,0 +122,0 @@ let headers = toHeaders(name, stats, isEtag);

9

package.json
{
"name": "sirv",
"version": "1.0.0-next.1",
"version": "1.0.0-next.2",
"description": "The optimized & lightweight middleware for serving requests to static assets",

@@ -19,6 +19,7 @@ "repository": "lukeed/sirv",

"dependencies": {
"@polka/url": "^1.0.0-next.3",
"mime": "^2.3.1"
"@polka/url": "^1.0.0-next.9",
"mime": "^2.3.1",
"totalist": "^1.0.0"
},
"gitHead": "88b15bc2161fec6e015f32d8fbce3c52618793e7"
"gitHead": "78f9157a13e741e11a261ac81e2975907808168a"
}
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