Comparing version 3.1.1 to 3.2.0
@@ -0,1 +1,4 @@ | ||
2018/02/03 Version 3.2.0 | ||
- Add hidePermissions flag to hide file permissions from directory listings | ||
2017/12/16 Version 3.1.1 | ||
@@ -2,0 +5,0 @@ - Requires version of node-mime that patches regexp dos vulnerability |
@@ -66,1 +66,2 @@ General format is: contributor, github handle, email. In some cases, the | ||
* David Refoua @DRSDavidSoft <david@refoua.me> | ||
* @mmmm1998 <warquark@gmail.com> |
@@ -6,2 +6,3 @@ { | ||
"humanReadable": [ "humanReadable", "humanreadable", "human-readable" ], | ||
"hidePermissions": ["hidePermissions", "hidepermissions", "hide-permissions"], | ||
"si": [ "si", "index" ], | ||
@@ -8,0 +9,0 @@ "handleError": [ "handleError", "handleerror" ], |
@@ -6,2 +6,3 @@ { | ||
"humanReadable": true, | ||
"hidePermissions": false, | ||
"si": false, | ||
@@ -8,0 +9,0 @@ "cache": "max-age=3600", |
@@ -13,2 +13,3 @@ 'use strict'; | ||
let humanReadable = defaults.humanReadable; | ||
let hidePermissions = defaults.hidePermissions; | ||
let si = defaults.si; | ||
@@ -74,2 +75,10 @@ let cache = defaults.cache; | ||
aliases.hidePermissions.some((k) => { | ||
if (isDeclared(k)) { | ||
hidePermissions = opts[k]; | ||
return true; | ||
} | ||
return false; | ||
}); | ||
aliases.si.some((k) => { | ||
@@ -186,2 +195,3 @@ if (isDeclared(k)) { | ||
humanReadable, | ||
hidePermissions, | ||
si, | ||
@@ -188,0 +198,0 @@ defaultExt, |
@@ -23,2 +23,3 @@ 'use strict'; | ||
const humanReadable = opts.humanReadable; | ||
const hidePermissions = opts.hidePermissions; | ||
const handleError = opts.handleError; | ||
@@ -112,4 +113,7 @@ const showDotfiles = opts.showDotfiles; | ||
html += `${'<tr>' + | ||
'<td><i class="icon '}${iconClass}"></i></td>` + | ||
`<td class="perms"><code>(${permsToString(file[1])})</code></td>` + | ||
'<td><i class="icon '}${iconClass}"></i></td>`; | ||
if (!hidePermissions) { | ||
html += `<td class="perms"><code>(${permsToString(file[1])})</code></td>`; | ||
} | ||
html += | ||
`<td class="file-size"><code>${sizeToString(file[1], humanReadable, si)}</code></td>` + | ||
@@ -116,0 +120,0 @@ `<td class="display-name"><a href="${href}">${displayName}</a></td>` + |
@@ -5,3 +5,3 @@ { | ||
"description": "A simple static file server middleware that works with both Express and Flatiron", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"homepage": "https://github.com/jfhbrook/node-ecstatic", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -95,2 +95,3 @@ # Ecstatic [![build status](https://secure.travis-ci.org/jfhbrook/node-ecstatic.png)](http://travis-ci.org/jfhbrook/node-ecstatic) [![codecov.io](https://codecov.io/github/jfhbrook/node-ecstatic/coverage.svg?branch=master)](https://codecov.io/github/jfhbrook/node-ecstatic?branch=master) | ||
humanReadable: true, | ||
hidePermissions: false, | ||
si: false, | ||
@@ -162,2 +163,7 @@ cache: 'max-age=3600', | ||
### `opts.hidePermissions` | ||
### `--hide-permissions` | ||
If hidePermissions is enabled, file permissions will not be displayed. Defaults to **false**. | ||
Aliases are `hidepermissions` and `hide-permissions`. | ||
### `opts.headers` | ||
@@ -164,0 +170,0 @@ ### `--H {HeaderA: valA} [--H {HeaderB: valB}]` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
310001
1249
289