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

directory-index-html

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

directory-index-html - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

2

demo.js

@@ -15,3 +15,3 @@ var http = require('http')

function loop () {
if (!files.length) return res.end(toHTML(dir, entries))
if (!files.length) return res.end(toHTML(dir, entries, 'Listing created with "node demo.js"'))

@@ -18,0 +18,0 @@ var name = files.shift()

@@ -26,3 +26,3 @@ var constants = require('cons' + 'tants') // be browserify friendly

function toHTML (dir, list) {
function toHTML (dir, list, footer) {
if (dir[dir.length - 1] === '/') dir = dir.slice(0, -1)

@@ -37,3 +37,3 @@

<head><title>Index of ${dirname}</title></head>
<body bgcolor="white"><h1>Index of ${dirname}</h1><hr><pre>${pre}</pre><hr></body>
<body bgcolor="white"><h1>Index of ${dirname}</h1><hr><pre>${pre}</pre><hr>${footer ? '<i>' + footer + '</i>' : ''}</body>
</html>

@@ -40,0 +40,0 @@ `)

{
"name": "directory-index-html",
"version": "1.0.1",
"version": "1.1.0",
"description": "Make an plain html page containing a directory listing",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -29,3 +29,3 @@ # directory-index-html

#### `var html = toHTML(dir, entries)`
#### `var html = toHTML(dir, entries, [serverDescription])`

@@ -52,2 +52,4 @@ Render a directory name and listing to an plain HTML string.

`serverDescription` an optional string describing the server that is included at the bottom of your page
## Demo

@@ -54,0 +56,0 @@

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