v1.0.1: rename as per npm policy
This commit is contained in:
parent
e52a074e66
commit
33c89f136e
|
@ -1,15 +1,15 @@
|
||||||
serve-tpl-download
|
serve-tpl-attachment
|
||||||
==================
|
==================
|
||||||
|
|
||||||
A fork of the original `serve-index` template that, in combination with `serve-static`,
|
A fork of the original `serve-index` template that, in combination with `serve-static`,
|
||||||
provides support for direct file downloads.
|
provides support for direct file downloads (using the Content-Disposition attachment header).
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var express = require('express');
|
var express = require('express');
|
||||||
var app = express();
|
var app = express();
|
||||||
|
|
||||||
var serveIndex = require('serve-index');
|
var serveIndex = require('serve-index');
|
||||||
var serveTpl = require('serve-tpl-download');
|
var serveTpl = require('serve-tpl-attachment');
|
||||||
var serveDirs = serveIndex({ template: serveTpl() });
|
var serveDirs = serveIndex({ template: serveTpl() });
|
||||||
|
|
||||||
app.use('/', function (req, res, next) {
|
app.use('/', function (req, res, next) {
|
||||||
|
@ -37,7 +37,7 @@ For example, this would prevent files in a `~/.ssh` from being read even when `d
|
||||||
`{ privatefiles: 'ignore' }`
|
`{ privatefiles: 'ignore' }`
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var serveTpl = require('serve-tpl-download');
|
var serveTpl = require('serve-tpl-attachment');
|
||||||
|
|
||||||
var serveTemplate = serveTpl({ privatefiles: 'ignore' })
|
var serveTemplate = serveTpl({ privatefiles: 'ignore' })
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "serve-tpl-download",
|
"name": "serve-tpl-attachment",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "A template for serve-static with a direct download option (requires serve-index)",
|
"description": "A template for serve-static with a direct download option (requires serve-index)",
|
||||||
"homepage": "https://git.coolaj86.com/coolaj86/serve-tpl-download.js",
|
"homepage": "https://git.coolaj86.com/coolaj86/serve-tpl-download.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|
Loading…
Reference in New Issue