structure, layout and automation
305
node_modules/serve-index/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,305 @@
|
||||
1.9.1 / 2017-09-28
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.3.4
|
||||
- deps: mime-types@~2.1.16
|
||||
* deps: debug@2.6.9
|
||||
* deps: http-errors@~1.6.2
|
||||
- deps: depd@1.1.1
|
||||
* deps: mime-types@~2.1.17
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.30.0
|
||||
* deps: parseurl@~1.3.2
|
||||
- perf: reduce overhead for full URLs
|
||||
- perf: unroll the "fast-path" `RegExp`
|
||||
|
||||
1.9.0 / 2017-05-25
|
||||
==================
|
||||
|
||||
* Set `X-Content-Type-Options: nosniff` header
|
||||
* deps: batch@0.6.1
|
||||
* deps: debug@2.6.8
|
||||
- Allow colors in workers
|
||||
- Deprecated `DEBUG_FD` environment variable set to `3` or higher
|
||||
- Fix `DEBUG_MAX_ARRAY_LENGTH`
|
||||
- Fix error when running under React Native
|
||||
- Use same color for same namespace
|
||||
- deps: ms@2.0.0
|
||||
* deps: http-errors@~1.6.1
|
||||
- Make `message` property enumerable for `HttpError`s
|
||||
- deps: inherits@2.0.3
|
||||
- deps: setprototypeof@1.0.3
|
||||
- deps: statuses@'>= 1.3.1 < 2'
|
||||
* deps: mime-types@~2.1.15
|
||||
- Add new mime types
|
||||
- Add `audio/mp3`
|
||||
|
||||
1.8.0 / 2016-06-17
|
||||
==================
|
||||
|
||||
* Make inline file search case-insensitive
|
||||
* deps: accepts@~1.3.3
|
||||
- deps: mime-types@~2.1.11
|
||||
- deps: negotiator@0.6.1
|
||||
- perf: improve header parsing speed
|
||||
* deps: http-errors@~1.5.0
|
||||
- Use `setprototypeof` module to replace `__proto__` setting
|
||||
- deps: inherits@2.0.1
|
||||
- deps: statuses@'>= 1.3.0 < 2'
|
||||
- perf: enable strict mode
|
||||
* deps: mime-types@~2.1.11
|
||||
- Add new mime types
|
||||
- Update primary extension for `audio/mp4`
|
||||
- deps: mime-db@~1.23.0
|
||||
|
||||
1.7.3 / 2016-01-24
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.13
|
||||
- deps: mime-types@~2.1.6
|
||||
* deps: batch@0.5.3
|
||||
- Fix invalid dependency for browserify
|
||||
* deps: escape-html@~1.0.3
|
||||
- perf: enable strict mode
|
||||
- perf: optimize string replacement
|
||||
- perf: use faster string coercion
|
||||
* deps: mime-types@~2.1.9
|
||||
- Add new mime types
|
||||
* deps: parseurl@~1.3.1
|
||||
- perf: enable strict mode
|
||||
|
||||
1.7.2 / 2015-07-30
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.12
|
||||
- deps: mime-types@~2.1.4
|
||||
* deps: mime-types@~2.1.4
|
||||
- Add new mime types
|
||||
|
||||
1.7.1 / 2015-07-05
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.10
|
||||
- deps: mime-types@~2.1.2
|
||||
* deps: mime-types@~2.1.2
|
||||
- Add new mime types
|
||||
|
||||
1.7.0 / 2015-06-15
|
||||
==================
|
||||
|
||||
* Accept `function` value for `template` option
|
||||
* Send non-chunked response for `OPTIONS`
|
||||
* Stat parent directory when necessary
|
||||
* Use `Date.prototype.toLocaleDateString` to format date
|
||||
* deps: accepts@~1.2.9
|
||||
- deps: mime-types@~2.1.1
|
||||
- deps: negotiator@0.5.3
|
||||
- perf: avoid argument reassignment & argument slice
|
||||
- perf: avoid negotiator recursive construction
|
||||
- perf: enable strict mode
|
||||
- perf: remove unnecessary bitwise operator
|
||||
* deps: escape-html@1.0.2
|
||||
* deps: mime-types@~2.1.1
|
||||
- Add new mime types
|
||||
* perf: enable strict mode
|
||||
* perf: remove argument reassignment
|
||||
|
||||
1.6.4 / 2015-05-12
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.7
|
||||
- deps: mime-types@~2.0.11
|
||||
- deps: negotiator@0.5.3
|
||||
* deps: debug@~2.2.0
|
||||
- deps: ms@0.7.1
|
||||
* deps: mime-types@~2.0.11
|
||||
- Add new mime types
|
||||
|
||||
1.6.3 / 2015-03-13
|
||||
==================
|
||||
|
||||
* Properly escape file names in HTML
|
||||
* deps: accepts@~1.2.5
|
||||
- deps: mime-types@~2.0.10
|
||||
* deps: debug@~2.1.3
|
||||
- Fix high intensity foreground color for bold
|
||||
- deps: ms@0.7.0
|
||||
* deps: escape-html@1.0.1
|
||||
* deps: mime-types@~2.0.10
|
||||
- Add new mime types
|
||||
|
||||
1.6.2 / 2015-02-16
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.4
|
||||
- deps: mime-types@~2.0.9
|
||||
- deps: negotiator@0.5.1
|
||||
* deps: http-errors@~1.3.1
|
||||
- Construct errors using defined constructors from `createError`
|
||||
- Fix error names that are not identifiers
|
||||
- Set a meaningful `name` property on constructed errors
|
||||
* deps: mime-types@~2.0.9
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.7.0
|
||||
|
||||
1.6.1 / 2015-01-31
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.3
|
||||
- deps: mime-types@~2.0.8
|
||||
* deps: mime-types@~2.0.8
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.6.0
|
||||
|
||||
1.6.0 / 2015-01-01
|
||||
==================
|
||||
|
||||
* Add link to root directory
|
||||
* deps: accepts@~1.2.2
|
||||
- deps: mime-types@~2.0.7
|
||||
- deps: negotiator@0.5.0
|
||||
* deps: batch@0.5.2
|
||||
* deps: debug@~2.1.1
|
||||
* deps: mime-types@~2.0.7
|
||||
- Add new mime types
|
||||
- Fix missing extensions
|
||||
- Fix various invalid MIME type entries
|
||||
- Remove example template MIME types
|
||||
- deps: mime-db@~1.5.0
|
||||
|
||||
1.5.3 / 2014-12-10
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.1.4
|
||||
- deps: mime-types@~2.0.4
|
||||
* deps: http-errors@~1.2.8
|
||||
- Fix stack trace from exported function
|
||||
* deps: mime-types@~2.0.4
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.3.0
|
||||
|
||||
1.5.2 / 2014-12-03
|
||||
==================
|
||||
|
||||
* Fix icon name background alignment on mobile view
|
||||
|
||||
1.5.1 / 2014-11-22
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.1.3
|
||||
- deps: mime-types@~2.0.3
|
||||
* deps: mime-types@~2.0.3
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.2.0
|
||||
|
||||
1.5.0 / 2014-10-16
|
||||
==================
|
||||
|
||||
* Create errors with `http-errors`
|
||||
* deps: debug@~2.1.0
|
||||
- Implement `DEBUG_FD` env variable support
|
||||
* deps: mime-types@~2.0.2
|
||||
- deps: mime-db@~1.1.0
|
||||
|
||||
1.4.1 / 2014-10-15
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.1.2
|
||||
- Fix error when media type has invalid parameter
|
||||
- deps: negotiator@0.4.9
|
||||
|
||||
1.4.0 / 2014-10-03
|
||||
==================
|
||||
|
||||
* Add `dir` argument to `filter` function
|
||||
* Support using tokens multiple times
|
||||
|
||||
1.3.1 / 2014-10-01
|
||||
==================
|
||||
|
||||
* Fix incorrect 403 on Windows and Node.js 0.11
|
||||
* deps: accepts@~1.1.1
|
||||
- deps: mime-types@~2.0.2
|
||||
- deps: negotiator@0.4.8
|
||||
|
||||
1.3.0 / 2014-09-20
|
||||
==================
|
||||
|
||||
* Add icon for mkv files
|
||||
* Lookup icon by mime type for greater icon support
|
||||
|
||||
1.2.1 / 2014-09-05
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.1.0
|
||||
* deps: debug@~2.0.0
|
||||
|
||||
1.2.0 / 2014-08-25
|
||||
==================
|
||||
|
||||
* Add `debug` messages
|
||||
* Resolve relative paths at middleware setup
|
||||
|
||||
1.1.6 / 2014-08-10
|
||||
==================
|
||||
|
||||
* Fix URL parsing
|
||||
* deps: parseurl@~1.3.0
|
||||
|
||||
1.1.5 / 2014-07-27
|
||||
==================
|
||||
|
||||
* Fix Content-Length calculation for multi-byte file names
|
||||
* deps: accepts@~1.0.7
|
||||
- deps: negotiator@0.4.7
|
||||
|
||||
1.1.4 / 2014-06-20
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.0.5
|
||||
|
||||
1.1.3 / 2014-06-20
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.0.4
|
||||
- use `mime-types`
|
||||
|
||||
1.1.2 / 2014-06-19
|
||||
==================
|
||||
|
||||
* deps: batch@0.5.1
|
||||
|
||||
1.1.1 / 2014-06-11
|
||||
==================
|
||||
|
||||
* deps: accepts@1.0.3
|
||||
|
||||
1.1.0 / 2014-05-29
|
||||
==================
|
||||
|
||||
* Fix content negotiation when no `Accept` header
|
||||
* Properly support all HTTP methods
|
||||
* Support vanilla node.js http servers
|
||||
* Treat `ENAMETOOLONG` as code 414
|
||||
* Use accepts for negotiation
|
||||
|
||||
1.0.3 / 2014-05-20
|
||||
==================
|
||||
|
||||
* Fix error from non-statable files in HTML view
|
||||
|
||||
1.0.2 / 2014-04-28
|
||||
==================
|
||||
|
||||
* Add `stylesheet` option
|
||||
* deps: negotiator@0.4.3
|
||||
|
||||
1.0.1 / 2014-03-05
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.2
|
||||
|
||||
1.0.0 / 2014-03-05
|
||||
==================
|
||||
|
||||
* Genesis from connect
|
25
node_modules/serve-index/LICENSE
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2010 Sencha Inc.
|
||||
Copyright (c) 2011 LearnBoost
|
||||
Copyright (c) 2011 TJ Holowaychuk
|
||||
Copyright (c) 2014-2015 Douglas Christopher Wilson
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
154
node_modules/serve-index/README.md
generated
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
# serve-index
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Linux Build][travis-image]][travis-url]
|
||||
[![Windows Build][appveyor-image]][appveyor-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
[![Gratipay][gratipay-image]][gratipay-url]
|
||||
|
||||
Serves pages that contain directory listings for a given path.
|
||||
|
||||
## Install
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install serve-index
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var serveIndex = require('serve-index')
|
||||
```
|
||||
|
||||
### serveIndex(path, options)
|
||||
|
||||
Returns middlware that serves an index of the directory in the given `path`.
|
||||
|
||||
The `path` is based off the `req.url` value, so a `req.url` of `'/some/dir`
|
||||
with a `path` of `'public'` will look at `'public/some/dir'`. If you are using
|
||||
something like `express`, you can change the URL "base" with `app.use` (see
|
||||
the express example).
|
||||
|
||||
#### Options
|
||||
|
||||
Serve index accepts these properties in the options object.
|
||||
|
||||
##### filter
|
||||
|
||||
Apply this filter function to files. Defaults to `false`. The `filter` function
|
||||
is called for each file, with the signature `filter(filename, index, files, dir)`
|
||||
where `filename` is the name of the file, `index` is the array index, `files` is
|
||||
the array of files and `dir` is the absolute path the file is located (and thus,
|
||||
the directory the listing is for).
|
||||
|
||||
##### hidden
|
||||
|
||||
Display hidden (dot) files. Defaults to `false`.
|
||||
|
||||
##### icons
|
||||
|
||||
Display icons. Defaults to `false`.
|
||||
|
||||
##### stylesheet
|
||||
|
||||
Optional path to a CSS stylesheet. Defaults to a built-in stylesheet.
|
||||
|
||||
##### template
|
||||
|
||||
Optional path to an HTML template or a function that will render a HTML
|
||||
string. Defaults to a built-in template.
|
||||
|
||||
When given a string, the string is used as a file path to load and then the
|
||||
following tokens are replaced in templates:
|
||||
|
||||
* `{directory}` with the name of the directory.
|
||||
* `{files}` with the HTML of an unordered list of file links.
|
||||
* `{linked-path}` with the HTML of a link to the directory.
|
||||
* `{style}` with the specified stylesheet and embedded images.
|
||||
|
||||
When given as a function, the function is called as `template(locals, callback)`
|
||||
and it needs to invoke `callback(error, htmlString)`. The following are the
|
||||
provided locals:
|
||||
|
||||
* `directory` is the directory being displayed (where `/` is the root).
|
||||
* `displayIcons` is a Boolean for if icons should be rendered or not.
|
||||
* `fileList` is a sorted array of files in the directory. The array contains
|
||||
objects with the following properties:
|
||||
- `name` is the relative name for the file.
|
||||
- `stat` is a `fs.Stats` object for the file.
|
||||
* `path` is the full filesystem path to `directory`.
|
||||
* `style` is the default stylesheet or the contents of the `stylesheet` option.
|
||||
* `viewName` is the view name provided by the `view` option.
|
||||
|
||||
##### view
|
||||
|
||||
Display mode. `tiles` and `details` are available. Defaults to `tiles`.
|
||||
|
||||
## Examples
|
||||
|
||||
### Serve directory indexes with vanilla node.js http server
|
||||
|
||||
```js
|
||||
var finalhandler = require('finalhandler')
|
||||
var http = require('http')
|
||||
var serveIndex = require('serve-index')
|
||||
var serveStatic = require('serve-static')
|
||||
|
||||
// Serve directory indexes for 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)
|
||||
```
|
||||
|
||||
### Serve directory indexes with express
|
||||
|
||||
```js
|
||||
var express = require('express')
|
||||
var serveIndex = require('serve-index')
|
||||
|
||||
var app = express()
|
||||
|
||||
// Serve URLs like /ftp/thing as public/ftp/thing
|
||||
// The express.static serves the file contents
|
||||
// The serveIndex is this module serving the directory
|
||||
app.use('/ftp', express.static('public/ftp'), serveIndex('public/ftp', {'icons': true}))
|
||||
|
||||
// Listen
|
||||
app.listen(3000)
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE). The [Silk](http://www.famfamfam.com/lab/icons/silk/) icons
|
||||
are created by/copyright of [FAMFAMFAM](http://www.famfamfam.com/).
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/serve-index.svg
|
||||
[npm-url]: https://npmjs.org/package/serve-index
|
||||
[travis-image]: https://img.shields.io/travis/expressjs/serve-index/master.svg?label=linux
|
||||
[travis-url]: https://travis-ci.org/expressjs/serve-index
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/serve-index/master.svg?label=windows
|
||||
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-index
|
||||
[coveralls-image]: https://img.shields.io/coveralls/expressjs/serve-index/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/expressjs/serve-index?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/serve-index.svg
|
||||
[downloads-url]: https://npmjs.org/package/serve-index
|
||||
[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg
|
||||
[gratipay-url]: https://www.gratipay.com/dougwilson/
|
646
node_modules/serve-index/index.js
generated
vendored
Normal file
@ -0,0 +1,646 @@
|
||||
/*!
|
||||
* serve-index
|
||||
* Copyright(c) 2011 Sencha Inc.
|
||||
* Copyright(c) 2011 TJ Holowaychuk
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var accepts = require('accepts');
|
||||
var createError = require('http-errors');
|
||||
var debug = require('debug')('serve-index');
|
||||
var escapeHtml = require('escape-html');
|
||||
var fs = require('fs')
|
||||
, path = require('path')
|
||||
, normalize = path.normalize
|
||||
, sep = path.sep
|
||||
, extname = path.extname
|
||||
, join = path.join;
|
||||
var Batch = require('batch');
|
||||
var mime = require('mime-types');
|
||||
var parseUrl = require('parseurl');
|
||||
var resolve = require('path').resolve;
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = serveIndex;
|
||||
|
||||
/*!
|
||||
* Icon cache.
|
||||
*/
|
||||
|
||||
var cache = {};
|
||||
|
||||
/*!
|
||||
* Default template.
|
||||
*/
|
||||
|
||||
var defaultTemplate = join(__dirname, 'public', 'directory.html');
|
||||
|
||||
/*!
|
||||
* Stylesheet.
|
||||
*/
|
||||
|
||||
var defaultStylesheet = join(__dirname, 'public', 'style.css');
|
||||
|
||||
/**
|
||||
* Media types and the map for content negotiation.
|
||||
*/
|
||||
|
||||
var mediaTypes = [
|
||||
'text/html',
|
||||
'text/plain',
|
||||
'application/json'
|
||||
];
|
||||
|
||||
var mediaType = {
|
||||
'text/html': 'html',
|
||||
'text/plain': 'plain',
|
||||
'application/json': 'json'
|
||||
};
|
||||
|
||||
/**
|
||||
* Serve directory listings with the given `root` path.
|
||||
*
|
||||
* See Readme.md for documentation of options.
|
||||
*
|
||||
* @param {String} root
|
||||
* @param {Object} options
|
||||
* @return {Function} middleware
|
||||
* @public
|
||||
*/
|
||||
|
||||
function serveIndex(root, options) {
|
||||
var opts = options || {};
|
||||
|
||||
// root required
|
||||
if (!root) {
|
||||
throw new TypeError('serveIndex() root path required');
|
||||
}
|
||||
|
||||
// resolve root to absolute and normalize
|
||||
var rootPath = normalize(resolve(root) + sep);
|
||||
|
||||
var filter = opts.filter;
|
||||
var hidden = opts.hidden;
|
||||
var icons = opts.icons;
|
||||
var stylesheet = opts.stylesheet || defaultStylesheet;
|
||||
var template = opts.template || defaultTemplate;
|
||||
var view = opts.view || 'tiles';
|
||||
|
||||
return function (req, res, next) {
|
||||
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
||||
res.statusCode = 'OPTIONS' === req.method ? 200 : 405;
|
||||
res.setHeader('Allow', 'GET, HEAD, OPTIONS');
|
||||
res.setHeader('Content-Length', '0');
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
|
||||
// parse URLs
|
||||
var url = parseUrl(req);
|
||||
var originalUrl = parseUrl.original(req);
|
||||
var dir = decodeURIComponent(url.pathname);
|
||||
var originalDir = decodeURIComponent(originalUrl.pathname);
|
||||
|
||||
// join / normalize from root dir
|
||||
var path = normalize(join(rootPath, dir));
|
||||
|
||||
// null byte(s), bad request
|
||||
if (~path.indexOf('\0')) return next(createError(400));
|
||||
|
||||
// malicious path
|
||||
if ((path + sep).substr(0, rootPath.length) !== rootPath) {
|
||||
debug('malicious path "%s"', path);
|
||||
return next(createError(403));
|
||||
}
|
||||
|
||||
// determine ".." display
|
||||
var showUp = normalize(resolve(path) + sep) !== rootPath;
|
||||
|
||||
// check if we have a directory
|
||||
debug('stat "%s"', path);
|
||||
fs.stat(path, function(err, stat){
|
||||
if (err && err.code === 'ENOENT') {
|
||||
return next();
|
||||
}
|
||||
|
||||
if (err) {
|
||||
err.status = err.code === 'ENAMETOOLONG'
|
||||
? 414
|
||||
: 500;
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (!stat.isDirectory()) return next();
|
||||
|
||||
// fetch files
|
||||
debug('readdir "%s"', path);
|
||||
fs.readdir(path, function(err, files){
|
||||
if (err) return next(err);
|
||||
if (!hidden) files = removeHidden(files);
|
||||
if (filter) files = files.filter(function(filename, index, list) {
|
||||
return filter(filename, index, list, path);
|
||||
});
|
||||
files.sort();
|
||||
|
||||
// content-negotiation
|
||||
var accept = accepts(req);
|
||||
var type = accept.type(mediaTypes);
|
||||
|
||||
// not acceptable
|
||||
if (!type) return next(createError(406));
|
||||
serveIndex[mediaType[type]](req, res, files, next, originalDir, showUp, icons, path, view, template, stylesheet);
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Respond with text/html.
|
||||
*/
|
||||
|
||||
serveIndex.html = function _html(req, res, files, next, dir, showUp, icons, path, view, template, stylesheet) {
|
||||
var render = typeof template !== 'function'
|
||||
? createHtmlRender(template)
|
||||
: template
|
||||
|
||||
if (showUp) {
|
||||
files.unshift('..');
|
||||
}
|
||||
|
||||
// stat all files
|
||||
stat(path, files, function (err, stats) {
|
||||
if (err) return next(err);
|
||||
|
||||
// combine the stats into the file list
|
||||
var fileList = files.map(function (file, i) {
|
||||
return { name: file, stat: stats[i] };
|
||||
});
|
||||
|
||||
// sort file list
|
||||
fileList.sort(fileSort);
|
||||
|
||||
// read stylesheet
|
||||
fs.readFile(stylesheet, 'utf8', function (err, style) {
|
||||
if (err) return next(err);
|
||||
|
||||
// create locals for rendering
|
||||
var locals = {
|
||||
directory: dir,
|
||||
displayIcons: Boolean(icons),
|
||||
fileList: fileList,
|
||||
path: path,
|
||||
style: style,
|
||||
viewName: view
|
||||
};
|
||||
|
||||
// render html
|
||||
render(locals, function (err, body) {
|
||||
if (err) return next(err);
|
||||
send(res, 'text/html', body)
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Respond with application/json.
|
||||
*/
|
||||
|
||||
serveIndex.json = function _json(req, res, files) {
|
||||
send(res, 'application/json', JSON.stringify(files))
|
||||
};
|
||||
|
||||
/**
|
||||
* Respond with text/plain.
|
||||
*/
|
||||
|
||||
serveIndex.plain = function _plain(req, res, files) {
|
||||
send(res, 'text/plain', (files.join('\n') + '\n'))
|
||||
};
|
||||
|
||||
/**
|
||||
* Map html `files`, returning an html unordered list.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createHtmlFileList(files, dir, useIcons, view) {
|
||||
var html = '<ul id="files" class="view-' + escapeHtml(view) + '">'
|
||||
+ (view == 'details' ? (
|
||||
'<li class="header">'
|
||||
+ '<span class="name">Name</span>'
|
||||
+ '<span class="size">Size</span>'
|
||||
+ '<span class="date">Modified</span>'
|
||||
+ '</li>') : '');
|
||||
|
||||
html += files.map(function (file) {
|
||||
var classes = [];
|
||||
var isDir = file.stat && file.stat.isDirectory();
|
||||
var path = dir.split('/').map(function (c) { return encodeURIComponent(c); });
|
||||
|
||||
if (useIcons) {
|
||||
classes.push('icon');
|
||||
|
||||
if (isDir) {
|
||||
classes.push('icon-directory');
|
||||
} else {
|
||||
var ext = extname(file.name);
|
||||
var icon = iconLookup(file.name);
|
||||
|
||||
classes.push('icon');
|
||||
classes.push('icon-' + ext.substring(1));
|
||||
|
||||
if (classes.indexOf(icon.className) === -1) {
|
||||
classes.push(icon.className);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
path.push(encodeURIComponent(file.name));
|
||||
|
||||
var date = file.stat && file.name !== '..'
|
||||
? file.stat.mtime.toLocaleDateString() + ' ' + file.stat.mtime.toLocaleTimeString()
|
||||
: '';
|
||||
var size = file.stat && !isDir
|
||||
? file.stat.size
|
||||
: '';
|
||||
|
||||
return '<li><a href="'
|
||||
+ escapeHtml(normalizeSlashes(normalize(path.join('/'))))
|
||||
+ '" class="' + escapeHtml(classes.join(' ')) + '"'
|
||||
+ ' title="' + escapeHtml(file.name) + '">'
|
||||
+ '<span class="name">' + escapeHtml(file.name) + '</span>'
|
||||
+ '<span class="size">' + escapeHtml(size) + '</span>'
|
||||
+ '<span class="date">' + escapeHtml(date) + '</span>'
|
||||
+ '</a></li>';
|
||||
}).join('\n');
|
||||
|
||||
html += '</ul>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create function to render html.
|
||||
*/
|
||||
|
||||
function createHtmlRender(template) {
|
||||
return function render(locals, callback) {
|
||||
// read template
|
||||
fs.readFile(template, 'utf8', function (err, str) {
|
||||
if (err) return callback(err);
|
||||
|
||||
var body = str
|
||||
.replace(/\{style\}/g, locals.style.concat(iconStyle(locals.fileList, locals.displayIcons)))
|
||||
.replace(/\{files\}/g, createHtmlFileList(locals.fileList, locals.directory, locals.displayIcons, locals.viewName))
|
||||
.replace(/\{directory\}/g, escapeHtml(locals.directory))
|
||||
.replace(/\{linked-path\}/g, htmlPath(locals.directory));
|
||||
|
||||
callback(null, body);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort function for with directories first.
|
||||
*/
|
||||
|
||||
function fileSort(a, b) {
|
||||
// sort ".." to the top
|
||||
if (a.name === '..' || b.name === '..') {
|
||||
return a.name === b.name ? 0
|
||||
: a.name === '..' ? -1 : 1;
|
||||
}
|
||||
|
||||
return Number(b.stat && b.stat.isDirectory()) - Number(a.stat && a.stat.isDirectory()) ||
|
||||
String(a.name).toLocaleLowerCase().localeCompare(String(b.name).toLocaleLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Map html `dir`, returning a linked path.
|
||||
*/
|
||||
|
||||
function htmlPath(dir) {
|
||||
var parts = dir.split('/');
|
||||
var crumb = new Array(parts.length);
|
||||
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
var part = parts[i];
|
||||
|
||||
if (part) {
|
||||
parts[i] = encodeURIComponent(part);
|
||||
crumb[i] = '<a href="' + escapeHtml(parts.slice(0, i + 1).join('/')) + '">' + escapeHtml(part) + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
return crumb.join(' / ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the icon data for the file name.
|
||||
*/
|
||||
|
||||
function iconLookup(filename) {
|
||||
var ext = extname(filename);
|
||||
|
||||
// try by extension
|
||||
if (icons[ext]) {
|
||||
return {
|
||||
className: 'icon-' + ext.substring(1),
|
||||
fileName: icons[ext]
|
||||
};
|
||||
}
|
||||
|
||||
var mimetype = mime.lookup(ext);
|
||||
|
||||
// default if no mime type
|
||||
if (mimetype === false) {
|
||||
return {
|
||||
className: 'icon-default',
|
||||
fileName: icons.default
|
||||
};
|
||||
}
|
||||
|
||||
// try by mime type
|
||||
if (icons[mimetype]) {
|
||||
return {
|
||||
className: 'icon-' + mimetype.replace('/', '-'),
|
||||
fileName: icons[mimetype]
|
||||
};
|
||||
}
|
||||
|
||||
var suffix = mimetype.split('+')[1];
|
||||
|
||||
if (suffix && icons['+' + suffix]) {
|
||||
return {
|
||||
className: 'icon-' + suffix,
|
||||
fileName: icons['+' + suffix]
|
||||
};
|
||||
}
|
||||
|
||||
var type = mimetype.split('/')[0];
|
||||
|
||||
// try by type only
|
||||
if (icons[type]) {
|
||||
return {
|
||||
className: 'icon-' + type,
|
||||
fileName: icons[type]
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
className: 'icon-default',
|
||||
fileName: icons.default
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Load icon images, return css string.
|
||||
*/
|
||||
|
||||
function iconStyle(files, useIcons) {
|
||||
if (!useIcons) return '';
|
||||
var i;
|
||||
var list = [];
|
||||
var rules = {};
|
||||
var selector;
|
||||
var selectors = {};
|
||||
var style = '';
|
||||
|
||||
for (i = 0; i < files.length; i++) {
|
||||
var file = files[i];
|
||||
|
||||
var isDir = file.stat && file.stat.isDirectory();
|
||||
var icon = isDir
|
||||
? { className: 'icon-directory', fileName: icons.folder }
|
||||
: iconLookup(file.name);
|
||||
var iconName = icon.fileName;
|
||||
|
||||
selector = '#files .' + icon.className + ' .name';
|
||||
|
||||
if (!rules[iconName]) {
|
||||
rules[iconName] = 'background-image: url(data:image/png;base64,' + load(iconName) + ');'
|
||||
selectors[iconName] = [];
|
||||
list.push(iconName);
|
||||
}
|
||||
|
||||
if (selectors[iconName].indexOf(selector) === -1) {
|
||||
selectors[iconName].push(selector);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < list.length; i++) {
|
||||
iconName = list[i];
|
||||
style += selectors[iconName].join(',\n') + ' {\n ' + rules[iconName] + '\n}\n';
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and cache the given `icon`.
|
||||
*
|
||||
* @param {String} icon
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function load(icon) {
|
||||
if (cache[icon]) return cache[icon];
|
||||
return cache[icon] = fs.readFileSync(__dirname + '/public/icons/' + icon, 'base64');
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes the path separator from system separator
|
||||
* to URL separator, aka `/`.
|
||||
*
|
||||
* @param {String} path
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function normalizeSlashes(path) {
|
||||
return path.split(sep).join('/');
|
||||
};
|
||||
|
||||
/**
|
||||
* Filter "hidden" `files`, aka files
|
||||
* beginning with a `.`.
|
||||
*
|
||||
* @param {Array} files
|
||||
* @return {Array}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function removeHidden(files) {
|
||||
return files.filter(function(file){
|
||||
return '.' != file[0];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a response.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function send (res, type, body) {
|
||||
// security header for content sniffing
|
||||
res.setHeader('X-Content-Type-Options', 'nosniff')
|
||||
|
||||
// standard headers
|
||||
res.setHeader('Content-Type', type + '; charset=utf-8')
|
||||
res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8'))
|
||||
|
||||
// body
|
||||
res.end(body, 'utf8')
|
||||
}
|
||||
|
||||
/**
|
||||
* Stat all files and return array of stat
|
||||
* in same order.
|
||||
*/
|
||||
|
||||
function stat(dir, files, cb) {
|
||||
var batch = new Batch();
|
||||
|
||||
batch.concurrency(10);
|
||||
|
||||
files.forEach(function(file){
|
||||
batch.push(function(done){
|
||||
fs.stat(join(dir, file), function(err, stat){
|
||||
if (err && err.code !== 'ENOENT') return done(err);
|
||||
|
||||
// pass ENOENT as null stat, not error
|
||||
done(null, stat || null);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
batch.end(cb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Icon map.
|
||||
*/
|
||||
|
||||
var icons = {
|
||||
// base icons
|
||||
'default': 'page_white.png',
|
||||
'folder': 'folder.png',
|
||||
|
||||
// generic mime type icons
|
||||
'image': 'image.png',
|
||||
'text': 'page_white_text.png',
|
||||
'video': 'film.png',
|
||||
|
||||
// generic mime suffix icons
|
||||
'+json': 'page_white_code.png',
|
||||
'+xml': 'page_white_code.png',
|
||||
'+zip': 'box.png',
|
||||
|
||||
// specific mime type icons
|
||||
'application/font-woff': 'font.png',
|
||||
'application/javascript': 'page_white_code_red.png',
|
||||
'application/json': 'page_white_code.png',
|
||||
'application/msword': 'page_white_word.png',
|
||||
'application/pdf': 'page_white_acrobat.png',
|
||||
'application/postscript': 'page_white_vector.png',
|
||||
'application/rtf': 'page_white_word.png',
|
||||
'application/vnd.ms-excel': 'page_white_excel.png',
|
||||
'application/vnd.ms-powerpoint': 'page_white_powerpoint.png',
|
||||
'application/vnd.oasis.opendocument.presentation': 'page_white_powerpoint.png',
|
||||
'application/vnd.oasis.opendocument.spreadsheet': 'page_white_excel.png',
|
||||
'application/vnd.oasis.opendocument.text': 'page_white_word.png',
|
||||
'application/x-7z-compressed': 'box.png',
|
||||
'application/x-sh': 'application_xp_terminal.png',
|
||||
'application/x-font-ttf': 'font.png',
|
||||
'application/x-msaccess': 'page_white_database.png',
|
||||
'application/x-shockwave-flash': 'page_white_flash.png',
|
||||
'application/x-sql': 'page_white_database.png',
|
||||
'application/x-tar': 'box.png',
|
||||
'application/x-xz': 'box.png',
|
||||
'application/xml': 'page_white_code.png',
|
||||
'application/zip': 'box.png',
|
||||
'image/svg+xml': 'page_white_vector.png',
|
||||
'text/css': 'page_white_code.png',
|
||||
'text/html': 'page_white_code.png',
|
||||
'text/less': 'page_white_code.png',
|
||||
|
||||
// other, extension-specific icons
|
||||
'.accdb': 'page_white_database.png',
|
||||
'.apk': 'box.png',
|
||||
'.app': 'application_xp.png',
|
||||
'.as': 'page_white_actionscript.png',
|
||||
'.asp': 'page_white_code.png',
|
||||
'.aspx': 'page_white_code.png',
|
||||
'.bat': 'application_xp_terminal.png',
|
||||
'.bz2': 'box.png',
|
||||
'.c': 'page_white_c.png',
|
||||
'.cab': 'box.png',
|
||||
'.cfm': 'page_white_coldfusion.png',
|
||||
'.clj': 'page_white_code.png',
|
||||
'.cc': 'page_white_cplusplus.png',
|
||||
'.cgi': 'application_xp_terminal.png',
|
||||
'.cpp': 'page_white_cplusplus.png',
|
||||
'.cs': 'page_white_csharp.png',
|
||||
'.db': 'page_white_database.png',
|
||||
'.dbf': 'page_white_database.png',
|
||||
'.deb': 'box.png',
|
||||
'.dll': 'page_white_gear.png',
|
||||
'.dmg': 'drive.png',
|
||||
'.docx': 'page_white_word.png',
|
||||
'.erb': 'page_white_ruby.png',
|
||||
'.exe': 'application_xp.png',
|
||||
'.fnt': 'font.png',
|
||||
'.gam': 'controller.png',
|
||||
'.gz': 'box.png',
|
||||
'.h': 'page_white_h.png',
|
||||
'.ini': 'page_white_gear.png',
|
||||
'.iso': 'cd.png',
|
||||
'.jar': 'box.png',
|
||||
'.java': 'page_white_cup.png',
|
||||
'.jsp': 'page_white_cup.png',
|
||||
'.lua': 'page_white_code.png',
|
||||
'.lz': 'box.png',
|
||||
'.lzma': 'box.png',
|
||||
'.m': 'page_white_code.png',
|
||||
'.map': 'map.png',
|
||||
'.msi': 'box.png',
|
||||
'.mv4': 'film.png',
|
||||
'.otf': 'font.png',
|
||||
'.pdb': 'page_white_database.png',
|
||||
'.php': 'page_white_php.png',
|
||||
'.pl': 'page_white_code.png',
|
||||
'.pkg': 'box.png',
|
||||
'.pptx': 'page_white_powerpoint.png',
|
||||
'.psd': 'page_white_picture.png',
|
||||
'.py': 'page_white_code.png',
|
||||
'.rar': 'box.png',
|
||||
'.rb': 'page_white_ruby.png',
|
||||
'.rm': 'film.png',
|
||||
'.rom': 'controller.png',
|
||||
'.rpm': 'box.png',
|
||||
'.sass': 'page_white_code.png',
|
||||
'.sav': 'controller.png',
|
||||
'.scss': 'page_white_code.png',
|
||||
'.srt': 'page_white_text.png',
|
||||
'.tbz2': 'box.png',
|
||||
'.tgz': 'box.png',
|
||||
'.tlz': 'box.png',
|
||||
'.vb': 'page_white_code.png',
|
||||
'.vbs': 'page_white_code.png',
|
||||
'.xcf': 'page_white_picture.png',
|
||||
'.xlsx': 'page_white_excel.png',
|
||||
'.yaws': 'page_white_code.png'
|
||||
};
|
132
node_modules/serve-index/node_modules/http-errors/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
2018-03-29 / 1.6.3
|
||||
==================
|
||||
|
||||
* deps: depd@~1.1.2
|
||||
- perf: remove argument reassignment
|
||||
* deps: setprototypeof@1.1.0
|
||||
* deps: statuses@'>= 1.3.1 < 2'
|
||||
|
||||
2017-08-04 / 1.6.2
|
||||
==================
|
||||
|
||||
* deps: depd@1.1.1
|
||||
- Remove unnecessary `Buffer` loading
|
||||
|
||||
2017-02-20 / 1.6.1
|
||||
==================
|
||||
|
||||
* deps: setprototypeof@1.0.3
|
||||
- Fix shim for old browsers
|
||||
|
||||
2017-02-14 / 1.6.0
|
||||
==================
|
||||
|
||||
* Accept custom 4xx and 5xx status codes in factory
|
||||
* Add deprecation message to `"I'mateapot"` export
|
||||
* Deprecate passing status code as anything except first argument in factory
|
||||
* Deprecate using non-error status codes
|
||||
* Make `message` property enumerable for `HttpError`s
|
||||
|
||||
2016-11-16 / 1.5.1
|
||||
==================
|
||||
|
||||
* deps: inherits@2.0.3
|
||||
- Fix issue loading in browser
|
||||
* deps: setprototypeof@1.0.2
|
||||
* deps: statuses@'>= 1.3.1 < 2'
|
||||
|
||||
2016-05-18 / 1.5.0
|
||||
==================
|
||||
|
||||
* Support new code `421 Misdirected Request`
|
||||
* Use `setprototypeof` module to replace `__proto__` setting
|
||||
* deps: statuses@'>= 1.3.0 < 2'
|
||||
- Add `421 Misdirected Request`
|
||||
- perf: enable strict mode
|
||||
* perf: enable strict mode
|
||||
|
||||
2016-01-28 / 1.4.0
|
||||
==================
|
||||
|
||||
* Add `HttpError` export, for `err instanceof createError.HttpError`
|
||||
* deps: inherits@2.0.1
|
||||
* deps: statuses@'>= 1.2.1 < 2'
|
||||
- Fix message for status 451
|
||||
- Remove incorrect nginx status code
|
||||
|
||||
2015-02-02 / 1.3.1
|
||||
==================
|
||||
|
||||
* Fix regression where status can be overwritten in `createError` `props`
|
||||
|
||||
2015-02-01 / 1.3.0
|
||||
==================
|
||||
|
||||
* Construct errors using defined constructors from `createError`
|
||||
* Fix error names that are not identifiers
|
||||
- `createError["I'mateapot"]` is now `createError.ImATeapot`
|
||||
* Set a meaningful `name` property on constructed errors
|
||||
|
||||
2014-12-09 / 1.2.8
|
||||
==================
|
||||
|
||||
* Fix stack trace from exported function
|
||||
* Remove `arguments.callee` usage
|
||||
|
||||
2014-10-14 / 1.2.7
|
||||
==================
|
||||
|
||||
* Remove duplicate line
|
||||
|
||||
2014-10-02 / 1.2.6
|
||||
==================
|
||||
|
||||
* Fix `expose` to be `true` for `ClientError` constructor
|
||||
|
||||
2014-09-28 / 1.2.5
|
||||
==================
|
||||
|
||||
* deps: statuses@1
|
||||
|
||||
2014-09-21 / 1.2.4
|
||||
==================
|
||||
|
||||
* Fix dependency version to work with old `npm`s
|
||||
|
||||
2014-09-21 / 1.2.3
|
||||
==================
|
||||
|
||||
* deps: statuses@~1.1.0
|
||||
|
||||
2014-09-21 / 1.2.2
|
||||
==================
|
||||
|
||||
* Fix publish error
|
||||
|
||||
2014-09-21 / 1.2.1
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
* Use `inherits` instead of `util`
|
||||
|
||||
2014-09-09 / 1.2.0
|
||||
==================
|
||||
|
||||
* Fix the way inheriting functions
|
||||
* Support `expose` being provided in properties argument
|
||||
|
||||
2014-09-08 / 1.1.0
|
||||
==================
|
||||
|
||||
* Default status to 500
|
||||
* Support provided `error` to extend
|
||||
|
||||
2014-09-08 / 1.0.1
|
||||
==================
|
||||
|
||||
* Fix accepting string message
|
||||
|
||||
2014-09-08 / 1.0.0
|
||||
==================
|
||||
|
||||
* Initial release
|
23
node_modules/serve-index/node_modules/http-errors/LICENSE
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
||||
Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
135
node_modules/serve-index/node_modules/http-errors/README.md
generated
vendored
Normal file
@ -0,0 +1,135 @@
|
||||
# http-errors
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
Create HTTP errors for Express, Koa, Connect, etc. with ease.
|
||||
|
||||
## Install
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```bash
|
||||
$ npm install http-errors
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var createError = require('http-errors')
|
||||
var express = require('express')
|
||||
var app = express()
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
if (!req.user) return next(createError(401, 'Please login to view this page.'))
|
||||
next()
|
||||
})
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
This is the current API, currently extracted from Koa and subject to change.
|
||||
|
||||
All errors inherit from JavaScript `Error` and the exported `createError.HttpError`.
|
||||
|
||||
### Error Properties
|
||||
|
||||
- `expose` - can be used to signal if `message` should be sent to the client,
|
||||
defaulting to `false` when `status` >= 500
|
||||
- `headers` - can be an object of header names to values to be sent to the
|
||||
client, defaulting to `undefined`. When defined, the key names should all
|
||||
be lower-cased
|
||||
- `message` - the traditional error message, which should be kept short and all
|
||||
single line
|
||||
- `status` - the status code of the error, mirroring `statusCode` for general
|
||||
compatibility
|
||||
- `statusCode` - the status code of the error, defaulting to `500`
|
||||
|
||||
### createError([status], [message], [properties])
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-vars -->
|
||||
|
||||
```js
|
||||
var err = createError(404, 'This video does not exist!')
|
||||
```
|
||||
|
||||
- `status: 500` - the status code as a number
|
||||
- `message` - the message of the error, defaulting to node's text for that status code.
|
||||
- `properties` - custom properties to attach to the object
|
||||
|
||||
### new createError\[code || name\](\[msg]\))
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-vars -->
|
||||
|
||||
```js
|
||||
var err = new createError.NotFound()
|
||||
```
|
||||
|
||||
- `code` - the status code as a number
|
||||
- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`.
|
||||
|
||||
#### List of all constructors
|
||||
|
||||
|Status Code|Constructor Name |
|
||||
|-----------|-----------------------------|
|
||||
|400 |BadRequest |
|
||||
|401 |Unauthorized |
|
||||
|402 |PaymentRequired |
|
||||
|403 |Forbidden |
|
||||
|404 |NotFound |
|
||||
|405 |MethodNotAllowed |
|
||||
|406 |NotAcceptable |
|
||||
|407 |ProxyAuthenticationRequired |
|
||||
|408 |RequestTimeout |
|
||||
|409 |Conflict |
|
||||
|410 |Gone |
|
||||
|411 |LengthRequired |
|
||||
|412 |PreconditionFailed |
|
||||
|413 |PayloadTooLarge |
|
||||
|414 |URITooLong |
|
||||
|415 |UnsupportedMediaType |
|
||||
|416 |RangeNotSatisfiable |
|
||||
|417 |ExpectationFailed |
|
||||
|418 |ImATeapot |
|
||||
|421 |MisdirectedRequest |
|
||||
|422 |UnprocessableEntity |
|
||||
|423 |Locked |
|
||||
|424 |FailedDependency |
|
||||
|425 |UnorderedCollection |
|
||||
|426 |UpgradeRequired |
|
||||
|428 |PreconditionRequired |
|
||||
|429 |TooManyRequests |
|
||||
|431 |RequestHeaderFieldsTooLarge |
|
||||
|451 |UnavailableForLegalReasons |
|
||||
|500 |InternalServerError |
|
||||
|501 |NotImplemented |
|
||||
|502 |BadGateway |
|
||||
|503 |ServiceUnavailable |
|
||||
|504 |GatewayTimeout |
|
||||
|505 |HTTPVersionNotSupported |
|
||||
|506 |VariantAlsoNegotiates |
|
||||
|507 |InsufficientStorage |
|
||||
|508 |LoopDetected |
|
||||
|509 |BandwidthLimitExceeded |
|
||||
|510 |NotExtended |
|
||||
|511 |NetworkAuthenticationRequired|
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/http-errors.svg
|
||||
[npm-url]: https://npmjs.org/package/http-errors
|
||||
[node-version-image]: https://img.shields.io/node/v/http-errors.svg
|
||||
[node-version-url]: https://nodejs.org/en/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/http-errors
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/http-errors
|
||||
[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg
|
||||
[downloads-url]: https://npmjs.org/package/http-errors
|
260
node_modules/serve-index/node_modules/http-errors/index.js
generated
vendored
Normal file
@ -0,0 +1,260 @@
|
||||
/*!
|
||||
* http-errors
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var deprecate = require('depd')('http-errors')
|
||||
var setPrototypeOf = require('setprototypeof')
|
||||
var statuses = require('statuses')
|
||||
var inherits = require('inherits')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = createError
|
||||
module.exports.HttpError = createHttpErrorConstructor()
|
||||
|
||||
// Populate exports for all constructors
|
||||
populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError)
|
||||
|
||||
/**
|
||||
* Get the code class of a status code.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function codeClass (status) {
|
||||
return Number(String(status).charAt(0) + '00')
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new HTTP Error.
|
||||
*
|
||||
* @returns {Error}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function createError () {
|
||||
// so much arity going on ~_~
|
||||
var err
|
||||
var msg
|
||||
var status = 500
|
||||
var props = {}
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var arg = arguments[i]
|
||||
if (arg instanceof Error) {
|
||||
err = arg
|
||||
status = err.status || err.statusCode || status
|
||||
continue
|
||||
}
|
||||
switch (typeof arg) {
|
||||
case 'string':
|
||||
msg = arg
|
||||
break
|
||||
case 'number':
|
||||
status = arg
|
||||
if (i !== 0) {
|
||||
deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)')
|
||||
}
|
||||
break
|
||||
case 'object':
|
||||
props = arg
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof status === 'number' && (status < 400 || status >= 600)) {
|
||||
deprecate('non-error status code; use only 4xx or 5xx status codes')
|
||||
}
|
||||
|
||||
if (typeof status !== 'number' ||
|
||||
(!statuses[status] && (status < 400 || status >= 600))) {
|
||||
status = 500
|
||||
}
|
||||
|
||||
// constructor
|
||||
var HttpError = createError[status] || createError[codeClass(status)]
|
||||
|
||||
if (!err) {
|
||||
// create error
|
||||
err = HttpError
|
||||
? new HttpError(msg)
|
||||
: new Error(msg || statuses[status])
|
||||
Error.captureStackTrace(err, createError)
|
||||
}
|
||||
|
||||
if (!HttpError || !(err instanceof HttpError) || err.status !== status) {
|
||||
// add properties to generic error
|
||||
err.expose = status < 500
|
||||
err.status = err.statusCode = status
|
||||
}
|
||||
|
||||
for (var key in props) {
|
||||
if (key !== 'status' && key !== 'statusCode') {
|
||||
err[key] = props[key]
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HTTP error abstract base class.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createHttpErrorConstructor () {
|
||||
function HttpError () {
|
||||
throw new TypeError('cannot construct abstract class')
|
||||
}
|
||||
|
||||
inherits(HttpError, Error)
|
||||
|
||||
return HttpError
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a constructor for a client error.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createClientErrorConstructor (HttpError, name, code) {
|
||||
var className = name.match(/Error$/) ? name : name + 'Error'
|
||||
|
||||
function ClientError (message) {
|
||||
// create the error object
|
||||
var msg = message != null ? message : statuses[code]
|
||||
var err = new Error(msg)
|
||||
|
||||
// capture a stack trace to the construction point
|
||||
Error.captureStackTrace(err, ClientError)
|
||||
|
||||
// adjust the [[Prototype]]
|
||||
setPrototypeOf(err, ClientError.prototype)
|
||||
|
||||
// redefine the error message
|
||||
Object.defineProperty(err, 'message', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
value: msg,
|
||||
writable: true
|
||||
})
|
||||
|
||||
// redefine the error name
|
||||
Object.defineProperty(err, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: className,
|
||||
writable: true
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
inherits(ClientError, HttpError)
|
||||
|
||||
ClientError.prototype.status = code
|
||||
ClientError.prototype.statusCode = code
|
||||
ClientError.prototype.expose = true
|
||||
|
||||
return ClientError
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a constructor for a server error.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createServerErrorConstructor (HttpError, name, code) {
|
||||
var className = name.match(/Error$/) ? name : name + 'Error'
|
||||
|
||||
function ServerError (message) {
|
||||
// create the error object
|
||||
var msg = message != null ? message : statuses[code]
|
||||
var err = new Error(msg)
|
||||
|
||||
// capture a stack trace to the construction point
|
||||
Error.captureStackTrace(err, ServerError)
|
||||
|
||||
// adjust the [[Prototype]]
|
||||
setPrototypeOf(err, ServerError.prototype)
|
||||
|
||||
// redefine the error message
|
||||
Object.defineProperty(err, 'message', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
value: msg,
|
||||
writable: true
|
||||
})
|
||||
|
||||
// redefine the error name
|
||||
Object.defineProperty(err, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: className,
|
||||
writable: true
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
inherits(ServerError, HttpError)
|
||||
|
||||
ServerError.prototype.status = code
|
||||
ServerError.prototype.statusCode = code
|
||||
ServerError.prototype.expose = false
|
||||
|
||||
return ServerError
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the exports object with constructors for every error class.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function populateConstructorExports (exports, codes, HttpError) {
|
||||
codes.forEach(function forEachCode (code) {
|
||||
var CodeError
|
||||
var name = toIdentifier(statuses[code])
|
||||
|
||||
switch (codeClass(code)) {
|
||||
case 400:
|
||||
CodeError = createClientErrorConstructor(HttpError, name, code)
|
||||
break
|
||||
case 500:
|
||||
CodeError = createServerErrorConstructor(HttpError, name, code)
|
||||
break
|
||||
}
|
||||
|
||||
if (CodeError) {
|
||||
// export the constructor
|
||||
exports[code] = CodeError
|
||||
exports[name] = CodeError
|
||||
}
|
||||
})
|
||||
|
||||
// backwards-compatibility
|
||||
exports["I'mateapot"] = deprecate.function(exports.ImATeapot,
|
||||
'"I\'mateapot"; use "ImATeapot" instead')
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a string of words to a JavaScript identifier.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function toIdentifier (str) {
|
||||
return str.split(' ').map(function (token) {
|
||||
return token.slice(0, 1).toUpperCase() + token.slice(1)
|
||||
}).join('').replace(/[^ _0-9a-z]/gi, '')
|
||||
}
|
90
node_modules/serve-index/node_modules/http-errors/package.json
generated
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
"_from": "http-errors@~1.6.2",
|
||||
"_id": "http-errors@1.6.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
|
||||
"_location": "/serve-index/http-errors",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "http-errors@~1.6.2",
|
||||
"name": "http-errors",
|
||||
"escapedName": "http-errors",
|
||||
"rawSpec": "~1.6.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~1.6.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/serve-index"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
|
||||
"_shasum": "8b55680bb4be283a0b5bf4ea2e38580be1d9320d",
|
||||
"_spec": "http-errors@~1.6.2",
|
||||
"_where": "/home/outis/Documents/Sites/BBB/node_modules/serve-index",
|
||||
"author": {
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/http-errors/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Alan Plum",
|
||||
"email": "me@pluma.io"
|
||||
},
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"depd": "~1.1.2",
|
||||
"inherits": "2.0.3",
|
||||
"setprototypeof": "1.1.0",
|
||||
"statuses": ">= 1.4.0 < 2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Create HTTP error objects",
|
||||
"devDependencies": {
|
||||
"eslint": "4.18.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.9.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.6.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "1.21.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"homepage": "https://github.com/jshttp/http-errors#readme",
|
||||
"keywords": [
|
||||
"http",
|
||||
"error"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "http-errors",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/http-errors.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --bail",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
|
||||
},
|
||||
"version": "1.6.3"
|
||||
}
|
16
node_modules/serve-index/node_modules/inherits/LICENSE
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
|
42
node_modules/serve-index/node_modules/inherits/README.md
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
Browser-friendly inheritance fully compatible with standard node.js
|
||||
[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
|
||||
|
||||
This package exports standard `inherits` from node.js `util` module in
|
||||
node environment, but also provides alternative browser-friendly
|
||||
implementation through [browser
|
||||
field](https://gist.github.com/shtylman/4339901). Alternative
|
||||
implementation is a literal copy of standard one located in standalone
|
||||
module to avoid requiring of `util`. It also has a shim for old
|
||||
browsers with no `Object.create` support.
|
||||
|
||||
While keeping you sure you are using standard `inherits`
|
||||
implementation in node.js environment, it allows bundlers such as
|
||||
[browserify](https://github.com/substack/node-browserify) to not
|
||||
include full `util` package to your client code if all you need is
|
||||
just `inherits` function. It worth, because browser shim for `util`
|
||||
package is large and `inherits` is often the single function you need
|
||||
from it.
|
||||
|
||||
It's recommended to use this package instead of
|
||||
`require('util').inherits` for any code that has chances to be used
|
||||
not only in node.js but in browser too.
|
||||
|
||||
## usage
|
||||
|
||||
```js
|
||||
var inherits = require('inherits');
|
||||
// then use exactly as the standard one
|
||||
```
|
||||
|
||||
## note on version ~1.0
|
||||
|
||||
Version ~1.0 had completely different motivation and is not compatible
|
||||
neither with 2.0 nor with standard node.js `inherits`.
|
||||
|
||||
If you are using version ~1.0 and planning to switch to ~2.0, be
|
||||
careful:
|
||||
|
||||
* new version uses `super_` instead of `super` for referencing
|
||||
superclass
|
||||
* new version overwrites current prototype while old one preserves any
|
||||
existing fields on it
|
7
node_modules/serve-index/node_modules/inherits/inherits.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
try {
|
||||
var util = require('util');
|
||||
if (typeof util.inherits !== 'function') throw '';
|
||||
module.exports = util.inherits;
|
||||
} catch (e) {
|
||||
module.exports = require('./inherits_browser.js');
|
||||
}
|
23
node_modules/serve-index/node_modules/inherits/inherits_browser.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
if (typeof Object.create === 'function') {
|
||||
// implementation from standard node.js 'util' module
|
||||
module.exports = function inherits(ctor, superCtor) {
|
||||
ctor.super_ = superCtor
|
||||
ctor.prototype = Object.create(superCtor.prototype, {
|
||||
constructor: {
|
||||
value: ctor,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
};
|
||||
} else {
|
||||
// old school shim for old browsers
|
||||
module.exports = function inherits(ctor, superCtor) {
|
||||
ctor.super_ = superCtor
|
||||
var TempCtor = function () {}
|
||||
TempCtor.prototype = superCtor.prototype
|
||||
ctor.prototype = new TempCtor()
|
||||
ctor.prototype.constructor = ctor
|
||||
}
|
||||
}
|
61
node_modules/serve-index/node_modules/inherits/package.json
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"_from": "inherits@2.0.3",
|
||||
"_id": "inherits@2.0.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
||||
"_location": "/serve-index/inherits",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "inherits@2.0.3",
|
||||
"name": "inherits",
|
||||
"escapedName": "inherits",
|
||||
"rawSpec": "2.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/serve-index/http-errors"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"_shasum": "633c2c83e3da42a502f52466022480f4208261de",
|
||||
"_spec": "inherits@2.0.3",
|
||||
"_where": "/home/outis/Documents/Sites/BBB/node_modules/serve-index/node_modules/http-errors",
|
||||
"browser": "./inherits_browser.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/inherits/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
|
||||
"devDependencies": {
|
||||
"tap": "^7.1.0"
|
||||
},
|
||||
"files": [
|
||||
"inherits.js",
|
||||
"inherits_browser.js"
|
||||
],
|
||||
"homepage": "https://github.com/isaacs/inherits#readme",
|
||||
"keywords": [
|
||||
"inheritance",
|
||||
"class",
|
||||
"klass",
|
||||
"oop",
|
||||
"object-oriented",
|
||||
"inherits",
|
||||
"browser",
|
||||
"browserify"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "./inherits.js",
|
||||
"name": "inherits",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/inherits.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"version": "2.0.3"
|
||||
}
|
13
node_modules/serve-index/node_modules/setprototypeof/LICENSE
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
Copyright (c) 2015, Wes Todd
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
26
node_modules/serve-index/node_modules/setprototypeof/README.md
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
# Polyfill for `Object.setPrototypeOf`
|
||||
|
||||
A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8.
|
||||
|
||||
## Usage:
|
||||
|
||||
```
|
||||
$ npm install --save setprototypeof
|
||||
```
|
||||
|
||||
```javascript
|
||||
var setPrototypeOf = require('setprototypeof');
|
||||
|
||||
var obj = {};
|
||||
setPrototypeOf(obj, {
|
||||
foo: function() {
|
||||
return 'bar';
|
||||
}
|
||||
});
|
||||
obj.foo(); // bar
|
||||
```
|
||||
|
||||
TypeScript is also supported:
|
||||
```typescript
|
||||
import setPrototypeOf = require('setprototypeof');
|
||||
```
|
2
node_modules/serve-index/node_modules/setprototypeof/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
declare function setPrototypeOf(o: any, proto: object | null): any;
|
||||
export = setPrototypeOf;
|
15
node_modules/serve-index/node_modules/setprototypeof/index.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
module.exports = Object.setPrototypeOf || ({__proto__:[]} instanceof Array ? setProtoOf : mixinProperties);
|
||||
|
||||
function setProtoOf(obj, proto) {
|
||||
obj.__proto__ = proto;
|
||||
return obj;
|
||||
}
|
||||
|
||||
function mixinProperties(obj, proto) {
|
||||
for (var prop in proto) {
|
||||
if (!obj.hasOwnProperty(prop)) {
|
||||
obj[prop] = proto[prop];
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
52
node_modules/serve-index/node_modules/setprototypeof/package.json
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"_from": "setprototypeof@1.1.0",
|
||||
"_id": "setprototypeof@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==",
|
||||
"_location": "/serve-index/setprototypeof",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "setprototypeof@1.1.0",
|
||||
"name": "setprototypeof",
|
||||
"escapedName": "setprototypeof",
|
||||
"rawSpec": "1.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/serve-index/http-errors"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
|
||||
"_shasum": "d0bd85536887b6fe7c0d818cb962d9d91c54e656",
|
||||
"_spec": "setprototypeof@1.1.0",
|
||||
"_where": "/home/outis/Documents/Sites/BBB/node_modules/serve-index/node_modules/http-errors",
|
||||
"author": {
|
||||
"name": "Wes Todd"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/wesleytodd/setprototypeof/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "A small polyfill for Object.setprototypeof",
|
||||
"homepage": "https://github.com/wesleytodd/setprototypeof",
|
||||
"keywords": [
|
||||
"polyfill",
|
||||
"object",
|
||||
"setprototypeof"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
"name": "setprototypeof",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/wesleytodd/setprototypeof.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"typings": "index.d.ts",
|
||||
"version": "1.1.0"
|
||||
}
|
65
node_modules/serve-index/node_modules/statuses/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
1.5.0 / 2018-03-27
|
||||
==================
|
||||
|
||||
* Add `103 Early Hints`
|
||||
|
||||
1.4.0 / 2017-10-20
|
||||
==================
|
||||
|
||||
* Add `STATUS_CODES` export
|
||||
|
||||
1.3.1 / 2016-11-11
|
||||
==================
|
||||
|
||||
* Fix return type in JSDoc
|
||||
|
||||
1.3.0 / 2016-05-17
|
||||
==================
|
||||
|
||||
* Add `421 Misdirected Request`
|
||||
* perf: enable strict mode
|
||||
|
||||
1.2.1 / 2015-02-01
|
||||
==================
|
||||
|
||||
* Fix message for status 451
|
||||
- `451 Unavailable For Legal Reasons`
|
||||
|
||||
1.2.0 / 2014-09-28
|
||||
==================
|
||||
|
||||
* Add `208 Already Repored`
|
||||
* Add `226 IM Used`
|
||||
* Add `306 (Unused)`
|
||||
* Add `415 Unable For Legal Reasons`
|
||||
* Add `508 Loop Detected`
|
||||
|
||||
1.1.1 / 2014-09-24
|
||||
==================
|
||||
|
||||
* Add missing 308 to `codes.json`
|
||||
|
||||
1.1.0 / 2014-09-21
|
||||
==================
|
||||
|
||||
* Add `codes.json` for universal support
|
||||
|
||||
1.0.4 / 2014-08-20
|
||||
==================
|
||||
|
||||
* Package cleanup
|
||||
|
||||
1.0.3 / 2014-06-08
|
||||
==================
|
||||
|
||||
* Add 308 to `.redirect` category
|
||||
|
||||
1.0.2 / 2014-03-13
|
||||
==================
|
||||
|
||||
* Add `.retry` category
|
||||
|
||||
1.0.1 / 2014-03-12
|
||||
==================
|
||||
|
||||
* Initial release
|
23
node_modules/serve-index/node_modules/statuses/LICENSE
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2016 Douglas Christopher Wilson <doug@somethingdoug.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
127
node_modules/serve-index/node_modules/statuses/README.md
generated
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
# Statuses
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
HTTP status utility for node.
|
||||
|
||||
This module provides a list of status codes and messages sourced from
|
||||
a few different projects:
|
||||
|
||||
* The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
|
||||
* The [Node.js project](https://nodejs.org/)
|
||||
* The [NGINX project](https://www.nginx.com/)
|
||||
* The [Apache HTTP Server project](https://httpd.apache.org/)
|
||||
|
||||
## Installation
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install statuses
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var status = require('statuses')
|
||||
```
|
||||
|
||||
### var code = status(Integer || String)
|
||||
|
||||
If `Integer` or `String` is a valid HTTP code or status message, then the
|
||||
appropriate `code` will be returned. Otherwise, an error will be thrown.
|
||||
|
||||
<!-- eslint-disable no-undef -->
|
||||
|
||||
```js
|
||||
status(403) // => 403
|
||||
status('403') // => 403
|
||||
status('forbidden') // => 403
|
||||
status('Forbidden') // => 403
|
||||
status(306) // throws, as it's not supported by node.js
|
||||
```
|
||||
|
||||
### status.STATUS_CODES
|
||||
|
||||
Returns an object which maps status codes to status messages, in
|
||||
the same format as the
|
||||
[Node.js http module](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).
|
||||
|
||||
### status.codes
|
||||
|
||||
Returns an array of all the status codes as `Integer`s.
|
||||
|
||||
### var msg = status[code]
|
||||
|
||||
Map of `code` to `status message`. `undefined` for invalid `code`s.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status[404] // => 'Not Found'
|
||||
```
|
||||
|
||||
### var code = status[msg]
|
||||
|
||||
Map of `status message` to `code`. `msg` can either be title-cased or
|
||||
lower-cased. `undefined` for invalid `status message`s.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status['not found'] // => 404
|
||||
status['Not Found'] // => 404
|
||||
```
|
||||
|
||||
### status.redirect[code]
|
||||
|
||||
Returns `true` if a status code is a valid redirect status.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.redirect[200] // => undefined
|
||||
status.redirect[301] // => true
|
||||
```
|
||||
|
||||
### status.empty[code]
|
||||
|
||||
Returns `true` if a status code expects an empty body.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.empty[200] // => undefined
|
||||
status.empty[204] // => true
|
||||
status.empty[304] // => true
|
||||
```
|
||||
|
||||
### status.retry[code]
|
||||
|
||||
Returns `true` if you should retry the rest.
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-expressions -->
|
||||
|
||||
```js
|
||||
status.retry[501] // => undefined
|
||||
status.retry[503] // => true
|
||||
```
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/statuses.svg
|
||||
[npm-url]: https://npmjs.org/package/statuses
|
||||
[node-version-image]: https://img.shields.io/node/v/statuses.svg
|
||||
[node-version-url]: https://nodejs.org/en/download
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/statuses
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/statuses.svg
|
||||
[downloads-url]: https://npmjs.org/package/statuses
|
66
node_modules/serve-index/node_modules/statuses/codes.json
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
{
|
||||
"100": "Continue",
|
||||
"101": "Switching Protocols",
|
||||
"102": "Processing",
|
||||
"103": "Early Hints",
|
||||
"200": "OK",
|
||||
"201": "Created",
|
||||
"202": "Accepted",
|
||||
"203": "Non-Authoritative Information",
|
||||
"204": "No Content",
|
||||
"205": "Reset Content",
|
||||
"206": "Partial Content",
|
||||
"207": "Multi-Status",
|
||||
"208": "Already Reported",
|
||||
"226": "IM Used",
|
||||
"300": "Multiple Choices",
|
||||
"301": "Moved Permanently",
|
||||
"302": "Found",
|
||||
"303": "See Other",
|
||||
"304": "Not Modified",
|
||||
"305": "Use Proxy",
|
||||
"306": "(Unused)",
|
||||
"307": "Temporary Redirect",
|
||||
"308": "Permanent Redirect",
|
||||
"400": "Bad Request",
|
||||
"401": "Unauthorized",
|
||||
"402": "Payment Required",
|
||||
"403": "Forbidden",
|
||||
"404": "Not Found",
|
||||
"405": "Method Not Allowed",
|
||||
"406": "Not Acceptable",
|
||||
"407": "Proxy Authentication Required",
|
||||
"408": "Request Timeout",
|
||||
"409": "Conflict",
|
||||
"410": "Gone",
|
||||
"411": "Length Required",
|
||||
"412": "Precondition Failed",
|
||||
"413": "Payload Too Large",
|
||||
"414": "URI Too Long",
|
||||
"415": "Unsupported Media Type",
|
||||
"416": "Range Not Satisfiable",
|
||||
"417": "Expectation Failed",
|
||||
"418": "I'm a teapot",
|
||||
"421": "Misdirected Request",
|
||||
"422": "Unprocessable Entity",
|
||||
"423": "Locked",
|
||||
"424": "Failed Dependency",
|
||||
"425": "Unordered Collection",
|
||||
"426": "Upgrade Required",
|
||||
"428": "Precondition Required",
|
||||
"429": "Too Many Requests",
|
||||
"431": "Request Header Fields Too Large",
|
||||
"451": "Unavailable For Legal Reasons",
|
||||
"500": "Internal Server Error",
|
||||
"501": "Not Implemented",
|
||||
"502": "Bad Gateway",
|
||||
"503": "Service Unavailable",
|
||||
"504": "Gateway Timeout",
|
||||
"505": "HTTP Version Not Supported",
|
||||
"506": "Variant Also Negotiates",
|
||||
"507": "Insufficient Storage",
|
||||
"508": "Loop Detected",
|
||||
"509": "Bandwidth Limit Exceeded",
|
||||
"510": "Not Extended",
|
||||
"511": "Network Authentication Required"
|
||||
}
|
113
node_modules/serve-index/node_modules/statuses/index.js
generated
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
/*!
|
||||
* statuses
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var codes = require('./codes.json')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = status
|
||||
|
||||
// status code to message map
|
||||
status.STATUS_CODES = codes
|
||||
|
||||
// array of status codes
|
||||
status.codes = populateStatusesMap(status, codes)
|
||||
|
||||
// status codes for redirects
|
||||
status.redirect = {
|
||||
300: true,
|
||||
301: true,
|
||||
302: true,
|
||||
303: true,
|
||||
305: true,
|
||||
307: true,
|
||||
308: true
|
||||
}
|
||||
|
||||
// status codes for empty bodies
|
||||
status.empty = {
|
||||
204: true,
|
||||
205: true,
|
||||
304: true
|
||||
}
|
||||
|
||||
// status codes for when you should retry the request
|
||||
status.retry = {
|
||||
502: true,
|
||||
503: true,
|
||||
504: true
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the statuses map for given codes.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function populateStatusesMap (statuses, codes) {
|
||||
var arr = []
|
||||
|
||||
Object.keys(codes).forEach(function forEachCode (code) {
|
||||
var message = codes[code]
|
||||
var status = Number(code)
|
||||
|
||||
// Populate properties
|
||||
statuses[status] = message
|
||||
statuses[message] = status
|
||||
statuses[message.toLowerCase()] = status
|
||||
|
||||
// Add to array
|
||||
arr.push(status)
|
||||
})
|
||||
|
||||
return arr
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the status code.
|
||||
*
|
||||
* Given a number, this will throw if it is not a known status
|
||||
* code, otherwise the code will be returned. Given a string,
|
||||
* the string will be parsed for a number and return the code
|
||||
* if valid, otherwise will lookup the code assuming this is
|
||||
* the status message.
|
||||
*
|
||||
* @param {string|number} code
|
||||
* @returns {number}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function status (code) {
|
||||
if (typeof code === 'number') {
|
||||
if (!status[code]) throw new Error('invalid status code: ' + code)
|
||||
return code
|
||||
}
|
||||
|
||||
if (typeof code !== 'string') {
|
||||
throw new TypeError('code must be a number or string')
|
||||
}
|
||||
|
||||
// '403'
|
||||
var n = parseInt(code, 10)
|
||||
if (!isNaN(n)) {
|
||||
if (!status[n]) throw new Error('invalid status code: ' + n)
|
||||
return n
|
||||
}
|
||||
|
||||
n = status[code.toLowerCase()]
|
||||
if (!n) throw new Error('invalid status message: "' + code + '"')
|
||||
return n
|
||||
}
|
87
node_modules/serve-index/node_modules/statuses/package.json
generated
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"_from": "statuses@>= 1.4.0 < 2",
|
||||
"_id": "statuses@1.5.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
|
||||
"_location": "/serve-index/statuses",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "statuses@>= 1.4.0 < 2",
|
||||
"name": "statuses",
|
||||
"escapedName": "statuses",
|
||||
"rawSpec": ">= 1.4.0 < 2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": ">= 1.4.0 < 2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/serve-index/http-errors"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
||||
"_shasum": "161c7dac177659fd9811f43771fa99381478628c",
|
||||
"_spec": "statuses@>= 1.4.0 < 2",
|
||||
"_where": "/home/outis/Documents/Sites/BBB/node_modules/serve-index/node_modules/http-errors",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/statuses/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
}
|
||||
],
|
||||
"deprecated": false,
|
||||
"description": "HTTP status utility",
|
||||
"devDependencies": {
|
||||
"csv-parse": "1.2.4",
|
||||
"eslint": "4.19.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.9.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.7.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "1.21.5",
|
||||
"raw-body": "2.3.2",
|
||||
"stream-to-array": "2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"index.js",
|
||||
"codes.json",
|
||||
"LICENSE"
|
||||
],
|
||||
"homepage": "https://github.com/jshttp/statuses#readme",
|
||||
"keywords": [
|
||||
"http",
|
||||
"status",
|
||||
"code"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "statuses",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshttp/statuses.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js",
|
||||
"fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js",
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --check-leaks --bail test/",
|
||||
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
||||
"update": "npm run fetch && npm run build"
|
||||
},
|
||||
"version": "1.5.0"
|
||||
}
|
74
node_modules/serve-index/package.json
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"_from": "serve-index@1.9.1",
|
||||
"_id": "serve-index@1.9.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=",
|
||||
"_location": "/serve-index",
|
||||
"_phantomChildren": {
|
||||
"depd": "1.1.2"
|
||||
},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "serve-index@1.9.1",
|
||||
"name": "serve-index",
|
||||
"escapedName": "serve-index",
|
||||
"rawSpec": "1.9.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.9.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/browser-sync"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",
|
||||
"_shasum": "d3768d69b1e7d82e5ce050fff5b453bea12a9239",
|
||||
"_spec": "serve-index@1.9.1",
|
||||
"_where": "/home/outis/Documents/Sites/BBB/node_modules/browser-sync",
|
||||
"author": {
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/expressjs/serve-index/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.4",
|
||||
"batch": "0.6.1",
|
||||
"debug": "2.6.9",
|
||||
"escape-html": "~1.0.3",
|
||||
"http-errors": "~1.6.2",
|
||||
"mime-types": "~2.1.17",
|
||||
"parseurl": "~1.3.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Serve directory listings",
|
||||
"devDependencies": {
|
||||
"after": "0.8.2",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "2.5.3",
|
||||
"supertest": "1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
},
|
||||
"files": [
|
||||
"public/",
|
||||
"LICENSE",
|
||||
"HISTORY.md",
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/expressjs/serve-index#readme",
|
||||
"license": "MIT",
|
||||
"name": "serve-index",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/expressjs/serve-index.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --reporter spec --bail --check-leaks test/",
|
||||
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
|
||||
},
|
||||
"version": "1.9.1"
|
||||
}
|
82
node_modules/serve-index/public/directory.html
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<title>listing directory {directory}</title>
|
||||
<style>{style}</style>
|
||||
<script>
|
||||
function $(id){
|
||||
var el = 'string' == typeof id
|
||||
? document.getElementById(id)
|
||||
: id;
|
||||
|
||||
el.on = function(event, fn){
|
||||
if ('content loaded' == event) {
|
||||
event = window.attachEvent ? "load" : "DOMContentLoaded";
|
||||
}
|
||||
el.addEventListener
|
||||
? el.addEventListener(event, fn, false)
|
||||
: el.attachEvent("on" + event, fn);
|
||||
};
|
||||
|
||||
el.all = function(selector){
|
||||
return $(el.querySelectorAll(selector));
|
||||
};
|
||||
|
||||
el.each = function(fn){
|
||||
for (var i = 0, len = el.length; i < len; ++i) {
|
||||
fn($(el[i]), i);
|
||||
}
|
||||
};
|
||||
|
||||
el.getClasses = function(){
|
||||
return this.getAttribute('class').split(/\s+/);
|
||||
};
|
||||
|
||||
el.addClass = function(name){
|
||||
var classes = this.getAttribute('class');
|
||||
el.setAttribute('class', classes
|
||||
? classes + ' ' + name
|
||||
: name);
|
||||
};
|
||||
|
||||
el.removeClass = function(name){
|
||||
var classes = this.getClasses().filter(function(curr){
|
||||
return curr != name;
|
||||
});
|
||||
this.setAttribute('class', classes.join(' '));
|
||||
};
|
||||
|
||||
return el;
|
||||
}
|
||||
|
||||
function search() {
|
||||
var str = $('search').value.toLowerCase();
|
||||
var links = $('files').all('a');
|
||||
|
||||
links.each(function(link){
|
||||
var text = link.textContent.toLowerCase();
|
||||
|
||||
if ('..' == text) return;
|
||||
if (str.length && ~text.indexOf(str)) {
|
||||
link.addClass('highlight');
|
||||
} else {
|
||||
link.removeClass('highlight');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(window).on('content loaded', function(){
|
||||
$('search').on('keyup', search);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="directory">
|
||||
<input id="search" type="text" placeholder="Search" autocomplete="off" />
|
||||
<div id="wrapper">
|
||||
<h1><a href="/">~</a>{linked-path}</h1>
|
||||
{files}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
node_modules/serve-index/public/icons/application_xp.png
generated
vendored
Normal file
After Width: | Height: | Size: 426 B |
BIN
node_modules/serve-index/public/icons/application_xp_terminal.png
generated
vendored
Normal file
After Width: | Height: | Size: 507 B |
BIN
node_modules/serve-index/public/icons/box.png
generated
vendored
Normal file
After Width: | Height: | Size: 555 B |
BIN
node_modules/serve-index/public/icons/cd.png
generated
vendored
Normal file
After Width: | Height: | Size: 673 B |
BIN
node_modules/serve-index/public/icons/controller.png
generated
vendored
Normal file
After Width: | Height: | Size: 666 B |
BIN
node_modules/serve-index/public/icons/drive.png
generated
vendored
Normal file
After Width: | Height: | Size: 346 B |
BIN
node_modules/serve-index/public/icons/film.png
generated
vendored
Normal file
After Width: | Height: | Size: 653 B |
BIN
node_modules/serve-index/public/icons/folder.png
generated
vendored
Normal file
After Width: | Height: | Size: 634 B |
BIN
node_modules/serve-index/public/icons/font.png
generated
vendored
Normal file
After Width: | Height: | Size: 567 B |
BIN
node_modules/serve-index/public/icons/image.png
generated
vendored
Normal file
After Width: | Height: | Size: 516 B |
BIN
node_modules/serve-index/public/icons/map.png
generated
vendored
Normal file
After Width: | Height: | Size: 804 B |
BIN
node_modules/serve-index/public/icons/page.png
generated
vendored
Normal file
After Width: | Height: | Size: 635 B |
BIN
node_modules/serve-index/public/icons/page_add.png
generated
vendored
Normal file
After Width: | Height: | Size: 739 B |
BIN
node_modules/serve-index/public/icons/page_attach.png
generated
vendored
Normal file
After Width: | Height: | Size: 794 B |
BIN
node_modules/serve-index/public/icons/page_code.png
generated
vendored
Normal file
After Width: | Height: | Size: 818 B |
BIN
node_modules/serve-index/public/icons/page_copy.png
generated
vendored
Normal file
After Width: | Height: | Size: 663 B |
BIN
node_modules/serve-index/public/icons/page_delete.png
generated
vendored
Normal file
After Width: | Height: | Size: 740 B |
BIN
node_modules/serve-index/public/icons/page_edit.png
generated
vendored
Normal file
After Width: | Height: | Size: 807 B |
BIN
node_modules/serve-index/public/icons/page_error.png
generated
vendored
Normal file
After Width: | Height: | Size: 793 B |
BIN
node_modules/serve-index/public/icons/page_excel.png
generated
vendored
Normal file
After Width: | Height: | Size: 817 B |
BIN
node_modules/serve-index/public/icons/page_find.png
generated
vendored
Normal file
After Width: | Height: | Size: 879 B |
BIN
node_modules/serve-index/public/icons/page_gear.png
generated
vendored
Normal file
After Width: | Height: | Size: 833 B |
BIN
node_modules/serve-index/public/icons/page_go.png
generated
vendored
Normal file
After Width: | Height: | Size: 779 B |
BIN
node_modules/serve-index/public/icons/page_green.png
generated
vendored
Normal file
After Width: | Height: | Size: 621 B |
BIN
node_modules/serve-index/public/icons/page_key.png
generated
vendored
Normal file
After Width: | Height: | Size: 801 B |
BIN
node_modules/serve-index/public/icons/page_lightning.png
generated
vendored
Normal file
After Width: | Height: | Size: 839 B |
BIN
node_modules/serve-index/public/icons/page_link.png
generated
vendored
Normal file
After Width: | Height: | Size: 830 B |
BIN
node_modules/serve-index/public/icons/page_paintbrush.png
generated
vendored
Normal file
After Width: | Height: | Size: 813 B |
BIN
node_modules/serve-index/public/icons/page_paste.png
generated
vendored
Normal file
After Width: | Height: | Size: 703 B |
BIN
node_modules/serve-index/public/icons/page_red.png
generated
vendored
Normal file
After Width: | Height: | Size: 641 B |
BIN
node_modules/serve-index/public/icons/page_refresh.png
generated
vendored
Normal file
After Width: | Height: | Size: 858 B |
BIN
node_modules/serve-index/public/icons/page_save.png
generated
vendored
Normal file
After Width: | Height: | Size: 774 B |
BIN
node_modules/serve-index/public/icons/page_white.png
generated
vendored
Normal file
After Width: | Height: | Size: 294 B |
BIN
node_modules/serve-index/public/icons/page_white_acrobat.png
generated
vendored
Normal file
After Width: | Height: | Size: 591 B |
BIN
node_modules/serve-index/public/icons/page_white_actionscript.png
generated
vendored
Normal file
After Width: | Height: | Size: 664 B |
BIN
node_modules/serve-index/public/icons/page_white_add.png
generated
vendored
Normal file
After Width: | Height: | Size: 512 B |
BIN
node_modules/serve-index/public/icons/page_white_c.png
generated
vendored
Normal file
After Width: | Height: | Size: 587 B |
BIN
node_modules/serve-index/public/icons/page_white_camera.png
generated
vendored
Normal file
After Width: | Height: | Size: 656 B |
BIN
node_modules/serve-index/public/icons/page_white_cd.png
generated
vendored
Normal file
After Width: | Height: | Size: 666 B |
BIN
node_modules/serve-index/public/icons/page_white_code.png
generated
vendored
Normal file
After Width: | Height: | Size: 603 B |
BIN
node_modules/serve-index/public/icons/page_white_code_red.png
generated
vendored
Normal file
After Width: | Height: | Size: 587 B |
BIN
node_modules/serve-index/public/icons/page_white_coldfusion.png
generated
vendored
Normal file
After Width: | Height: | Size: 592 B |
BIN
node_modules/serve-index/public/icons/page_white_compressed.png
generated
vendored
Normal file
After Width: | Height: | Size: 724 B |
BIN
node_modules/serve-index/public/icons/page_white_copy.png
generated
vendored
Normal file
After Width: | Height: | Size: 309 B |
BIN
node_modules/serve-index/public/icons/page_white_cplusplus.png
generated
vendored
Normal file
After Width: | Height: | Size: 621 B |
BIN
node_modules/serve-index/public/icons/page_white_csharp.png
generated
vendored
Normal file
After Width: | Height: | Size: 700 B |
BIN
node_modules/serve-index/public/icons/page_white_cup.png
generated
vendored
Normal file
After Width: | Height: | Size: 639 B |
BIN
node_modules/serve-index/public/icons/page_white_database.png
generated
vendored
Normal file
After Width: | Height: | Size: 579 B |
BIN
node_modules/serve-index/public/icons/page_white_delete.png
generated
vendored
Normal file
After Width: | Height: | Size: 536 B |
BIN
node_modules/serve-index/public/icons/page_white_dvd.png
generated
vendored
Normal file
After Width: | Height: | Size: 638 B |
BIN
node_modules/serve-index/public/icons/page_white_edit.png
generated
vendored
Normal file
After Width: | Height: | Size: 618 B |
BIN
node_modules/serve-index/public/icons/page_white_error.png
generated
vendored
Normal file
After Width: | Height: | Size: 623 B |
BIN
node_modules/serve-index/public/icons/page_white_excel.png
generated
vendored
Normal file
After Width: | Height: | Size: 663 B |
BIN
node_modules/serve-index/public/icons/page_white_find.png
generated
vendored
Normal file
After Width: | Height: | Size: 676 B |
BIN
node_modules/serve-index/public/icons/page_white_flash.png
generated
vendored
Normal file
After Width: | Height: | Size: 582 B |
BIN
node_modules/serve-index/public/icons/page_white_freehand.png
generated
vendored
Normal file
After Width: | Height: | Size: 639 B |
BIN
node_modules/serve-index/public/icons/page_white_gear.png
generated
vendored
Normal file
After Width: | Height: | Size: 402 B |
BIN
node_modules/serve-index/public/icons/page_white_get.png
generated
vendored
Normal file
After Width: | Height: | Size: 516 B |
BIN
node_modules/serve-index/public/icons/page_white_go.png
generated
vendored
Normal file
After Width: | Height: | Size: 612 B |
BIN
node_modules/serve-index/public/icons/page_white_h.png
generated
vendored
Normal file
After Width: | Height: | Size: 603 B |
BIN
node_modules/serve-index/public/icons/page_white_horizontal.png
generated
vendored
Normal file
After Width: | Height: | Size: 296 B |
BIN
node_modules/serve-index/public/icons/page_white_key.png
generated
vendored
Normal file
After Width: | Height: | Size: 616 B |
BIN
node_modules/serve-index/public/icons/page_white_lightning.png
generated
vendored
Normal file
After Width: | Height: | Size: 669 B |
BIN
node_modules/serve-index/public/icons/page_white_link.png
generated
vendored
Normal file
After Width: | Height: | Size: 614 B |
BIN
node_modules/serve-index/public/icons/page_white_magnify.png
generated
vendored
Normal file
After Width: | Height: | Size: 554 B |
BIN
node_modules/serve-index/public/icons/page_white_medal.png
generated
vendored
Normal file
After Width: | Height: | Size: 706 B |
BIN
node_modules/serve-index/public/icons/page_white_office.png
generated
vendored
Normal file
After Width: | Height: | Size: 779 B |
BIN
node_modules/serve-index/public/icons/page_white_paint.png
generated
vendored
Normal file
After Width: | Height: | Size: 688 B |
BIN
node_modules/serve-index/public/icons/page_white_paintbrush.png
generated
vendored
Normal file
After Width: | Height: | Size: 618 B |
BIN
node_modules/serve-index/public/icons/page_white_paste.png
generated
vendored
Normal file
After Width: | Height: | Size: 620 B |
BIN
node_modules/serve-index/public/icons/page_white_php.png
generated
vendored
Normal file
After Width: | Height: | Size: 538 B |
BIN
node_modules/serve-index/public/icons/page_white_picture.png
generated
vendored
Normal file
After Width: | Height: | Size: 650 B |
BIN
node_modules/serve-index/public/icons/page_white_powerpoint.png
generated
vendored
Normal file
After Width: | Height: | Size: 588 B |