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 0.1.0 to 0.1.1

2

index.js

@@ -65,3 +65,3 @@ const fs = require('fs');

let data = find(pathname, extensions);
if (!data) return (next || notFound)(res);
if (!data) return next ? next() : notFound(res);

@@ -68,0 +68,0 @@ res.writeHead(200, data.headers);

{
"name": "sirv",
"version": "0.1.0",
"version": "0.1.1",
"description": "The optimized & lightweight middleware for serving requests to static assets",

@@ -5,0 +5,0 @@ "repository": "lukeed/sirv",

@@ -51,3 +51,3 @@ # sirv [![Build Status](https://travis-ci.org/lukeed/sirv.svg?branch=master)](https://travis-ci.org/lukeed/sirv)

For `sirv`, the `next()` callback is functionally synonymous with [`opts.onNoMatch`](#optsonnomatch); however `next()` is given priority if/when defined.
For `sirv`, the `next()` callback is functionally synonymous with [`opts.onNoMatch`](#optsonnomatch); however `next()` is given priority if/when defined and **will not** receive the `res` as an argument.

@@ -97,7 +97,7 @@ #### dir

A custom function to run if a file cannot be found for a given request. By default, `sirv` will send a basic `(404) Not found` response.
A custom function to run if a file cannot be found for a given request. <br>By default, `sirv` will send a basic `(404) Not found` response.
The function receives the current `res <ServerResponse>` as its only argument.
> **Note:** This can only be replaced if a `next` callback has been provided to the middleware; see [`sirv`](#sirvdir-opts) description.
> **Note:** This won't run if a `next` callback has been provided to the middleware; see [`sirv`](#sirvdir-opts) description.

@@ -104,0 +104,0 @@ #### opts.setHeaders

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