mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Updated some dependencies and package.json
This commit is contained in:
221
server/node_modules/express/node_modules/send/History.md
generated
vendored
221
server/node_modules/express/node_modules/send/History.md
generated
vendored
@@ -1,221 +0,0 @@
|
||||
0.10.1 / 2014-10-22
|
||||
===================
|
||||
|
||||
* deps: on-finished@~2.1.1
|
||||
- Fix handling of pipelined requests
|
||||
|
||||
0.10.0 / 2014-10-15
|
||||
===================
|
||||
|
||||
* deps: debug@~2.1.0
|
||||
- Implement `DEBUG_FD` env variable support
|
||||
* deps: depd@~1.0.0
|
||||
* deps: etag@~1.5.0
|
||||
- Improve string performance
|
||||
- Slightly improve speed for weak ETags over 1KB
|
||||
|
||||
0.9.3 / 2014-09-24
|
||||
==================
|
||||
|
||||
* deps: etag@~1.4.0
|
||||
- Support "fake" stats objects
|
||||
|
||||
0.9.2 / 2014-09-15
|
||||
==================
|
||||
|
||||
* deps: depd@0.4.5
|
||||
* deps: etag@~1.3.1
|
||||
* deps: range-parser@~1.0.2
|
||||
|
||||
0.9.1 / 2014-09-07
|
||||
==================
|
||||
|
||||
* deps: fresh@0.2.4
|
||||
|
||||
0.9.0 / 2014-09-07
|
||||
==================
|
||||
|
||||
* Add `lastModified` option
|
||||
* Use `etag` to generate `ETag` header
|
||||
* deps: debug@~2.0.0
|
||||
|
||||
0.8.5 / 2014-09-04
|
||||
==================
|
||||
|
||||
* Fix malicious path detection for empty string path
|
||||
|
||||
0.8.4 / 2014-09-04
|
||||
==================
|
||||
|
||||
* Fix a path traversal issue when using `root`
|
||||
|
||||
0.8.3 / 2014-08-16
|
||||
==================
|
||||
|
||||
* deps: destroy@1.0.3
|
||||
- renamed from dethroy
|
||||
* deps: on-finished@2.1.0
|
||||
|
||||
0.8.2 / 2014-08-14
|
||||
==================
|
||||
|
||||
* Work around `fd` leak in Node.js 0.10 for `fs.ReadStream`
|
||||
* deps: dethroy@1.0.2
|
||||
|
||||
0.8.1 / 2014-08-05
|
||||
==================
|
||||
|
||||
* Fix `extensions` behavior when file already has extension
|
||||
|
||||
0.8.0 / 2014-08-05
|
||||
==================
|
||||
|
||||
* Add `extensions` option
|
||||
|
||||
0.7.4 / 2014-08-04
|
||||
==================
|
||||
|
||||
* Fix serving index files without root dir
|
||||
|
||||
0.7.3 / 2014-07-29
|
||||
==================
|
||||
|
||||
* Fix incorrect 403 on Windows and Node.js 0.11
|
||||
|
||||
0.7.2 / 2014-07-27
|
||||
==================
|
||||
|
||||
* deps: depd@0.4.4
|
||||
- Work-around v8 generating empty stack traces
|
||||
|
||||
0.7.1 / 2014-07-26
|
||||
==================
|
||||
|
||||
* deps: depd@0.4.3
|
||||
- Fix exception when global `Error.stackTraceLimit` is too low
|
||||
|
||||
0.7.0 / 2014-07-20
|
||||
==================
|
||||
|
||||
* Deprecate `hidden` option; use `dotfiles` option
|
||||
* Add `dotfiles` option
|
||||
* deps: debug@1.0.4
|
||||
* deps: depd@0.4.2
|
||||
- Add `TRACE_DEPRECATION` environment variable
|
||||
- Remove non-standard grey color from color output
|
||||
- Support `--no-deprecation` argument
|
||||
- Support `--trace-deprecation` argument
|
||||
|
||||
0.6.0 / 2014-07-11
|
||||
==================
|
||||
|
||||
* Deprecate `from` option; use `root` option
|
||||
* Deprecate `send.etag()` -- use `etag` in `options`
|
||||
* Deprecate `send.hidden()` -- use `hidden` in `options`
|
||||
* Deprecate `send.index()` -- use `index` in `options`
|
||||
* Deprecate `send.maxage()` -- use `maxAge` in `options`
|
||||
* Deprecate `send.root()` -- use `root` in `options`
|
||||
* Cap `maxAge` value to 1 year
|
||||
* deps: debug@1.0.3
|
||||
- Add support for multiple wildcards in namespaces
|
||||
|
||||
0.5.0 / 2014-06-28
|
||||
==================
|
||||
|
||||
* Accept string for `maxAge` (converted by `ms`)
|
||||
* Add `headers` event
|
||||
* Include link in default redirect response
|
||||
* Use `EventEmitter.listenerCount` to count listeners
|
||||
|
||||
0.4.3 / 2014-06-11
|
||||
==================
|
||||
|
||||
* Do not throw un-catchable error on file open race condition
|
||||
* Use `escape-html` for HTML escaping
|
||||
* deps: debug@1.0.2
|
||||
- fix some debugging output colors on node.js 0.8
|
||||
* deps: finished@1.2.2
|
||||
* deps: fresh@0.2.2
|
||||
|
||||
0.4.2 / 2014-06-09
|
||||
==================
|
||||
|
||||
* fix "event emitter leak" warnings
|
||||
* deps: debug@1.0.1
|
||||
* deps: finished@1.2.1
|
||||
|
||||
0.4.1 / 2014-06-02
|
||||
==================
|
||||
|
||||
* Send `max-age` in `Cache-Control` in correct format
|
||||
|
||||
0.4.0 / 2014-05-27
|
||||
==================
|
||||
|
||||
* Calculate ETag with md5 for reduced collisions
|
||||
* Fix wrong behavior when index file matches directory
|
||||
* Ignore stream errors after request ends
|
||||
- Goodbye `EBADF, read`
|
||||
* Skip directories in index file search
|
||||
* deps: debug@0.8.1
|
||||
|
||||
0.3.0 / 2014-04-24
|
||||
==================
|
||||
|
||||
* Fix sending files with dots without root set
|
||||
* Coerce option types
|
||||
* Accept API options in options object
|
||||
* Set etags to "weak"
|
||||
* Include file path in etag
|
||||
* Make "Can't set headers after they are sent." catchable
|
||||
* Send full entity-body for multi range requests
|
||||
* Default directory access to 403 when index disabled
|
||||
* Support multiple index paths
|
||||
* Support "If-Range" header
|
||||
* Control whether to generate etags
|
||||
* deps: mime@1.2.11
|
||||
|
||||
0.2.0 / 2014-01-29
|
||||
==================
|
||||
|
||||
* update range-parser and fresh
|
||||
|
||||
0.1.4 / 2013-08-11
|
||||
==================
|
||||
|
||||
* update fresh
|
||||
|
||||
0.1.3 / 2013-07-08
|
||||
==================
|
||||
|
||||
* Revert "Fix fd leak"
|
||||
|
||||
0.1.2 / 2013-07-03
|
||||
==================
|
||||
|
||||
* Fix fd leak
|
||||
|
||||
0.1.0 / 2012-08-25
|
||||
==================
|
||||
|
||||
* add options parameter to send() that is passed to fs.createReadStream() [kanongil]
|
||||
|
||||
0.0.4 / 2012-08-16
|
||||
==================
|
||||
|
||||
* allow custom "Accept-Ranges" definition
|
||||
|
||||
0.0.3 / 2012-07-16
|
||||
==================
|
||||
|
||||
* fix normalization of the root directory. Closes #3
|
||||
|
||||
0.0.2 / 2012-07-09
|
||||
==================
|
||||
|
||||
* add passing of req explicitly for now (YUCK)
|
||||
|
||||
0.0.1 / 2010-01-03
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
2
server/node_modules/express/node_modules/send/LICENSE
generated
vendored
Executable file → Normal file
2
server/node_modules/express/node_modules/send/LICENSE
generated
vendored
Executable file → Normal file
@@ -1,7 +1,7 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2012 TJ Holowaychuk
|
||||
Copyright (c) 2014 Douglas Christopher Wilson
|
||||
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
|
||||
|
||||
182
server/node_modules/express/node_modules/send/Readme.md
generated
vendored
182
server/node_modules/express/node_modules/send/Readme.md
generated
vendored
@@ -1,182 +0,0 @@
|
||||
# send
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
[![Gittip][gittip-image]][gittip-url]
|
||||
|
||||
Send is Connect's `static()` extracted for generalized use, a streaming static file
|
||||
server supporting partial responses (Ranges), conditional-GET negotiation, high test coverage, and granular events which may be leveraged to take appropriate actions in your application or framework.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ npm install send
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var send = require('send')
|
||||
```
|
||||
|
||||
### send(req, path, [options])
|
||||
|
||||
Create a new `SendStream` for the given path to send to a `res`. The `req` is
|
||||
the Node.js HTTP request and the `path` is a urlencoded path to send (urlencoded,
|
||||
not the actual file-system path).
|
||||
|
||||
#### Options
|
||||
|
||||
##### dotfiles
|
||||
|
||||
Set how "dotfiles" are treated when encountered. A dotfile is a file
|
||||
or directory that begins with a dot ("."). Note this check is done on
|
||||
the path itself without checking if the path actually exists on the
|
||||
disk. If `root` is specified, only the dotfiles above the root are
|
||||
checked (i.e. the root itself can be within a dotfile when when set
|
||||
to "deny").
|
||||
|
||||
The default value is `'ignore'`.
|
||||
|
||||
- `'allow'` No special treatment for dotfiles.
|
||||
- `'deny'` Send a 403 for any request for a dotfile.
|
||||
- `'ignore'` Pretend like the dotfile does not exist and 404.
|
||||
|
||||
##### etag
|
||||
|
||||
Enable or disable etag generation, defaults to true.
|
||||
|
||||
##### extensions
|
||||
|
||||
If a given file doesn't exist, try appending one of the given extensions,
|
||||
in the given order. By default, this is disabled (set to `false`). An
|
||||
example value that will serve extension-less HTML files: `['html', 'htm']`.
|
||||
This is skipped if the requested file already has an extension.
|
||||
|
||||
##### index
|
||||
|
||||
By default send supports "index.html" files, to disable this
|
||||
set `false` or to supply a new index pass a string or an array
|
||||
in preferred order.
|
||||
|
||||
##### lastModified
|
||||
|
||||
Enable or disable `Last-Modified` header, defaults to true. Uses the file
|
||||
system's last modified value.
|
||||
|
||||
##### maxAge
|
||||
|
||||
Provide a max-age in milliseconds for http caching, defaults to 0.
|
||||
This can also be a string accepted by the
|
||||
[ms](https://www.npmjs.org/package/ms#readme) module.
|
||||
|
||||
##### root
|
||||
|
||||
Serve files relative to `path`.
|
||||
|
||||
### Events
|
||||
|
||||
The `SendStream` is an event emitter and will emit the following events:
|
||||
|
||||
- `error` an error occurred `(err)`
|
||||
- `directory` a directory was requested
|
||||
- `file` a file was requested `(path, stat)`
|
||||
- `headers` the headers are about to be set on a file `(res, path, stat)`
|
||||
- `stream` file streaming has started `(stream)`
|
||||
- `end` streaming has completed
|
||||
|
||||
### .pipe
|
||||
|
||||
The `pipe` method is used to pipe the response into the Node.js HTTP response
|
||||
object, typically `send(req, path, options).pipe(res)`.
|
||||
|
||||
## Error-handling
|
||||
|
||||
By default when no `error` listeners are present an automatic response will be made, otherwise you have full control over the response, aka you may show a 5xx page etc.
|
||||
|
||||
## Caching
|
||||
|
||||
It does _not_ perform internal caching, you should use a reverse proxy cache such
|
||||
as Varnish for this, or those fancy things called CDNs. If your application is small enough that it would benefit from single-node memory caching, it's small enough that it does not need caching at all ;).
|
||||
|
||||
## Debugging
|
||||
|
||||
To enable `debug()` instrumentation output export __DEBUG__:
|
||||
|
||||
```
|
||||
$ DEBUG=send node app
|
||||
```
|
||||
|
||||
## Running tests
|
||||
|
||||
```
|
||||
$ npm install
|
||||
$ npm test
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
Small:
|
||||
|
||||
```js
|
||||
var http = require('http');
|
||||
var send = require('send');
|
||||
|
||||
var app = http.createServer(function(req, res){
|
||||
send(req, req.url).pipe(res);
|
||||
}).listen(3000);
|
||||
```
|
||||
|
||||
Serving from a root directory with custom error-handling:
|
||||
|
||||
```js
|
||||
var http = require('http');
|
||||
var send = require('send');
|
||||
var url = require('url');
|
||||
|
||||
var app = http.createServer(function(req, res){
|
||||
// your custom error-handling logic:
|
||||
function error(err) {
|
||||
res.statusCode = err.status || 500;
|
||||
res.end(err.message);
|
||||
}
|
||||
|
||||
// your custom headers
|
||||
function headers(res, path, stat) {
|
||||
// serve all files for download
|
||||
res.setHeader('Content-Disposition', 'attachment');
|
||||
}
|
||||
|
||||
// your custom directory handling logic:
|
||||
function redirect() {
|
||||
res.statusCode = 301;
|
||||
res.setHeader('Location', req.url + '/');
|
||||
res.end('Redirecting to ' + req.url + '/');
|
||||
}
|
||||
|
||||
// transfer arbitrary files from within
|
||||
// /www/example.com/public/*
|
||||
send(req, url.parse(req.url).pathname, {root: '/www/example.com/public'})
|
||||
.on('error', error)
|
||||
.on('directory', redirect)
|
||||
.on('headers', headers)
|
||||
.pipe(res);
|
||||
}).listen(3000);
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/send.svg?style=flat
|
||||
[npm-url]: https://npmjs.org/package/send
|
||||
[travis-image]: https://img.shields.io/travis/tj/send.svg?style=flat
|
||||
[travis-url]: https://travis-ci.org/tj/send
|
||||
[coveralls-image]: https://img.shields.io/coveralls/tj/send.svg?style=flat
|
||||
[coveralls-url]: https://coveralls.io/r/tj/send?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/send.svg?style=flat
|
||||
[downloads-url]: https://npmjs.org/package/send
|
||||
[gittip-image]: https://img.shields.io/gittip/dougwilson.svg?style=flat
|
||||
[gittip-url]: https://www.gittip.com/dougwilson/
|
||||
104
server/node_modules/express/node_modules/send/index.js
generated
vendored
Executable file → Normal file
104
server/node_modules/express/node_modules/send/index.js
generated
vendored
Executable file → Normal file
@@ -1,3 +1,9 @@
|
||||
/*!
|
||||
* send
|
||||
* Copyright(c) 2012 TJ Holowaychuk
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
@@ -56,7 +62,7 @@ var listenerCount = EventEmitter.listenerCount
|
||||
*
|
||||
* @param {Request} req
|
||||
* @param {String} path
|
||||
* @param {Object} options
|
||||
* @param {object} [options]
|
||||
* @return {SendStream}
|
||||
* @api public
|
||||
*/
|
||||
@@ -70,53 +76,53 @@ function send(req, path, options) {
|
||||
*
|
||||
* @param {Request} req
|
||||
* @param {String} path
|
||||
* @param {Object} options
|
||||
* @param {object} [options]
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function SendStream(req, path, options) {
|
||||
var self = this;
|
||||
options = options || {};
|
||||
this.req = req;
|
||||
this.path = path;
|
||||
this.options = options;
|
||||
var opts = options || {}
|
||||
|
||||
this._etag = options.etag !== undefined
|
||||
? Boolean(options.etag)
|
||||
this.options = opts
|
||||
this.path = path
|
||||
this.req = req
|
||||
|
||||
this._etag = opts.etag !== undefined
|
||||
? Boolean(opts.etag)
|
||||
: true
|
||||
|
||||
this._dotfiles = options.dotfiles !== undefined
|
||||
? options.dotfiles
|
||||
this._dotfiles = opts.dotfiles !== undefined
|
||||
? opts.dotfiles
|
||||
: 'ignore'
|
||||
|
||||
if (['allow', 'deny', 'ignore'].indexOf(this._dotfiles) === -1) {
|
||||
throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"')
|
||||
}
|
||||
|
||||
this._hidden = Boolean(options.hidden)
|
||||
this._hidden = Boolean(opts.hidden)
|
||||
|
||||
if ('hidden' in options) {
|
||||
if (opts.hidden !== undefined) {
|
||||
deprecate('hidden: use dotfiles: \'' + (this._hidden ? 'allow' : 'ignore') + '\' instead')
|
||||
}
|
||||
|
||||
// legacy support
|
||||
if (!('dotfiles' in options)) {
|
||||
if (opts.dotfiles === undefined) {
|
||||
this._dotfiles = undefined
|
||||
}
|
||||
|
||||
this._extensions = options.extensions !== undefined
|
||||
? normalizeList(options.extensions)
|
||||
this._extensions = opts.extensions !== undefined
|
||||
? normalizeList(opts.extensions, 'extensions option')
|
||||
: []
|
||||
|
||||
this._index = options.index !== undefined
|
||||
? normalizeList(options.index)
|
||||
this._index = opts.index !== undefined
|
||||
? normalizeList(opts.index, 'index option')
|
||||
: ['index.html']
|
||||
|
||||
this._lastModified = options.lastModified !== undefined
|
||||
? Boolean(options.lastModified)
|
||||
this._lastModified = opts.lastModified !== undefined
|
||||
? Boolean(opts.lastModified)
|
||||
: true
|
||||
|
||||
this._maxage = options.maxAge || options.maxage
|
||||
this._maxage = opts.maxAge || opts.maxage
|
||||
this._maxage = typeof this._maxage === 'string'
|
||||
? ms(this._maxage)
|
||||
: Number(this._maxage)
|
||||
@@ -124,12 +130,12 @@ function SendStream(req, path, options) {
|
||||
? Math.min(Math.max(0, this._maxage), maxMaxAge)
|
||||
: 0
|
||||
|
||||
this._root = options.root
|
||||
? resolve(options.root)
|
||||
this._root = opts.root
|
||||
? resolve(opts.root)
|
||||
: null
|
||||
|
||||
if (!this._root && options.from) {
|
||||
this.from(options.from);
|
||||
if (!this._root && opts.from) {
|
||||
this.from(opts.from)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +186,7 @@ SendStream.prototype.hidden = deprecate.function(function hidden(val) {
|
||||
*/
|
||||
|
||||
SendStream.prototype.index = deprecate.function(function index(paths) {
|
||||
var index = !paths ? [] : normalizeList(paths);
|
||||
var index = !paths ? [] : normalizeList(paths, 'paths argument');
|
||||
debug('index %o', paths);
|
||||
this._index = index;
|
||||
return this;
|
||||
@@ -415,16 +421,16 @@ SendStream.prototype.pipe = function(res){
|
||||
|
||||
var parts
|
||||
if (root !== null) {
|
||||
// join / normalize from optional root dir
|
||||
path = normalize(join(root, path))
|
||||
root = normalize(root + sep)
|
||||
|
||||
// malicious path
|
||||
if ((path + sep).substr(0, root.length) !== root) {
|
||||
if (upPathRegexp.test(normalize('.' + sep + path))) {
|
||||
debug('malicious path "%s"', path)
|
||||
return this.error(403)
|
||||
}
|
||||
|
||||
// join / normalize from optional root dir
|
||||
path = normalize(join(root, path))
|
||||
root = normalize(root + sep)
|
||||
|
||||
// explode path parts
|
||||
parts = path.substr(root.length).split(sep)
|
||||
} else {
|
||||
@@ -482,8 +488,9 @@ SendStream.prototype.pipe = function(res){
|
||||
*/
|
||||
|
||||
SendStream.prototype.send = function(path, stat){
|
||||
var options = this.options;
|
||||
var len = stat.size;
|
||||
var options = this.options
|
||||
var opts = {}
|
||||
var res = this.res;
|
||||
var req = this.req;
|
||||
var ranges = req.headers.range;
|
||||
@@ -537,9 +544,6 @@ SendStream.prototype.send = function(path, stat){
|
||||
if (-2 != ranges && ranges.length === 1) {
|
||||
debug('range %j', ranges);
|
||||
|
||||
options.start = offset + ranges[0].start;
|
||||
options.end = offset + ranges[0].end;
|
||||
|
||||
// Content-Range
|
||||
res.statusCode = 206;
|
||||
res.setHeader('Content-Range', 'bytes '
|
||||
@@ -548,17 +552,28 @@ SendStream.prototype.send = function(path, stat){
|
||||
+ ranges[0].end
|
||||
+ '/'
|
||||
+ len);
|
||||
len = options.end - options.start + 1;
|
||||
|
||||
offset += ranges[0].start;
|
||||
len = ranges[0].end - ranges[0].start + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// clone options
|
||||
for (var prop in options) {
|
||||
opts[prop] = options[prop]
|
||||
}
|
||||
|
||||
// set read options
|
||||
opts.start = offset
|
||||
opts.end = Math.max(offset, offset + len - 1)
|
||||
|
||||
// content-length
|
||||
res.setHeader('Content-Length', len);
|
||||
|
||||
// HEAD support
|
||||
if ('HEAD' == req.method) return res.end();
|
||||
|
||||
this.stream(path, options);
|
||||
this.stream(path, opts)
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -765,9 +780,18 @@ function decode(path) {
|
||||
* Normalize the index option into an array.
|
||||
*
|
||||
* @param {boolean|string|array} val
|
||||
* @api private
|
||||
* @param {string} name
|
||||
* @private
|
||||
*/
|
||||
|
||||
function normalizeList(val){
|
||||
return [].concat(val || [])
|
||||
function normalizeList(val, name) {
|
||||
var list = [].concat(val || [])
|
||||
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
if (typeof list[i] !== 'string') {
|
||||
throw new TypeError(name + ' must be array of strings or false')
|
||||
}
|
||||
}
|
||||
|
||||
return list
|
||||
}
|
||||
|
||||
0
server/node_modules/express/node_modules/send/node_modules/destroy/README.md
generated
vendored
Executable file → Normal file
0
server/node_modules/express/node_modules/send/node_modules/destroy/README.md
generated
vendored
Executable file → Normal file
0
server/node_modules/express/node_modules/send/node_modules/destroy/index.js
generated
vendored
Executable file → Normal file
0
server/node_modules/express/node_modules/send/node_modules/destroy/index.js
generated
vendored
Executable file → Normal file
26
server/node_modules/express/node_modules/send/node_modules/destroy/package.json
generated
vendored
Executable file → Normal file
26
server/node_modules/express/node_modules/send/node_modules/destroy/package.json
generated
vendored
Executable file → Normal file
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/stream-utils/destroy"
|
||||
"url": "git://github.com/stream-utils/destroy"
|
||||
},
|
||||
"devDependencies": {
|
||||
"istanbul": "0",
|
||||
@@ -38,29 +38,11 @@
|
||||
"leak",
|
||||
"fd"
|
||||
],
|
||||
"gitHead": "50af95ece4a70202f9301bc3edc8f9fdbbad0f26",
|
||||
"readme": "# Destroy\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n[![Gittip][gittip-image]][gittip-url]\n\nDestroy a stream.\n\n## API\n\n```js\nvar destroy = require('destroy')\n\nvar fs = require('fs')\nvar stream = fs.createReadStream('package.json')\ndestroy(stream)\n```\n\n[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/destroy\n[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square\n[github-url]: https://github.com/stream-utils/destroy/tags\n[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square\n[travis-url]: https://travis-ci.org/stream-utils/destroy\n[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master\n[david-image]: http://img.shields.io/david/stream-utils/destroy.svg?style=flat-square\n[david-url]: https://david-dm.org/stream-utils/destroy\n[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square\n[license-url]: LICENSE.md\n[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/destroy\n[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\n[gittip-url]: https://www.gittip.com/jonathanong/\n",
|
||||
"readmeFilename": "README.md",
|
||||
"bugs": {
|
||||
"url": "https://github.com/stream-utils/destroy/issues"
|
||||
},
|
||||
"homepage": "https://github.com/stream-utils/destroy",
|
||||
"_id": "destroy@1.0.3",
|
||||
"_shasum": "b433b4724e71fd8551d9885174851c5fc377e2c9",
|
||||
"_from": "destroy@1.0.3",
|
||||
"_npmVersion": "1.4.21",
|
||||
"_npmUser": {
|
||||
"name": "jongleberry",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
},
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jongleberry",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
}
|
||||
],
|
||||
"dist": {
|
||||
"shasum": "b433b4724e71fd8551d9885174851c5fc377e2c9",
|
||||
"tarball": "http://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz"
|
||||
},
|
||||
"directories": {},
|
||||
"_resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz"
|
||||
"_from": "destroy@1.0.3"
|
||||
}
|
||||
|
||||
0
server/node_modules/express/node_modules/send/node_modules/mime/LICENSE
generated
vendored
Executable file → Normal file
0
server/node_modules/express/node_modules/send/node_modules/mime/LICENSE
generated
vendored
Executable file → Normal file
62
server/node_modules/express/node_modules/send/node_modules/mime/README.md
generated
vendored
Executable file → Normal file
62
server/node_modules/express/node_modules/send/node_modules/mime/README.md
generated
vendored
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
# mime
|
||||
|
||||
Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.
|
||||
Comprehensive MIME type mapping API based on mime-db module.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -8,17 +8,32 @@ Install with [npm](http://github.com/isaacs/npm):
|
||||
|
||||
npm install mime
|
||||
|
||||
## Contributing / Testing
|
||||
|
||||
npm run test
|
||||
|
||||
## Command Line
|
||||
|
||||
mime [path_string]
|
||||
|
||||
E.g.
|
||||
|
||||
> mime scripts/jquery.js
|
||||
application/javascript
|
||||
|
||||
## API - Queries
|
||||
|
||||
### mime.lookup(path)
|
||||
Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.
|
||||
|
||||
var mime = require('mime');
|
||||
```js
|
||||
var mime = require('mime');
|
||||
|
||||
mime.lookup('/path/to/file.txt'); // => 'text/plain'
|
||||
mime.lookup('file.txt'); // => 'text/plain'
|
||||
mime.lookup('.TXT'); // => 'text/plain'
|
||||
mime.lookup('htm'); // => 'text/html'
|
||||
mime.lookup('/path/to/file.txt'); // => 'text/plain'
|
||||
mime.lookup('file.txt'); // => 'text/plain'
|
||||
mime.lookup('.TXT'); // => 'text/plain'
|
||||
mime.lookup('htm'); // => 'text/html'
|
||||
```
|
||||
|
||||
### mime.default_type
|
||||
Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)
|
||||
@@ -26,41 +41,50 @@ Sets the mime type returned when `mime.lookup` fails to find the extension searc
|
||||
### mime.extension(type)
|
||||
Get the default extension for `type`
|
||||
|
||||
mime.extension('text/html'); // => 'html'
|
||||
mime.extension('application/octet-stream'); // => 'bin'
|
||||
```js
|
||||
mime.extension('text/html'); // => 'html'
|
||||
mime.extension('application/octet-stream'); // => 'bin'
|
||||
```
|
||||
|
||||
### mime.charsets.lookup()
|
||||
|
||||
Map mime-type to charset
|
||||
|
||||
mime.charsets.lookup('text/plain'); // => 'UTF-8'
|
||||
```js
|
||||
mime.charsets.lookup('text/plain'); // => 'UTF-8'
|
||||
```
|
||||
|
||||
(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)
|
||||
|
||||
## API - Defining Custom Types
|
||||
|
||||
The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).
|
||||
Custom type mappings can be added on a per-project basis via the following APIs.
|
||||
|
||||
### mime.define()
|
||||
|
||||
Add custom mime/extension mappings
|
||||
|
||||
mime.define({
|
||||
'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],
|
||||
'application/x-my-type': ['x-mt', 'x-mtt'],
|
||||
// etc ...
|
||||
});
|
||||
```js
|
||||
mime.define({
|
||||
'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],
|
||||
'application/x-my-type': ['x-mt', 'x-mtt'],
|
||||
// etc ...
|
||||
});
|
||||
|
||||
mime.lookup('x-sft'); // => 'text/x-some-format'
|
||||
mime.lookup('x-sft'); // => 'text/x-some-format'
|
||||
```
|
||||
|
||||
The first entry in the extensions array is returned by `mime.extension()`. E.g.
|
||||
|
||||
mime.extension('text/x-some-format'); // => 'x-sf'
|
||||
```js
|
||||
mime.extension('text/x-some-format'); // => 'x-sf'
|
||||
```
|
||||
|
||||
### mime.load(filepath)
|
||||
|
||||
Load mappings from an Apache ".types" format file
|
||||
|
||||
mime.load('./my_project.types');
|
||||
|
||||
```js
|
||||
mime.load('./my_project.types');
|
||||
```
|
||||
The .types file format is simple - See the `types` dir for examples.
|
||||
|
||||
10
server/node_modules/express/node_modules/send/node_modules/mime/mime.js
generated
vendored
Executable file → Normal file
10
server/node_modules/express/node_modules/send/node_modules/mime/mime.js
generated
vendored
Executable file → Normal file
@@ -21,7 +21,6 @@ function Mime() {
|
||||
Mime.prototype.define = function (map) {
|
||||
for (var type in map) {
|
||||
var exts = map[type];
|
||||
|
||||
for (var i = 0; i < exts.length; i++) {
|
||||
if (process.env.DEBUG_MIME && this.types[exts]) {
|
||||
console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' +
|
||||
@@ -47,7 +46,6 @@ Mime.prototype.define = function (map) {
|
||||
* @param file (String) path of file to load.
|
||||
*/
|
||||
Mime.prototype.load = function(file) {
|
||||
|
||||
this._loading = file;
|
||||
// Read file and split into lines
|
||||
var map = {},
|
||||
@@ -85,12 +83,8 @@ Mime.prototype.extension = function(mimeType) {
|
||||
// Default instance
|
||||
var mime = new Mime();
|
||||
|
||||
// Load local copy of
|
||||
// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
|
||||
mime.load(path.join(__dirname, 'types/mime.types'));
|
||||
|
||||
// Load additional types from node.js community
|
||||
mime.load(path.join(__dirname, 'types/node.types'));
|
||||
// Define built-in types
|
||||
mime.define(require('./types.json'));
|
||||
|
||||
// Default type
|
||||
mime.default_type = mime.lookup('bin');
|
||||
|
||||
49
server/node_modules/express/node_modules/send/node_modules/mime/package.json
generated
vendored
Executable file → Normal file
49
server/node_modules/express/node_modules/send/node_modules/mime/package.json
generated
vendored
Executable file → Normal file
@@ -4,6 +4,13 @@
|
||||
"email": "robert@broofa.com",
|
||||
"url": "http://github.com/broofa"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "node build/build.js > types.json",
|
||||
"test": "node build/test.js"
|
||||
},
|
||||
"bin": {
|
||||
"mime": "cli.js"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Benjamin Thomas",
|
||||
@@ -11,9 +18,17 @@
|
||||
"url": "http://github.com/bentomas"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "A comprehensive library for mime-type mapping",
|
||||
"devDependencies": {},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://raw.github.com/broofa/node-mime/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mime-db": "^1.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
"util",
|
||||
"mime"
|
||||
@@ -24,32 +39,16 @@
|
||||
"url": "https://github.com/broofa/node-mime",
|
||||
"type": "git"
|
||||
},
|
||||
"version": "1.2.11",
|
||||
"version": "1.3.4",
|
||||
"readme": "# mime\n\nComprehensive MIME type mapping API based on mime-db module.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## Contributing / Testing\n\n npm run test\n\n## Command Line\n\n mime [path_string]\n\nE.g.\n\n > mime scripts/jquery.js\n application/javascript\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n```js\nvar mime = require('mime');\n\nmime.lookup('/path/to/file.txt'); // => 'text/plain'\nmime.lookup('file.txt'); // => 'text/plain'\nmime.lookup('.TXT'); // => 'text/plain'\nmime.lookup('htm'); // => 'text/html'\n```\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n```js\nmime.extension('text/html'); // => 'html'\nmime.extension('application/octet-stream'); // => 'bin'\n```\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n```js\nmime.charsets.lookup('text/plain'); // => 'UTF-8'\n```\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nCustom type mappings can be added on a per-project basis via the following APIs.\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n```js\nmime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n});\n\nmime.lookup('x-sft'); // => 'text/x-some-format'\n```\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n```js\nmime.extension('text/x-some-format'); // => 'x-sf'\n```\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n```js\nmime.load('./my_project.types');\n```\nThe .types file format is simple - See the `types` dir for examples.\n",
|
||||
"readmeFilename": "README.md",
|
||||
"bugs": {
|
||||
"url": "https://github.com/broofa/node-mime/issues"
|
||||
},
|
||||
"_id": "mime@1.2.11",
|
||||
"_id": "mime@1.3.4",
|
||||
"dist": {
|
||||
"shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10",
|
||||
"tarball": "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
|
||||
"shasum": "db2e4d34e4dd2b6daefec43455d6e0cf0bbea83d"
|
||||
},
|
||||
"_from": "mime@1.2.11",
|
||||
"_npmVersion": "1.3.6",
|
||||
"_npmUser": {
|
||||
"name": "broofa",
|
||||
"email": "robert@broofa.com"
|
||||
},
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "broofa",
|
||||
"email": "robert@broofa.com"
|
||||
},
|
||||
{
|
||||
"name": "bentomas",
|
||||
"email": "benjamin@benjaminthomas.org"
|
||||
}
|
||||
],
|
||||
"directories": {},
|
||||
"_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10",
|
||||
"_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
|
||||
"_from": "mime@1.3.4",
|
||||
"_resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz"
|
||||
}
|
||||
|
||||
84
server/node_modules/express/node_modules/send/node_modules/mime/test.js
generated
vendored
84
server/node_modules/express/node_modules/send/node_modules/mime/test.js
generated
vendored
@@ -1,84 +0,0 @@
|
||||
/**
|
||||
* Usage: node test.js
|
||||
*/
|
||||
|
||||
var mime = require('./mime');
|
||||
var assert = require('assert');
|
||||
var path = require('path');
|
||||
|
||||
function eq(a, b) {
|
||||
console.log('Test: ' + a + ' === ' + b);
|
||||
assert.strictEqual.apply(null, arguments);
|
||||
}
|
||||
|
||||
console.log(Object.keys(mime.extensions).length + ' types');
|
||||
console.log(Object.keys(mime.types).length + ' extensions\n');
|
||||
|
||||
//
|
||||
// Test mime lookups
|
||||
//
|
||||
|
||||
eq('text/plain', mime.lookup('text.txt')); // normal file
|
||||
eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase
|
||||
eq('text/plain', mime.lookup('dir/text.txt')); // dir + file
|
||||
eq('text/plain', mime.lookup('.text.txt')); // hidden file
|
||||
eq('text/plain', mime.lookup('.txt')); // nameless
|
||||
eq('text/plain', mime.lookup('txt')); // extension-only
|
||||
eq('text/plain', mime.lookup('/txt')); // extension-less ()
|
||||
eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less
|
||||
eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized
|
||||
eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default
|
||||
|
||||
//
|
||||
// Test extensions
|
||||
//
|
||||
|
||||
eq('txt', mime.extension(mime.types.text));
|
||||
eq('html', mime.extension(mime.types.htm));
|
||||
eq('bin', mime.extension('application/octet-stream'));
|
||||
eq('bin', mime.extension('application/octet-stream '));
|
||||
eq('html', mime.extension(' text/html; charset=UTF-8'));
|
||||
eq('html', mime.extension('text/html; charset=UTF-8 '));
|
||||
eq('html', mime.extension('text/html; charset=UTF-8'));
|
||||
eq('html', mime.extension('text/html ; charset=UTF-8'));
|
||||
eq('html', mime.extension('text/html;charset=UTF-8'));
|
||||
eq('html', mime.extension('text/Html;charset=UTF-8'));
|
||||
eq(undefined, mime.extension('unrecognized'));
|
||||
|
||||
//
|
||||
// Test node.types lookups
|
||||
//
|
||||
|
||||
eq('application/font-woff', mime.lookup('file.woff'));
|
||||
eq('application/octet-stream', mime.lookup('file.buffer'));
|
||||
eq('audio/mp4', mime.lookup('file.m4a'));
|
||||
eq('font/opentype', mime.lookup('file.otf'));
|
||||
|
||||
//
|
||||
// Test charsets
|
||||
//
|
||||
|
||||
eq('UTF-8', mime.charsets.lookup('text/plain'));
|
||||
eq(undefined, mime.charsets.lookup(mime.types.js));
|
||||
eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback'));
|
||||
|
||||
//
|
||||
// Test for overlaps between mime.types and node.types
|
||||
//
|
||||
|
||||
var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime();
|
||||
apacheTypes.load(path.join(__dirname, 'types/mime.types'));
|
||||
nodeTypes.load(path.join(__dirname, 'types/node.types'));
|
||||
|
||||
var keys = [].concat(Object.keys(apacheTypes.types))
|
||||
.concat(Object.keys(nodeTypes.types));
|
||||
keys.sort();
|
||||
for (var i = 1; i < keys.length; i++) {
|
||||
if (keys[i] == keys[i-1]) {
|
||||
console.warn('Warning: ' +
|
||||
'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] +
|
||||
', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('\nOK');
|
||||
1588
server/node_modules/express/node_modules/send/node_modules/mime/types/mime.types
generated
vendored
1588
server/node_modules/express/node_modules/send/node_modules/mime/types/mime.types
generated
vendored
File diff suppressed because it is too large
Load Diff
77
server/node_modules/express/node_modules/send/node_modules/mime/types/node.types
generated
vendored
77
server/node_modules/express/node_modules/send/node_modules/mime/types/node.types
generated
vendored
@@ -1,77 +0,0 @@
|
||||
# What: WebVTT
|
||||
# Why: To allow formats intended for marking up external text track resources.
|
||||
# http://dev.w3.org/html5/webvtt/
|
||||
# Added by: niftylettuce
|
||||
text/vtt vtt
|
||||
|
||||
# What: Google Chrome Extension
|
||||
# Why: To allow apps to (work) be served with the right content type header.
|
||||
# http://codereview.chromium.org/2830017
|
||||
# Added by: niftylettuce
|
||||
application/x-chrome-extension crx
|
||||
|
||||
# What: HTC support
|
||||
# Why: To properly render .htc files such as CSS3PIE
|
||||
# Added by: niftylettuce
|
||||
text/x-component htc
|
||||
|
||||
# What: HTML5 application cache manifes ('.manifest' extension)
|
||||
# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps
|
||||
# per https://developer.mozilla.org/en/offline_resources_in_firefox
|
||||
# Added by: louisremi
|
||||
text/cache-manifest manifest
|
||||
|
||||
# What: node binary buffer format
|
||||
# Why: semi-standard extension w/in the node community
|
||||
# Added by: tootallnate
|
||||
application/octet-stream buffer
|
||||
|
||||
# What: The "protected" MP-4 formats used by iTunes.
|
||||
# Why: Required for streaming music to browsers (?)
|
||||
# Added by: broofa
|
||||
application/mp4 m4p
|
||||
audio/mp4 m4a
|
||||
|
||||
# What: Video format, Part of RFC1890
|
||||
# Why: See https://github.com/bentomas/node-mime/pull/6
|
||||
# Added by: mjrusso
|
||||
video/MP2T ts
|
||||
|
||||
# What: EventSource mime type
|
||||
# Why: mime type of Server-Sent Events stream
|
||||
# http://www.w3.org/TR/eventsource/#text-event-stream
|
||||
# Added by: francois2metz
|
||||
text/event-stream event-stream
|
||||
|
||||
# What: Mozilla App manifest mime type
|
||||
# Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests
|
||||
# Added by: ednapiranha
|
||||
application/x-web-app-manifest+json webapp
|
||||
|
||||
# What: Lua file types
|
||||
# Why: Googling around shows de-facto consensus on these
|
||||
# Added by: creationix (Issue #45)
|
||||
text/x-lua lua
|
||||
application/x-lua-bytecode luac
|
||||
|
||||
# What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax
|
||||
# Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown
|
||||
# Added by: avoidwork
|
||||
text/x-markdown markdown md mkd
|
||||
|
||||
# What: ini files
|
||||
# Why: because they're just text files
|
||||
# Added by: Matthew Kastor
|
||||
text/plain ini
|
||||
|
||||
# What: DASH Adaptive Streaming manifest
|
||||
# Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video
|
||||
# Added by: eelcocramer
|
||||
application/dash+xml mdp
|
||||
|
||||
# What: OpenType font files - http://www.microsoft.com/typography/otspec/
|
||||
# Why: Browsers usually ignore the font MIME types and sniff the content,
|
||||
# but Chrome, shows a warning if OpenType fonts aren't served with
|
||||
# the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png.
|
||||
# Added by: alrra
|
||||
font/opentype otf
|
||||
0
server/node_modules/express/node_modules/send/node_modules/ms/.npmignore
generated
vendored
Executable file → Normal file
0
server/node_modules/express/node_modules/send/node_modules/ms/.npmignore
generated
vendored
Executable file → Normal file
8
server/node_modules/express/node_modules/send/node_modules/ms/README.md
generated
vendored
Executable file → Normal file
8
server/node_modules/express/node_modules/send/node_modules/ms/README.md
generated
vendored
Executable file → Normal file
@@ -1,8 +1,10 @@
|
||||
# ms.js: miliseconds conversion utility
|
||||
|
||||
```js
|
||||
ms('2 days') // 172800000
|
||||
ms('1d') // 86400000
|
||||
ms('10h') // 36000000
|
||||
ms('2.5 hrs') // 9000000
|
||||
ms('2h') // 7200000
|
||||
ms('1m') // 60000
|
||||
ms('5s') // 5000
|
||||
@@ -18,10 +20,10 @@ ms(ms('10 hours')) // "10h"
|
||||
```js
|
||||
ms(60000, { long: true }) // "1 minute"
|
||||
ms(2 * 60000, { long: true }) // "2 minutes"
|
||||
ms(ms('10 hours', { long: true })) // "10 hours"
|
||||
ms(ms('10 hours'), { long: true }) // "10 hours"
|
||||
```
|
||||
|
||||
- Node/Browser compatible. Published as `ms` in NPM.
|
||||
- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download).
|
||||
- If a number is supplied to `ms`, a string with a unit is returned.
|
||||
- If a string that contains the number is supplied, it returns it as
|
||||
a number (e.g: it returns `100` for `'100'`).
|
||||
@@ -30,4 +32,4 @@ equivalent ms is returned.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
MIT
|
||||
|
||||
16
server/node_modules/express/node_modules/send/node_modules/ms/index.js
generated
vendored
Executable file → Normal file
16
server/node_modules/express/node_modules/send/node_modules/ms/index.js
generated
vendored
Executable file → Normal file
@@ -38,13 +38,17 @@ module.exports = function(val, options){
|
||||
*/
|
||||
|
||||
function parse(str) {
|
||||
var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);
|
||||
str = '' + str;
|
||||
if (str.length > 10000) return;
|
||||
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
|
||||
if (!match) return;
|
||||
var n = parseFloat(match[1]);
|
||||
var type = (match[2] || 'ms').toLowerCase();
|
||||
switch (type) {
|
||||
case 'years':
|
||||
case 'year':
|
||||
case 'yrs':
|
||||
case 'yr':
|
||||
case 'y':
|
||||
return n * y;
|
||||
case 'days':
|
||||
@@ -53,16 +57,26 @@ function parse(str) {
|
||||
return n * d;
|
||||
case 'hours':
|
||||
case 'hour':
|
||||
case 'hrs':
|
||||
case 'hr':
|
||||
case 'h':
|
||||
return n * h;
|
||||
case 'minutes':
|
||||
case 'minute':
|
||||
case 'mins':
|
||||
case 'min':
|
||||
case 'm':
|
||||
return n * m;
|
||||
case 'seconds':
|
||||
case 'second':
|
||||
case 'secs':
|
||||
case 'sec':
|
||||
case 's':
|
||||
return n * s;
|
||||
case 'milliseconds':
|
||||
case 'millisecond':
|
||||
case 'msecs':
|
||||
case 'msec':
|
||||
case 'ms':
|
||||
return n;
|
||||
}
|
||||
|
||||
26
server/node_modules/express/node_modules/send/node_modules/ms/package.json
generated
vendored
Executable file → Normal file
26
server/node_modules/express/node_modules/send/node_modules/ms/package.json
generated
vendored
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ms",
|
||||
"version": "0.6.2",
|
||||
"version": "0.7.1",
|
||||
"description": "Tiny ms conversion utility",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,27 +17,15 @@
|
||||
"ms/index.js": "index.js"
|
||||
}
|
||||
},
|
||||
"readme": "# ms.js: miliseconds conversion utility\n\n```js\nms('2 days') // 172800000\nms('1d') // 86400000\nms('10h') // 36000000\nms('2.5 hrs') // 9000000\nms('2h') // 7200000\nms('1m') // 60000\nms('5s') // 5000\nms('100') // 100\n```\n\n```js\nms(60000) // \"1m\"\nms(2 * 60000) // \"2m\"\nms(ms('10 hours')) // \"10h\"\n```\n\n```js\nms(60000, { long: true }) // \"1 minute\"\nms(2 * 60000, { long: true }) // \"2 minutes\"\nms(ms('10 hours'), { long: true }) // \"10 hours\"\n```\n\n- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download).\n- If a number is supplied to `ms`, a string with a unit is returned.\n- If a string that contains the number is supplied, it returns it as\na number (e.g: it returns `100` for `'100'`).\n- If you pass a string with a number and a valid unit, the number of\nequivalent ms is returned.\n\n## License\n\nMIT\n",
|
||||
"readmeFilename": "README.md",
|
||||
"bugs": {
|
||||
"url": "https://github.com/guille/ms.js/issues"
|
||||
},
|
||||
"_id": "ms@0.6.2",
|
||||
"_id": "ms@0.7.1",
|
||||
"dist": {
|
||||
"shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c",
|
||||
"tarball": "http://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
|
||||
"shasum": "71c4b4174f5b6aa0101eb56e733ee5f6b4c1a917"
|
||||
},
|
||||
"_from": "ms@0.6.2",
|
||||
"_npmVersion": "1.2.30",
|
||||
"_npmUser": {
|
||||
"name": "rauchg",
|
||||
"email": "rauchg@gmail.com"
|
||||
},
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "rauchg",
|
||||
"email": "rauchg@gmail.com"
|
||||
}
|
||||
],
|
||||
"directories": {},
|
||||
"_shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c",
|
||||
"_resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
|
||||
"_from": "ms@0.7.1",
|
||||
"_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz"
|
||||
}
|
||||
|
||||
63
server/node_modules/express/node_modules/send/package.json
generated
vendored
Executable file → Normal file
63
server/node_modules/express/node_modules/send/package.json
generated
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user