Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Feb 29, 2024 via pnpm

serve-index 1.6.4

Serve directory listings
Package summary
Share
6
issues
2
critical severity
license
2
2
high severity
vulnerability
2
2
moderate severity
vulnerability
2
3
licenses
12
MIT
2
N/A
1
ISC
Package created
5 Mar 2014
Version published
13 May 2015
Maintainers
1
Total deps
15
Direct deps
7
License
MIT

Issues

6

2 critical severity issues

critical
Recommendation: Check the package code and files for license information
via: escape-html@1.0.1
Recommendation: Check the package code and files for license information
via: debug@2.2.0
Collapse
Expand

2 high severity issues

high
Recommendation: Upgrade to version 0.6.1 or later
via: accepts@1.2.13
Recommendation: Upgrade to version 2.6.9 or later
via: debug@2.2.0
Collapse
Expand

2 moderate severity issues

moderate
Recommendation: Upgrade to version 2.6.9 or later
via: debug@2.2.0
Recommendation: Upgrade to version 2.0.0 or later
via: debug@2.2.0
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
12 Packages, Including:
accepts@1.2.13
batch@0.5.2
debug@2.2.0
http-errors@1.3.1
mime-db@1.12.0
mime-db@1.52.0
mime-types@2.0.14
mime-types@2.1.35
negotiator@0.5.3
parseurl@1.3.3
serve-index@1.6.4
statuses@1.5.0

N/A

N/A
2 Packages, Including:
escape-html@1.0.1
ms@0.7.1

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
inherits@2.0.4
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

7
All Dependencies CSV
β“˜ This is a list of serve-index 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
accepts1.2.134.7 kBMIT
prod
1
batch0.5.23.02 kBMIT
prod
debug2.2.010.05 kBMIT
prod
1
1
2
escape-html1.0.1783 BUNKNOWN
prod
1
http-errors1.3.13.42 kBMIT
prod
mime-types2.0.143.29 kBMIT
prod
parseurl1.3.33.86 kBMIT
prod

Visualizations

Frequently Asked Questions

What does serve-index do?

Serve-index is a highly useful Node.js module available through the npm registry. This potent module provides functionality to serve pages that contain directory listings for a specified path. By doing so, it provides an organized view of the files within a certain directory, making navigation much easier, particularly in larger projects.

How do you use serve-index?

To implement serve-index into your project, first, you need to install it using the npm install command npm install serve-index. Once the installation is complete, you can require it in your file with var serveIndex = require('serve-index').

Using serve-index with a vanilla Node.js HTTP server might look something like this:

var finalhandler = require('finalhandler');
var http = require('http');
var serveIndex = require('serve-index');
var serveStatic = require('serve-static');

// Serve directory indexes for the public/ftp folder (with icons)
var index = serveIndex('public/ftp', {'icons': true})

// Serve up public/ftp folder files
var serve = serveStatic('public/ftp')

// Create server
var server = http.createServer(function onRequest(req, res){
  var done = finalhandler(req, res);
  serve(req, res, function onNext(err) {
    if (err) return done(err);
    index(req, res, done);
  })
})

// Listen
server.listen(3000);

If you're using Express, this module can clean up your directory serving significantly. Here's an example of how it can look with Express:

var express = require('express');
var serveIndex = require('serve-index');

var app = express();

// Serve URLs like /ftp/thing as public/ftp/thing
app.use('/ftp', express.static('public/ftp'), serveIndex('public/ftp', {'icons': true}));

// Listen
app.listen(3000);

Where are the serve-index docs?

The documentation for serve-index can be found within the readme on the module's GitHub page at git+https://github.com/expressjs/serve-index.git. This comprehensive documentation runs through installation, options for customizing behavior, API details, and even provides some useful examples showing how to use serve-index with different server configurations.