Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
directory-index-html
Advanced tools
Make an plain html page containing a directory listing. Similar in look and feel to NGINX's listing page.
npm install directory-index-html
var toHTML = require('directory-index-html')
var entries = [{
name: 'test',
size: 24424,
mtime: new Date()
}, {
name: 'a-dir/',
mtime: new Date()
}]
console.log(toHTML('/foo/bar', entries))
var html = toHTML(dir, entries)
Render a directory name and listing to an plain HTML string.
dir
should be a string containing the directory name.
entries
should be an array of entries that are similar to this
{
name: 'name-of-file-or-dir',
size: 42424, // size in bytes
mtime: new Date() // when was this modified
}
To figure out if an entry is a directory the module will one of the following things:
/
entry.type === 'directory'
entry.mode
specifies a directoryThere is a small demo server bundled in the repo that serves a directory listing of your current working directory.
To try it out, run node demo.js
and visit http://localhost:8080
.
It should show something like this:
MIT
FAQs
Make an plain html page containing a directory listing
The npm package directory-index-html receives a total of 118 weekly downloads. As such, directory-index-html popularity was classified as not popular.
We found that directory-index-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.