├── 3dBoxAcceleration ├── index.html ├── p5.js └── sketch.js ├── README.md ├── accelGravityMoveBall ├── index.html ├── p5.min.js └── sketch.js ├── accelerometerMoveBall ├── index.html └── js │ ├── p5.min.js │ └── sketch.js ├── deviceMoved ├── index.html ├── p5.min.js └── sketch.js ├── deviceShaken ├── index.html ├── p5.js └── sketch.js ├── deviceTurned ├── index.html ├── p5.min.js └── sketch.js ├── multitouchZoom ├── hammer.min.js ├── index.html ├── p5.js └── sketch.js ├── node_modules ├── connect │ ├── History.md │ ├── LICENSE │ ├── Readme.md │ ├── index.js │ ├── lib │ │ ├── connect.js │ │ └── proto.js │ ├── node_modules │ │ ├── debug │ │ │ ├── .jshintrc │ │ │ ├── .npmignore │ │ │ ├── History.md │ │ │ ├── Makefile │ │ │ ├── Readme.md │ │ │ ├── bower.json │ │ │ ├── browser.js │ │ │ ├── component.json │ │ │ ├── debug.js │ │ │ ├── node.js │ │ │ ├── node_modules │ │ │ │ └── ms │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── finalhandler │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ ├── node_modules │ │ │ │ ├── escape-html │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── Readme.md │ │ │ │ │ ├── component.json │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ └── on-finished │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── node_modules │ │ │ │ │ └── ee-first │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── parseurl │ │ │ ├── .npmignore │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ └── utils-merge │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ └── package.json └── serve-static │ ├── HISTORY.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── node_modules │ ├── escape-html │ │ ├── .npmignore │ │ ├── Makefile │ │ ├── Readme.md │ │ ├── component.json │ │ ├── index.js │ │ └── package.json │ ├── parseurl │ │ ├── .npmignore │ │ ├── HISTORY.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ └── package.json │ ├── send │ │ ├── HISTORY.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ ├── node_modules │ │ │ ├── .bin │ │ │ │ └── mime │ │ │ ├── debug │ │ │ │ ├── .jshintrc │ │ │ │ ├── .npmignore │ │ │ │ ├── History.md │ │ │ │ ├── Makefile │ │ │ │ ├── Readme.md │ │ │ │ ├── bower.json │ │ │ │ ├── browser.js │ │ │ │ ├── component.json │ │ │ │ ├── debug.js │ │ │ │ ├── node.js │ │ │ │ └── package.json │ │ │ ├── depd │ │ │ │ ├── History.md │ │ │ │ ├── LICENSE │ │ │ │ ├── Readme.md │ │ │ │ ├── index.js │ │ │ │ ├── lib │ │ │ │ │ └── compat │ │ │ │ │ │ ├── buffer-concat.js │ │ │ │ │ │ ├── callsite-tostring.js │ │ │ │ │ │ └── index.js │ │ │ │ └── package.json │ │ │ ├── destroy │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── etag │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ └── crc │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── crc.js │ │ │ │ │ │ ├── crc1.js │ │ │ │ │ │ ├── crc16.js │ │ │ │ │ │ ├── crc16_ccitt.js │ │ │ │ │ │ ├── crc16_modbus.js │ │ │ │ │ │ ├── crc24.js │ │ │ │ │ │ ├── crc32.js │ │ │ │ │ │ ├── crc8.js │ │ │ │ │ │ ├── crc8_1wire.js │ │ │ │ │ │ ├── create.js │ │ │ │ │ │ ├── hex.js │ │ │ │ │ │ └── index.js │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ ├── fresh │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── mime │ │ │ │ ├── .npmignore │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── build │ │ │ │ │ ├── build.js │ │ │ │ │ └── test.js │ │ │ │ ├── cli.js │ │ │ │ ├── mime.js │ │ │ │ ├── package.json │ │ │ │ └── types.json │ │ │ ├── ms │ │ │ │ ├── .npmignore │ │ │ │ ├── History.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── on-finished │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ └── ee-first │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ └── range-parser │ │ │ │ ├── HISTORY.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ └── package.json │ └── utils-merge │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ └── package.json │ └── package.json ├── p5HammerDoubleTap ├── hammer.min.js ├── index.html ├── p5.js └── sketch.js ├── p5HammerPinch ├── hammer.min.js ├── index.html ├── p5.js └── sketch.js ├── p5HammerPress ├── hammer.min.js ├── index.html ├── p5.js └── sketch.js ├── p5HammerRotate ├── hammer.min.js ├── index.html ├── p5.js └── sketch.js ├── p5HammerSwipe ├── hammer.min.js ├── index.html ├── p5.js └── sketch.js ├── p5jQueryMobilePages ├── hammer.min.js ├── index.html ├── p5.min.js └── sketch.js ├── server.js ├── shake ├── index.html ├── p5.min.js └── sketch.js ├── simpleDraw ├── index.html └── js │ ├── p5.min.js │ └── sketch.js └── sketch.js /3dBoxAcceleration/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /3dBoxAcceleration/sketch.js: -------------------------------------------------------------------------------- 1 | // template http://bit.ly/1g8h17S 2 | 3 | function setup(){ 4 | var myCan = createCanvas(windowWidth, windowHeight, 'webgl'); 5 | myCan.parent('p5Container'); 6 | } 7 | 8 | function draw(){ 9 | background(255, 255, 255, 255); 10 | 11 | translate(-width/2, 0, -600); 12 | 13 | normalMaterial(); 14 | rotateX(accelerationX * 0.05); 15 | rotateY(accelerationY * 0.05); 16 | box(80, 80, 180); 17 | 18 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

p5 Mobile Examples

2 | 3 | A collection of p5 sketches designed for the mobile browser. For the p5 Mobile wiki, go [here](https://github.com/OhJia/p5Mobile). 4 | 5 | Try the following examples in your mobile browser (Safari or Chrome): 6 | https://ohjia.github.io/p5MobileWebExample-master/ 7 | 8 | ## p5 Touch Events 9 | - simpleDraw 10 | - multitouchZoom 11 | 12 | ## p5 Acceleration Events 13 | - accelerometerMoveBall 14 | - accelGravityMoveBall 15 | - deviceMoved 16 | - deviceTurned 17 | - shake 18 | - deviceShaken 19 | - 3dBoxAcceleration 20 | 21 | ## p5 + Hammer.js Gesture Events 22 | [hammer.js](http://hammerjs.github.io/) 23 | - p5HammerPress 24 | - p5HammerPinch 25 | - p5HammerSwipe 26 | - p5HammerDoubleTap 27 | - p5HammerRotate 28 | 29 | ## p5 + jQuery Mobile Page 30 | [jQuery Mobile](http://demos.jquerymobile.com/1.0a4.1/docs/pages/docs-pages.html) 31 | - p5jQueryMobilePage 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /accelGravityMoveBall/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /accelGravityMoveBall/sketch.js: -------------------------------------------------------------------------------- 1 | // Position Variables 2 | var x = 0; 3 | var y = 0; 4 | 5 | // Speed - Velocity 6 | var vx = 0; 7 | var vy = 0; 8 | 9 | // Acceleration 10 | var ax = 0; 11 | var ay = 0; 12 | 13 | var vMultiplier = 0.007; 14 | var bMultiplier = 0.6; 15 | 16 | function setup() { 17 | var myCan = createCanvas(windowWidth, windowHeight); 18 | myCan.parent('p5Container'); 19 | frameRate(2000); 20 | fill(0); 21 | } 22 | 23 | function draw() { 24 | background(255); 25 | ballMove(); 26 | ellipse(x, y, 30, 30); 27 | } 28 | 29 | function ballMove() { 30 | 31 | ax = accelerationX; 32 | ay = accelerationY; 33 | 34 | vx = vx + ay; 35 | vy = vy + ax; 36 | y = y + vy * vMultiplier; 37 | x = x + vx * vMultiplier; 38 | 39 | // Bounce when touch the edge of the canvas 40 | if (x < 0) { 41 | x = 0; 42 | vx = -vx * bMultiplier; 43 | } 44 | if (y < 0) { 45 | y = 0; 46 | vy = -vy * bMultiplier; 47 | } 48 | if (x > windowWidth - 20) { 49 | x = windowWidth - 20; 50 | vx = -vx * bMultiplier; 51 | } 52 | if (y > windowHeight - 20) { 53 | y = windowHeight - 20; 54 | vy = -vy * bMultiplier; 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /accelerometerMoveBall/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /accelerometerMoveBall/js/sketch.js: -------------------------------------------------------------------------------- 1 | // document.body.addEventListener('touchstart', function(e){ e.preventDefault(); }); 2 | 3 | function setup() { 4 | var myCan = createCanvas(windowWidth, windowHeight); 5 | myCan.parent('p5Container'); 6 | 7 | background(255, 200, 200); 8 | var c = color(255, 255, 0); 9 | fill(c); 10 | noStroke(); 11 | 12 | } 13 | 14 | function draw() { 15 | background(255, 200, 200); 16 | // var c = color(255, 255, 0); 17 | // fill(c); 18 | // noStroke(); 19 | // rect(mouseX, mouseY, 50, 50); for web, don't work on mobile 20 | var ax = map(accelerationX, -90, 90, 0, windowWidth); 21 | var ay = map(accelerationY, -90, 90, 0, windowHeight); 22 | ellipse(ax, ay, 30, 30); // for mobile web 23 | console.log(accelerationX); 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /deviceMoved/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /deviceMoved/sketch.js: -------------------------------------------------------------------------------- 1 | var bgColor; 2 | 3 | function setup() { 4 | var myCan = createCanvas(windowWidth, windowHeight); 5 | myCan.parent('p5Container'); 6 | bgColor = [ 7 | random(50, 255), 8 | random(0, 200), 9 | random(50, 255) 10 | ] 11 | } 12 | 13 | function draw() { 14 | background(bgColor[0], bgColor[1], bgColor[2]); 15 | } 16 | 17 | function deviceMoved() { 18 | bgColor = [ 19 | map(accelerationX, -90, 90, 100, 175), 20 | map(accelerationY, -90, 90, 100, 200), 21 | map(accelerationZ, -90, 90, 100, 200) 22 | ] 23 | } 24 | 25 | -------------------------------------------------------------------------------- /deviceShaken/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /deviceShaken/sketch.js: -------------------------------------------------------------------------------- 1 | var balls = []; 2 | 3 | function setup() { 4 | var myCan = createCanvas(displayWidth, displayHeight); 5 | myCan.parent('p5Container'); 6 | for (var i=0; i<15; i++) { 7 | balls.push(new Ball()); 8 | } 9 | setShakeThreshold(50); 10 | } 11 | 12 | function draw() { 13 | background(0); 14 | 15 | for (var i=0; i width - 20) { 50 | this.x = width - 20; 51 | this.direction = -this.direction; 52 | } 53 | else if (this.y > height - 20) { 54 | this.y = height - 20; 55 | this.direction = -this.direction; 56 | } 57 | } 58 | 59 | this.shake = function() { 60 | // this.xspeed += random(5, accChangeX/3); 61 | // this.yspeed += random(5, accChangeX/3); 62 | this.xspeed += random(5, 15); 63 | this.yspeed += random(5, 15); 64 | } 65 | 66 | this.stopShake = function() { 67 | if (this.xspeed > this.oxspeed) { 68 | this.xspeed -= 0.6; 69 | } 70 | else { 71 | this.xspeed = this.oxspeed; 72 | } 73 | if (this.yspeed > this.oyspeed) { 74 | this.yspeed -= 0.6; 75 | } 76 | else { 77 | this.yspeed = this.oyspeed; 78 | } 79 | } 80 | 81 | this.display = function() { 82 | ellipse(this.x, this.y, this.diameter, this.diameter); 83 | }; 84 | } 85 | 86 | function deviceShaken() { 87 | for (var i=0; i 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /deviceTurned/sketch.js: -------------------------------------------------------------------------------- 1 | var value = 0; 2 | 3 | function setup() { 4 | var myCan = createCanvas(windowWidth, windowHeight); 5 | myCan.parent('p5Container'); 6 | } 7 | 8 | function draw() { 9 | background(value); 10 | } 11 | function deviceTurned() { 12 | value = value + 5; 13 | if (value > 255) { 14 | value = 0; 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /multitouchZoom/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /multitouchZoom/sketch.js: -------------------------------------------------------------------------------- 1 | var x, y; 2 | var diameter = 100; 3 | 4 | var tDistance; // Distance between two touches 5 | var pTDistance = 0; //Previous distance between two touches 6 | 7 | // Distance between touch[0] and touch[1] to center of element 8 | var distance0, distance1; 9 | var touchingElement = false; 10 | 11 | function setup() { 12 | var myCan = createCanvas(displayWidth, displayHeight); 13 | myCan.parent('p5Container'); 14 | x = width/2; 15 | y = height/2; 16 | rectMode(CENTER); 17 | } 18 | 19 | function draw() { 20 | background(255); 21 | stroke(0); 22 | strokeWeight(5); 23 | rect(x, y, diameter, diameter); 24 | } 25 | 26 | // When touch event starts, check it's two touches 27 | // and whether both touches are on the element 28 | function touchStarted() { 29 | if (touches.length === 2) { 30 | touchingElement = false; 31 | pTDistance = 0; 32 | distance0 = floor(dist(touches[0].x, touches[0].y, x, y)); 33 | distance1 = floor(dist(touches[1].x, touches[1].y, x, y)); 34 | if (distance0 <= diameter/2 + 15 && distance1 <= diameter/2 + 15) { 35 | touchingElement = true; 36 | } 37 | } 38 | } 39 | 40 | // Update diameter based on different between tDistance and pTDistance 41 | function touchMoved() { 42 | if (touches.length === 2) { 43 | if (touchingElement === true) { 44 | tDistance = floor(dist(touches[0].x, touches[0].y, touches[1].x, touches[1].y)); 45 | if (pTDistance > 0) { 46 | diameter += tDistance - pTDistance; 47 | } 48 | pTDistance = tDistance; 49 | } 50 | } 51 | return false; 52 | } 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /node_modules/connect/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2010 Sencha Inc. 4 | Copyright (c) 2011 LearnBoost 5 | Copyright (c) 2011-2014 TJ Holowaychuk 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | 'Software'), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /node_modules/connect/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/connect'); 3 | -------------------------------------------------------------------------------- /node_modules/connect/lib/connect.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Connect 3 | * Copyright(c) 2010 Sencha Inc. 4 | * Copyright(c) 2011 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var EventEmitter = require('events').EventEmitter; 13 | var merge = require('utils-merge'); 14 | var proto = require('./proto'); 15 | 16 | // expose createServer() as the module 17 | 18 | module.exports = createServer; 19 | 20 | /** 21 | * Create a new connect server. 22 | * 23 | * @return {Function} 24 | * @api public 25 | */ 26 | 27 | function createServer() { 28 | function app(req, res, next){ app.handle(req, res, next); } 29 | merge(app, proto); 30 | merge(app, EventEmitter.prototype); 31 | app.route = '/'; 32 | app.stack = []; 33 | return app; 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/Makefile: -------------------------------------------------------------------------------- 1 | 2 | # get Makefile directory name: http://stackoverflow.com/a/5982798/376773 3 | THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) 4 | THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) 5 | 6 | # BIN directory 7 | BIN := $(THIS_DIR)/node_modules/.bin 8 | 9 | # applications 10 | NODE ?= $(shell which node) 11 | NPM ?= $(NODE) $(shell which npm) 12 | BROWSERIFY ?= $(NODE) $(BIN)/browserify 13 | 14 | all: dist/debug.js 15 | 16 | install: node_modules 17 | 18 | clean: 19 | @rm -rf node_modules dist 20 | 21 | dist: 22 | @mkdir -p $@ 23 | 24 | dist/debug.js: node_modules browser.js debug.js dist 25 | @$(BROWSERIFY) \ 26 | --standalone debug \ 27 | . > $@ 28 | 29 | node_modules: package.json 30 | @NODE_ENV= $(NPM) install 31 | @touch node_modules 32 | 33 | .PHONY: all install clean 34 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "visionmedia-debug", 3 | "main": "dist/debug.js", 4 | "version": "2.1.3", 5 | "homepage": "https://github.com/visionmedia/debug", 6 | "authors": [ 7 | "TJ Holowaychuk " 8 | ], 9 | "description": "visionmedia-debug", 10 | "moduleType": [ 11 | "amd", 12 | "es6", 13 | "globals", 14 | "node" 15 | ], 16 | "keywords": [ 17 | "visionmedia", 18 | "debug" 19 | ], 20 | "license": "MIT", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "tests" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.1.3", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/node_modules/ms/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Guillermo Rauch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/node_modules/ms/README.md: -------------------------------------------------------------------------------- 1 | # ms.js: miliseconds conversion utility 2 | 3 | ```js 4 | ms('2 days') // 172800000 5 | ms('1d') // 86400000 6 | ms('10h') // 36000000 7 | ms('2.5 hrs') // 9000000 8 | ms('2h') // 7200000 9 | ms('1m') // 60000 10 | ms('5s') // 5000 11 | ms('100') // 100 12 | ``` 13 | 14 | ```js 15 | ms(60000) // "1m" 16 | ms(2 * 60000) // "2m" 17 | ms(ms('10 hours')) // "10h" 18 | ``` 19 | 20 | ```js 21 | ms(60000, { long: true }) // "1 minute" 22 | ms(2 * 60000, { long: true }) // "2 minutes" 23 | ms(ms('10 hours'), { long: true }) // "10 hours" 24 | ``` 25 | 26 | - Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download). 27 | - If a number is supplied to `ms`, a string with a unit is returned. 28 | - If a string that contains the number is supplied, it returns it as 29 | a number (e.g: it returns `100` for `'100'`). 30 | - If you pass a string with a number and a valid unit, the number of 31 | equivalent ms is returned. 32 | 33 | ## License 34 | 35 | MIT 36 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/node_modules/ms/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Helpers. 3 | */ 4 | 5 | var s = 1000; 6 | var m = s * 60; 7 | var h = m * 60; 8 | var d = h * 24; 9 | var y = d * 365.25; 10 | 11 | /** 12 | * Parse or format the given `val`. 13 | * 14 | * Options: 15 | * 16 | * - `long` verbose formatting [false] 17 | * 18 | * @param {String|Number} val 19 | * @param {Object} options 20 | * @return {String|Number} 21 | * @api public 22 | */ 23 | 24 | module.exports = function(val, options){ 25 | options = options || {}; 26 | if ('string' == typeof val) return parse(val); 27 | return options.long 28 | ? long(val) 29 | : short(val); 30 | }; 31 | 32 | /** 33 | * Parse the given `str` and return milliseconds. 34 | * 35 | * @param {String} str 36 | * @return {Number} 37 | * @api private 38 | */ 39 | 40 | function parse(str) { 41 | var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); 42 | if (!match) return; 43 | var n = parseFloat(match[1]); 44 | var type = (match[2] || 'ms').toLowerCase(); 45 | switch (type) { 46 | case 'years': 47 | case 'year': 48 | case 'yrs': 49 | case 'yr': 50 | case 'y': 51 | return n * y; 52 | case 'days': 53 | case 'day': 54 | case 'd': 55 | return n * d; 56 | case 'hours': 57 | case 'hour': 58 | case 'hrs': 59 | case 'hr': 60 | case 'h': 61 | return n * h; 62 | case 'minutes': 63 | case 'minute': 64 | case 'mins': 65 | case 'min': 66 | case 'm': 67 | return n * m; 68 | case 'seconds': 69 | case 'second': 70 | case 'secs': 71 | case 'sec': 72 | case 's': 73 | return n * s; 74 | case 'milliseconds': 75 | case 'millisecond': 76 | case 'msecs': 77 | case 'msec': 78 | case 'ms': 79 | return n; 80 | } 81 | } 82 | 83 | /** 84 | * Short format for `ms`. 85 | * 86 | * @param {Number} ms 87 | * @return {String} 88 | * @api private 89 | */ 90 | 91 | function short(ms) { 92 | if (ms >= d) return Math.round(ms / d) + 'd'; 93 | if (ms >= h) return Math.round(ms / h) + 'h'; 94 | if (ms >= m) return Math.round(ms / m) + 'm'; 95 | if (ms >= s) return Math.round(ms / s) + 's'; 96 | return ms + 'ms'; 97 | } 98 | 99 | /** 100 | * Long format for `ms`. 101 | * 102 | * @param {Number} ms 103 | * @return {String} 104 | * @api private 105 | */ 106 | 107 | function long(ms) { 108 | return plural(ms, d, 'day') 109 | || plural(ms, h, 'hour') 110 | || plural(ms, m, 'minute') 111 | || plural(ms, s, 'second') 112 | || ms + ' ms'; 113 | } 114 | 115 | /** 116 | * Pluralization helper. 117 | */ 118 | 119 | function plural(ms, n, name) { 120 | if (ms < n) return; 121 | if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; 122 | return Math.ceil(ms / n) + ' ' + name + 's'; 123 | } 124 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/node_modules/ms/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ms", 3 | "version": "0.7.0", 4 | "description": "Tiny ms conversion utility", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/guille/ms.js.git" 8 | }, 9 | "main": "./index", 10 | "devDependencies": { 11 | "mocha": "*", 12 | "expect.js": "*", 13 | "serve": "*" 14 | }, 15 | "component": { 16 | "scripts": { 17 | "ms/index.js": "index.js" 18 | } 19 | }, 20 | "gitHead": "1e9cd9b05ef0dc26f765434d2bfee42394376e52", 21 | "bugs": { 22 | "url": "https://github.com/guille/ms.js/issues" 23 | }, 24 | "homepage": "https://github.com/guille/ms.js", 25 | "_id": "ms@0.7.0", 26 | "scripts": {}, 27 | "_shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83", 28 | "_from": "ms@0.7.0", 29 | "_npmVersion": "1.4.21", 30 | "_npmUser": { 31 | "name": "rauchg", 32 | "email": "rauchg@gmail.com" 33 | }, 34 | "maintainers": [ 35 | { 36 | "name": "rauchg", 37 | "email": "rauchg@gmail.com" 38 | } 39 | ], 40 | "dist": { 41 | "shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83", 42 | "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.0.tgz" 43 | }, 44 | "directories": {}, 45 | "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.0.tgz" 46 | } 47 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/debug/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "version": "2.1.3", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/visionmedia/debug.git" 7 | }, 8 | "description": "small debugging utility", 9 | "keywords": [ 10 | "debug", 11 | "log", 12 | "debugger" 13 | ], 14 | "author": { 15 | "name": "TJ Holowaychuk", 16 | "email": "tj@vision-media.ca" 17 | }, 18 | "contributors": [ 19 | { 20 | "name": "Nathan Rajlich", 21 | "email": "nathan@tootallnate.net", 22 | "url": "http://n8.io" 23 | } 24 | ], 25 | "license": "MIT", 26 | "dependencies": { 27 | "ms": "0.7.0" 28 | }, 29 | "devDependencies": { 30 | "browserify": "9.0.3", 31 | "mocha": "*" 32 | }, 33 | "main": "./node.js", 34 | "browser": "./browser.js", 35 | "component": { 36 | "scripts": { 37 | "debug/index.js": "browser.js", 38 | "debug/debug.js": "debug.js" 39 | } 40 | }, 41 | "gitHead": "0a8e4b7e0d2d1b55ef4e7422498ca24c677ae63a", 42 | "bugs": { 43 | "url": "https://github.com/visionmedia/debug/issues" 44 | }, 45 | "homepage": "https://github.com/visionmedia/debug", 46 | "_id": "debug@2.1.3", 47 | "scripts": {}, 48 | "_shasum": "ce8ab1b5ee8fbee2bfa3b633cab93d366b63418e", 49 | "_from": "debug@>=2.1.3 <2.2.0", 50 | "_npmVersion": "2.5.1", 51 | "_nodeVersion": "0.12.0", 52 | "_npmUser": { 53 | "name": "tootallnate", 54 | "email": "nathan@tootallnate.net" 55 | }, 56 | "maintainers": [ 57 | { 58 | "name": "tjholowaychuk", 59 | "email": "tj@vision-media.ca" 60 | }, 61 | { 62 | "name": "tootallnate", 63 | "email": "nathan@tootallnate.net" 64 | } 65 | ], 66 | "dist": { 67 | "shasum": "ce8ab1b5ee8fbee2bfa3b633cab93d366b63418e", 68 | "tarball": "http://registry.npmjs.org/debug/-/debug-2.1.3.tgz" 69 | }, 70 | "directories": {}, 71 | "_resolved": "https://registry.npmjs.org/debug/-/debug-2.1.3.tgz", 72 | "readme": "ERROR: No README data found!" 73 | } 74 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/HISTORY.md: -------------------------------------------------------------------------------- 1 | 0.3.4 / 2015-03-15 2 | ================== 3 | 4 | * deps: debug@~2.1.3 5 | - Fix high intensity foreground color for bold 6 | - deps: ms@0.7.0 7 | 8 | 0.3.3 / 2015-01-01 9 | ================== 10 | 11 | * deps: debug@~2.1.1 12 | * deps: on-finished@~2.2.0 13 | 14 | 0.3.2 / 2014-10-22 15 | ================== 16 | 17 | * deps: on-finished@~2.1.1 18 | - Fix handling of pipelined requests 19 | 20 | 0.3.1 / 2014-10-16 21 | ================== 22 | 23 | * deps: debug@~2.1.0 24 | - Implement `DEBUG_FD` env variable support 25 | 26 | 0.3.0 / 2014-09-17 27 | ================== 28 | 29 | * Terminate in progress response only on error 30 | * Use `on-finished` to determine request status 31 | 32 | 0.2.0 / 2014-09-03 33 | ================== 34 | 35 | * Set `X-Content-Type-Options: nosniff` header 36 | * deps: debug@~2.0.0 37 | 38 | 0.1.0 / 2014-07-16 39 | ================== 40 | 41 | * Respond after request fully read 42 | - prevents hung responses and socket hang ups 43 | * deps: debug@1.0.4 44 | 45 | 0.0.3 / 2014-07-11 46 | ================== 47 | 48 | * deps: debug@1.0.3 49 | - Add support for multiple wildcards in namespaces 50 | 51 | 0.0.2 / 2014-06-19 52 | ================== 53 | 54 | * Handle invalid status codes 55 | 56 | 0.0.1 / 2014-06-05 57 | ================== 58 | 59 | * deps: debug@1.0.2 60 | 61 | 0.0.0 / 2014-06-05 62 | ================== 63 | 64 | * Extracted from connect/express 65 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/escape-html/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build 4 | 5 | components: 6 | @Component install 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | .PHONY: clean 12 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/escape-html/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # escape-html 3 | 4 | Escape HTML entities 5 | 6 | ## Example 7 | 8 | ```js 9 | var escape = require('escape-html'); 10 | escape(str); 11 | ``` 12 | 13 | ## License 14 | 15 | MIT -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/escape-html/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "escape-html", 3 | "description": "Escape HTML entities", 4 | "version": "1.0.1", 5 | "keywords": ["escape", "html", "utility"], 6 | "dependencies": {}, 7 | "scripts": [ 8 | "index.js" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/escape-html/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Escape special characters in the given string of html. 3 | * 4 | * @param {String} html 5 | * @return {String} 6 | * @api private 7 | */ 8 | 9 | module.exports = function(html) { 10 | return String(html) 11 | .replace(/&/g, '&') 12 | .replace(/"/g, '"') 13 | .replace(/'/g, ''') 14 | .replace(//g, '>'); 16 | } 17 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/escape-html/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "escape-html", 3 | "description": "Escape HTML entities", 4 | "version": "1.0.1", 5 | "keywords": [ 6 | "escape", 7 | "html", 8 | "utility" 9 | ], 10 | "dependencies": {}, 11 | "main": "index.js", 12 | "component": { 13 | "scripts": { 14 | "escape-html/index.js": "index.js" 15 | } 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/component/escape-html.git" 20 | }, 21 | "bugs": { 22 | "url": "https://github.com/component/escape-html/issues" 23 | }, 24 | "homepage": "https://github.com/component/escape-html", 25 | "_id": "escape-html@1.0.1", 26 | "dist": { 27 | "shasum": "181a286ead397a39a92857cfb1d43052e356bff0", 28 | "tarball": "http://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz" 29 | }, 30 | "_from": "escape-html@1.0.1", 31 | "_npmVersion": "1.3.15", 32 | "_npmUser": { 33 | "name": "tjholowaychuk", 34 | "email": "tj@vision-media.ca" 35 | }, 36 | "maintainers": [ 37 | { 38 | "name": "tjholowaychuk", 39 | "email": "tj@vision-media.ca" 40 | } 41 | ], 42 | "directories": {}, 43 | "_shasum": "181a286ead397a39a92857cfb1d43052e356bff0", 44 | "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz", 45 | "readme": "ERROR: No README data found!" 46 | } 47 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/on-finished/HISTORY.md: -------------------------------------------------------------------------------- 1 | 2.2.1 / 2015-04-22 2 | ================== 3 | 4 | * Fix `isFinished(req)` when data buffered 5 | 6 | 2.2.0 / 2014-12-22 7 | ================== 8 | 9 | * Add message object to callback arguments 10 | 11 | 2.1.1 / 2014-10-22 12 | ================== 13 | 14 | * Fix handling of pipelined requests 15 | 16 | 2.1.0 / 2014-08-16 17 | ================== 18 | 19 | * Check if `socket` is detached 20 | * Return `undefined` for `isFinished` if state unknown 21 | 22 | 2.0.0 / 2014-08-16 23 | ================== 24 | 25 | * Add `isFinished` function 26 | * Move to `jshttp` organization 27 | * Remove support for plain socket argument 28 | * Rename to `on-finished` 29 | * Support both `req` and `res` as arguments 30 | * deps: ee-first@1.0.5 31 | 32 | 1.2.2 / 2014-06-10 33 | ================== 34 | 35 | * Reduce listeners added to emitters 36 | - avoids "event emitter leak" warnings when used multiple times on same request 37 | 38 | 1.2.1 / 2014-06-08 39 | ================== 40 | 41 | * Fix returned value when already finished 42 | 43 | 1.2.0 / 2014-06-05 44 | ================== 45 | 46 | * Call callback when called on already-finished socket 47 | 48 | 1.1.4 / 2014-05-27 49 | ================== 50 | 51 | * Support node.js 0.8 52 | 53 | 1.1.3 / 2014-04-30 54 | ================== 55 | 56 | * Make sure errors passed as instanceof `Error` 57 | 58 | 1.1.2 / 2014-04-18 59 | ================== 60 | 61 | * Default the `socket` to passed-in object 62 | 63 | 1.1.1 / 2014-01-16 64 | ================== 65 | 66 | * Rename module to `finished` 67 | 68 | 1.1.0 / 2013-12-25 69 | ================== 70 | 71 | * Call callback when called on already-errored socket 72 | 73 | 1.0.1 / 2013-12-20 74 | ================== 75 | 76 | * Actually pass the error to the callback 77 | 78 | 1.0.0 / 2013-12-20 79 | ================== 80 | 81 | * Initial release 82 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/on-finished/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2013 Jonathan Ong 4 | Copyright (c) 2014 Douglas Christopher Wilson 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | 'Software'), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014 Jonathan Ong me@jongleberry.com 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/README.md: -------------------------------------------------------------------------------- 1 | # EE First 2 | 3 | [![NPM version][npm-image]][npm-url] 4 | [![Build status][travis-image]][travis-url] 5 | [![Test coverage][coveralls-image]][coveralls-url] 6 | [![License][license-image]][license-url] 7 | [![Downloads][downloads-image]][downloads-url] 8 | [![Gittip][gittip-image]][gittip-url] 9 | 10 | Get the first event in a set of event emitters and event pairs, 11 | then clean up after itself. 12 | 13 | ## Install 14 | 15 | ```sh 16 | $ npm install ee-first 17 | ``` 18 | 19 | ## API 20 | 21 | ```js 22 | var first = require('ee-first') 23 | ``` 24 | 25 | ### first(arr, listener) 26 | 27 | Invoke `listener` on the first event from the list specified in `arr`. `arr` is 28 | an array of arrays, with each array in the format `[ee, ...event]`. `listener` 29 | will be called only once, the first time any of the given events are emitted. If 30 | `error` is one of the listened events, then if that fires first, the `listener` 31 | will be given the `err` argument. 32 | 33 | The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the 34 | first argument emitted from an `error` event, if applicable; `ee` is the event 35 | emitter that fired; `event` is the string event name that fired; and `args` is an 36 | array of the arguments that were emitted on the event. 37 | 38 | ```js 39 | var ee1 = new EventEmitter() 40 | var ee2 = new EventEmitter() 41 | 42 | first([ 43 | [ee1, 'close', 'end', 'error'], 44 | [ee2, 'error'] 45 | ], function (err, ee, event, args) { 46 | // listener invoked 47 | }) 48 | ``` 49 | 50 | #### .cancel() 51 | 52 | The group of listeners can be cancelled before being invoked and have all the event 53 | listeners removed from the underlying event emitters. 54 | 55 | ```js 56 | var thunk = first([ 57 | [ee1, 'close', 'end', 'error'], 58 | [ee2, 'error'] 59 | ], function (err, ee, event, args) { 60 | // listener invoked 61 | }) 62 | 63 | // cancel and clean up 64 | thunk.cancel() 65 | ``` 66 | 67 | [npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square 68 | [npm-url]: https://npmjs.org/package/ee-first 69 | [github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square 70 | [github-url]: https://github.com/jonathanong/ee-first/tags 71 | [travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square 72 | [travis-url]: https://travis-ci.org/jonathanong/ee-first 73 | [coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square 74 | [coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master 75 | [license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square 76 | [license-url]: LICENSE.md 77 | [downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square 78 | [downloads-url]: https://npmjs.org/package/ee-first 79 | [gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square 80 | [gittip-url]: https://www.gittip.com/jonathanong/ 81 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function first(stuff, done) { 3 | if (!Array.isArray(stuff)) 4 | throw new TypeError('arg must be an array of [ee, events...] arrays') 5 | 6 | var cleanups = [] 7 | 8 | for (var i = 0; i < stuff.length; i++) { 9 | var arr = stuff[i] 10 | 11 | if (!Array.isArray(arr) || arr.length < 2) 12 | throw new TypeError('each array member must be [ee, events...]') 13 | 14 | var ee = arr[0] 15 | 16 | for (var j = 1; j < arr.length; j++) { 17 | var event = arr[j] 18 | var fn = listener(event, callback) 19 | 20 | // listen to the event 21 | ee.on(event, fn) 22 | // push this listener to the list of cleanups 23 | cleanups.push({ 24 | ee: ee, 25 | event: event, 26 | fn: fn, 27 | }) 28 | } 29 | } 30 | 31 | function callback() { 32 | cleanup() 33 | done.apply(null, arguments) 34 | } 35 | 36 | function cleanup() { 37 | var x 38 | for (var i = 0; i < cleanups.length; i++) { 39 | x = cleanups[i] 40 | x.ee.removeListener(x.event, x.fn) 41 | } 42 | } 43 | 44 | function thunk(fn) { 45 | done = fn 46 | } 47 | 48 | thunk.cancel = cleanup 49 | 50 | return thunk 51 | } 52 | 53 | function listener(event, done) { 54 | return function onevent(arg1) { 55 | var args = new Array(arguments.length) 56 | var ee = this 57 | var err = event === 'error' 58 | ? arg1 59 | : null 60 | 61 | // copy args to prevent arguments escaping scope 62 | for (var i = 0; i < args.length; i++) { 63 | args[i] = arguments[i] 64 | } 65 | 66 | done(err, ee, event, args) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/on-finished/node_modules/ee-first/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ee-first", 3 | "description": "return the first event in a set of ee/event pairs", 4 | "version": "1.1.0", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Douglas Christopher Wilson", 13 | "email": "doug@somethingdoug.com" 14 | } 15 | ], 16 | "license": "MIT", 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/jonathanong/ee-first" 20 | }, 21 | "devDependencies": { 22 | "istanbul": "0.3.2", 23 | "mocha": "1" 24 | }, 25 | "files": [ 26 | "index.js", 27 | "LICENSE" 28 | ], 29 | "scripts": { 30 | "test": "mocha --reporter spec --bail --check-leaks test/", 31 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 32 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 33 | }, 34 | "gitHead": "a6412004da4745941af2fc98ec30c8da570da7ea", 35 | "bugs": { 36 | "url": "https://github.com/jonathanong/ee-first/issues" 37 | }, 38 | "homepage": "https://github.com/jonathanong/ee-first", 39 | "_id": "ee-first@1.1.0", 40 | "_shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", 41 | "_from": "ee-first@1.1.0", 42 | "_npmVersion": "1.4.21", 43 | "_npmUser": { 44 | "name": "dougwilson", 45 | "email": "doug@somethingdoug.com" 46 | }, 47 | "maintainers": [ 48 | { 49 | "name": "jongleberry", 50 | "email": "jonathanrichardong@gmail.com" 51 | }, 52 | { 53 | "name": "dougwilson", 54 | "email": "doug@somethingdoug.com" 55 | } 56 | ], 57 | "dist": { 58 | "shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", 59 | "tarball": "http://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz" 60 | }, 61 | "directories": {}, 62 | "_resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz" 63 | } 64 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/node_modules/on-finished/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "on-finished", 3 | "description": "Execute a callback when a request closes, finishes, or errors", 4 | "version": "2.2.1", 5 | "contributors": [ 6 | { 7 | "name": "Douglas Christopher Wilson", 8 | "email": "doug@somethingdoug.com" 9 | }, 10 | { 11 | "name": "Jonathan Ong", 12 | "email": "me@jongleberry.com", 13 | "url": "http://jongleberry.com" 14 | } 15 | ], 16 | "license": "MIT", 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/jshttp/on-finished" 20 | }, 21 | "dependencies": { 22 | "ee-first": "1.1.0" 23 | }, 24 | "devDependencies": { 25 | "istanbul": "0.3.9", 26 | "mocha": "~2.2.4" 27 | }, 28 | "engines": { 29 | "node": ">= 0.8" 30 | }, 31 | "files": [ 32 | "HISTORY.md", 33 | "LICENSE", 34 | "index.js" 35 | ], 36 | "scripts": { 37 | "test": "mocha --reporter spec --bail --check-leaks test/", 38 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 39 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 40 | }, 41 | "gitHead": "f3ecb92fb09d590d314ffe772a6ffd6f76c84223", 42 | "bugs": { 43 | "url": "https://github.com/jshttp/on-finished/issues" 44 | }, 45 | "homepage": "https://github.com/jshttp/on-finished", 46 | "_id": "on-finished@2.2.1", 47 | "_shasum": "5c85c1cc36299f78029653f667f27b6b99ebc029", 48 | "_from": "on-finished@>=2.2.0 <2.3.0", 49 | "_npmVersion": "1.4.28", 50 | "_npmUser": { 51 | "name": "dougwilson", 52 | "email": "doug@somethingdoug.com" 53 | }, 54 | "maintainers": [ 55 | { 56 | "name": "dougwilson", 57 | "email": "doug@somethingdoug.com" 58 | }, 59 | { 60 | "name": "jongleberry", 61 | "email": "jonathanrichardong@gmail.com" 62 | } 63 | ], 64 | "dist": { 65 | "shasum": "5c85c1cc36299f78029653f667f27b6b99ebc029", 66 | "tarball": "http://registry.npmjs.org/on-finished/-/on-finished-2.2.1.tgz" 67 | }, 68 | "directories": {}, 69 | "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.2.1.tgz", 70 | "readme": "ERROR: No README data found!" 71 | } 72 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/finalhandler/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "finalhandler", 3 | "description": "Node.js final http responder", 4 | "version": "0.3.4", 5 | "author": { 6 | "name": "Douglas Christopher Wilson", 7 | "email": "doug@somethingdoug.com" 8 | }, 9 | "license": "MIT", 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/pillarjs/finalhandler" 13 | }, 14 | "dependencies": { 15 | "debug": "~2.1.3", 16 | "escape-html": "1.0.1", 17 | "on-finished": "~2.2.0" 18 | }, 19 | "devDependencies": { 20 | "istanbul": "0.3.8", 21 | "mocha": "~2.2.1", 22 | "readable-stream": "~1.0.33", 23 | "supertest": "~0.15.0" 24 | }, 25 | "files": [ 26 | "LICENSE", 27 | "HISTORY.md", 28 | "index.js" 29 | ], 30 | "engines": { 31 | "node": ">= 0.8" 32 | }, 33 | "scripts": { 34 | "test": "mocha --reporter spec --bail --check-leaks test/", 35 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 36 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 37 | }, 38 | "gitHead": "63e18603c11effcacc06676f6fefbf270795459a", 39 | "bugs": { 40 | "url": "https://github.com/pillarjs/finalhandler/issues" 41 | }, 42 | "homepage": "https://github.com/pillarjs/finalhandler", 43 | "_id": "finalhandler@0.3.4", 44 | "_shasum": "4787d3573d079ae8b07536f26b0b911ebaf2a2ac", 45 | "_from": "finalhandler@0.3.4", 46 | "_npmVersion": "1.4.28", 47 | "_npmUser": { 48 | "name": "dougwilson", 49 | "email": "doug@somethingdoug.com" 50 | }, 51 | "maintainers": [ 52 | { 53 | "name": "dougwilson", 54 | "email": "doug@somethingdoug.com" 55 | }, 56 | { 57 | "name": "jongleberry", 58 | "email": "jonathanrichardong@gmail.com" 59 | }, 60 | { 61 | "name": "shtylman", 62 | "email": "shtylman@gmail.com" 63 | }, 64 | { 65 | "name": "tjholowaychuk", 66 | "email": "tj@vision-media.ca" 67 | }, 68 | { 69 | "name": "fishrock123", 70 | "email": "fishrock123@rocketmail.com" 71 | } 72 | ], 73 | "dist": { 74 | "shasum": "4787d3573d079ae8b07536f26b0b911ebaf2a2ac", 75 | "tarball": "http://registry.npmjs.org/finalhandler/-/finalhandler-0.3.4.tgz" 76 | }, 77 | "directories": {}, 78 | "_resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.3.4.tgz" 79 | } 80 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/parseurl/.npmignore: -------------------------------------------------------------------------------- 1 | benchmark/ 2 | coverage/ 3 | test/ 4 | .travis.yml 5 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/parseurl/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.3.0 / 2014-08-09 2 | ================== 3 | 4 | * Add `parseurl.original` for parsing `req.originalUrl` with fallback 5 | * Return `undefined` if `req.url` is `undefined` 6 | 7 | 1.2.0 / 2014-07-21 8 | ================== 9 | 10 | * Cache URLs based on original value 11 | * Remove no-longer-needed URL mis-parse work-around 12 | * Simplify the "fast-path" `RegExp` 13 | 14 | 1.1.3 / 2014-07-08 15 | ================== 16 | 17 | * Fix typo 18 | 19 | 1.1.2 / 2014-07-08 20 | ================== 21 | 22 | * Seriously fix Node.js 0.8 compatibility 23 | 24 | 1.1.1 / 2014-07-08 25 | ================== 26 | 27 | * Fix Node.js 0.8 compatibility 28 | 29 | 1.1.0 / 2014-07-08 30 | ================== 31 | 32 | * Incorporate URL href-only parse fast-path 33 | 34 | 1.0.1 / 2014-03-08 35 | ================== 36 | 37 | * Add missing `require` 38 | 39 | 1.0.0 / 2014-03-08 40 | ================== 41 | 42 | * Genesis from `connect` 43 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/parseurl/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | (The MIT License) 3 | 4 | Copyright (c) 2014 Jonathan Ong 5 | Copyright (c) 2014 Douglas Christopher Wilson 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | 'Software'), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/parseurl/README.md: -------------------------------------------------------------------------------- 1 | # parseurl 2 | 3 | [![NPM version](https://badge.fury.io/js/parseurl.svg)](http://badge.fury.io/js/parseurl) 4 | [![Build Status](https://travis-ci.org/expressjs/parseurl.svg?branch=master)](https://travis-ci.org/expressjs/parseurl) 5 | [![Coverage Status](https://img.shields.io/coveralls/expressjs/parseurl.svg?branch=master)](https://coveralls.io/r/expressjs/parseurl) 6 | 7 | Parse a URL with memoization. 8 | 9 | ## Install 10 | 11 | ```bash 12 | $ npm install parseurl 13 | ``` 14 | 15 | ## API 16 | 17 | ```js 18 | var parseurl = require('parseurl') 19 | ``` 20 | 21 | ### parseurl(req) 22 | 23 | Parse the URL of the given request object (looks at the `req.url` property) 24 | and return the result. The result is the same as `url.parse` in Node.js core. 25 | Calling this function multiple times on the same `req` where `req.url` does 26 | not change will return a cached parsed object, rather than parsing again. 27 | 28 | ### parseurl.original(req) 29 | 30 | Parse the original URL of the given request object and return the result. 31 | This works by trying to parse `req.originalUrl` if it is a string, otherwise 32 | parses `req.url`. The result is the same as `url.parse` in Node.js core. 33 | Calling this function multiple times on the same `req` where `req.originalUrl` 34 | does not change will return a cached parsed object, rather than parsing again. 35 | 36 | ## Benchmark 37 | 38 | ```bash 39 | $ npm run-script bench 40 | 41 | > parseurl@1.3.0 bench nodejs-parseurl 42 | > node benchmark/index.js 43 | 44 | > node benchmark/fullurl.js 45 | 46 | Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" 47 | 48 | 1 test completed. 49 | 2 tests completed. 50 | 3 tests completed. 51 | 52 | fasturl x 1,290,780 ops/sec ±0.46% (195 runs sampled) 53 | nativeurl x 56,401 ops/sec ±0.22% (196 runs sampled) 54 | parseurl x 55,231 ops/sec ±0.22% (194 runs sampled) 55 | 56 | > node benchmark/pathquery.js 57 | 58 | Parsing URL "/foo/bar?user=tj&pet=fluffy" 59 | 60 | 1 test completed. 61 | 2 tests completed. 62 | 3 tests completed. 63 | 64 | fasturl x 1,986,668 ops/sec ±0.27% (190 runs sampled) 65 | nativeurl x 98,740 ops/sec ±0.21% (195 runs sampled) 66 | parseurl x 2,628,171 ops/sec ±0.36% (195 runs sampled) 67 | 68 | > node benchmark/samerequest.js 69 | 70 | Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object 71 | 72 | 1 test completed. 73 | 2 tests completed. 74 | 3 tests completed. 75 | 76 | fasturl x 2,184,468 ops/sec ±0.40% (194 runs sampled) 77 | nativeurl x 99,437 ops/sec ±0.71% (194 runs sampled) 78 | parseurl x 10,498,005 ops/sec ±0.61% (186 runs sampled) 79 | 80 | > node benchmark/simplepath.js 81 | 82 | Parsing URL "/foo/bar" 83 | 84 | 1 test completed. 85 | 2 tests completed. 86 | 3 tests completed. 87 | 88 | fasturl x 4,535,825 ops/sec ±0.27% (191 runs sampled) 89 | nativeurl x 98,769 ops/sec ±0.54% (191 runs sampled) 90 | parseurl x 4,164,865 ops/sec ±0.34% (192 runs sampled) 91 | 92 | > node benchmark/slash.js 93 | 94 | Parsing URL "/" 95 | 96 | 1 test completed. 97 | 2 tests completed. 98 | 3 tests completed. 99 | 100 | fasturl x 4,908,405 ops/sec ±0.42% (191 runs sampled) 101 | nativeurl x 100,945 ops/sec ±0.59% (188 runs sampled) 102 | parseurl x 4,333,208 ops/sec ±0.27% (194 runs sampled) 103 | ``` 104 | 105 | ## License 106 | 107 | [MIT](LICENSE) 108 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/parseurl/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * parseurl 3 | * Copyright(c) 2014 Jonathan Ong 4 | * Copyright(c) 2014 Douglas Christopher Wilson 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var url = require('url') 13 | var parse = url.parse 14 | var Url = url.Url 15 | 16 | /** 17 | * Pattern for a simple path case. 18 | * See: https://github.com/joyent/node/pull/7878 19 | */ 20 | 21 | var simplePathRegExp = /^(\/\/?(?!\/)[^\?#\s]*)(\?[^#\s]*)?$/ 22 | 23 | /** 24 | * Exports. 25 | */ 26 | 27 | module.exports = parseurl 28 | module.exports.original = originalurl 29 | 30 | /** 31 | * Parse the `req` url with memoization. 32 | * 33 | * @param {ServerRequest} req 34 | * @return {Object} 35 | * @api public 36 | */ 37 | 38 | function parseurl(req) { 39 | var url = req.url 40 | 41 | if (url === undefined) { 42 | // URL is undefined 43 | return undefined 44 | } 45 | 46 | var parsed = req._parsedUrl 47 | 48 | if (fresh(url, parsed)) { 49 | // Return cached URL parse 50 | return parsed 51 | } 52 | 53 | // Parse the URL 54 | parsed = fastparse(url) 55 | parsed._raw = url 56 | 57 | return req._parsedUrl = parsed 58 | }; 59 | 60 | /** 61 | * Parse the `req` original url with fallback and memoization. 62 | * 63 | * @param {ServerRequest} req 64 | * @return {Object} 65 | * @api public 66 | */ 67 | 68 | function originalurl(req) { 69 | var url = req.originalUrl 70 | 71 | if (typeof url !== 'string') { 72 | // Fallback 73 | return parseurl(req) 74 | } 75 | 76 | var parsed = req._parsedOriginalUrl 77 | 78 | if (fresh(url, parsed)) { 79 | // Return cached URL parse 80 | return parsed 81 | } 82 | 83 | // Parse the URL 84 | parsed = fastparse(url) 85 | parsed._raw = url 86 | 87 | return req._parsedOriginalUrl = parsed 88 | }; 89 | 90 | /** 91 | * Parse the `str` url with fast-path short-cut. 92 | * 93 | * @param {string} str 94 | * @return {Object} 95 | * @api private 96 | */ 97 | 98 | function fastparse(str) { 99 | // Try fast path regexp 100 | // See: https://github.com/joyent/node/pull/7878 101 | var simplePath = typeof str === 'string' && simplePathRegExp.exec(str) 102 | 103 | // Construct simple URL 104 | if (simplePath) { 105 | var pathname = simplePath[1] 106 | var search = simplePath[2] || null 107 | var url = Url !== undefined 108 | ? new Url() 109 | : {} 110 | url.path = str 111 | url.href = str 112 | url.pathname = pathname 113 | url.search = search 114 | url.query = search && search.substr(1) 115 | 116 | return url 117 | } 118 | 119 | return parse(str) 120 | } 121 | 122 | /** 123 | * Determine if parsed is still fresh for url. 124 | * 125 | * @param {string} url 126 | * @param {object} parsedUrl 127 | * @return {boolean} 128 | * @api private 129 | */ 130 | 131 | function fresh(url, parsedUrl) { 132 | return typeof parsedUrl === 'object' 133 | && parsedUrl !== null 134 | && (Url === undefined || parsedUrl instanceof Url) 135 | && parsedUrl._raw === url 136 | } 137 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/parseurl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "parseurl", 3 | "description": "parse a url with memoization", 4 | "version": "1.3.0", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Douglas Christopher Wilson", 13 | "email": "doug@somethingdoug.com" 14 | } 15 | ], 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/expressjs/parseurl" 19 | }, 20 | "license": "MIT", 21 | "devDependencies": { 22 | "benchmark": "1.0.0", 23 | "beautify-benchmark": "0.2.4", 24 | "fast-url-parser": "~1.0.0", 25 | "istanbul": "0.3.0", 26 | "mocha": "~1.21.4" 27 | }, 28 | "scripts": { 29 | "bench": "node benchmark/index.js", 30 | "test": "mocha --check-leaks --bail --reporter spec test/", 31 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", 32 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" 33 | }, 34 | "gitHead": "03b7ccca240e2bef5df6c25797e99175d28fb2cb", 35 | "bugs": { 36 | "url": "https://github.com/expressjs/parseurl/issues" 37 | }, 38 | "homepage": "https://github.com/expressjs/parseurl", 39 | "_id": "parseurl@1.3.0", 40 | "_shasum": "b58046db4223e145afa76009e61bac87cc2281b3", 41 | "_from": "parseurl@>=1.3.0 <1.4.0", 42 | "_npmVersion": "1.4.21", 43 | "_npmUser": { 44 | "name": "dougwilson", 45 | "email": "doug@somethingdoug.com" 46 | }, 47 | "maintainers": [ 48 | { 49 | "name": "jongleberry", 50 | "email": "jonathanrichardong@gmail.com" 51 | }, 52 | { 53 | "name": "shtylman", 54 | "email": "shtylman@gmail.com" 55 | }, 56 | { 57 | "name": "dougwilson", 58 | "email": "doug@somethingdoug.com" 59 | }, 60 | { 61 | "name": "tjholowaychuk", 62 | "email": "tj@vision-media.ca" 63 | }, 64 | { 65 | "name": "mscdex", 66 | "email": "mscdex@mscdex.net" 67 | }, 68 | { 69 | "name": "fishrock123", 70 | "email": "fishrock123@rocketmail.com" 71 | } 72 | ], 73 | "dist": { 74 | "shasum": "b58046db4223e145afa76009e61bac87cc2281b3", 75 | "tarball": "http://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz" 76 | }, 77 | "directories": {}, 78 | "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz", 79 | "readme": "ERROR: No README data found!" 80 | } 81 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/utils-merge/.travis.yml: -------------------------------------------------------------------------------- 1 | language: "node_js" 2 | node_js: 3 | - "0.4" 4 | - "0.6" 5 | - "0.8" 6 | - "0.10" 7 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/utils-merge/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2013 Jared Hanson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/utils-merge/README.md: -------------------------------------------------------------------------------- 1 | # utils-merge 2 | 3 | Merges the properties from a source object into a destination object. 4 | 5 | ## Install 6 | 7 | $ npm install utils-merge 8 | 9 | ## Usage 10 | 11 | ```javascript 12 | var a = { foo: 'bar' } 13 | , b = { bar: 'baz' }; 14 | 15 | merge(a, b); 16 | // => { foo: 'bar', bar: 'baz' } 17 | ``` 18 | 19 | ## Tests 20 | 21 | $ npm install 22 | $ npm test 23 | 24 | [![Build Status](https://secure.travis-ci.org/jaredhanson/utils-merge.png)](http://travis-ci.org/jaredhanson/utils-merge) 25 | 26 | ## Credits 27 | 28 | - [Jared Hanson](http://github.com/jaredhanson) 29 | 30 | ## License 31 | 32 | [The MIT License](http://opensource.org/licenses/MIT) 33 | 34 | Copyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> 35 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/utils-merge/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Merge object b with object a. 3 | * 4 | * var a = { foo: 'bar' } 5 | * , b = { bar: 'baz' }; 6 | * 7 | * merge(a, b); 8 | * // => { foo: 'bar', bar: 'baz' } 9 | * 10 | * @param {Object} a 11 | * @param {Object} b 12 | * @return {Object} 13 | * @api public 14 | */ 15 | 16 | exports = module.exports = function(a, b){ 17 | if (a && b) { 18 | for (var key in b) { 19 | a[key] = b[key]; 20 | } 21 | } 22 | return a; 23 | }; 24 | -------------------------------------------------------------------------------- /node_modules/connect/node_modules/utils-merge/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "utils-merge", 3 | "version": "1.0.0", 4 | "description": "merge() utility function", 5 | "keywords": [ 6 | "util" 7 | ], 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/jaredhanson/utils-merge.git" 11 | }, 12 | "bugs": { 13 | "url": "http://github.com/jaredhanson/utils-merge/issues" 14 | }, 15 | "author": { 16 | "name": "Jared Hanson", 17 | "email": "jaredhanson@gmail.com", 18 | "url": "http://www.jaredhanson.net/" 19 | }, 20 | "licenses": [ 21 | { 22 | "type": "MIT", 23 | "url": "http://www.opensource.org/licenses/MIT" 24 | } 25 | ], 26 | "main": "./index", 27 | "dependencies": {}, 28 | "devDependencies": { 29 | "mocha": "1.x.x", 30 | "chai": "1.x.x" 31 | }, 32 | "scripts": { 33 | "test": "mocha --reporter spec --require test/bootstrap/node test/*.test.js" 34 | }, 35 | "engines": { 36 | "node": ">= 0.4.0" 37 | }, 38 | "_id": "utils-merge@1.0.0", 39 | "dist": { 40 | "shasum": "0294fb922bb9375153541c4f7096231f287c8af8", 41 | "tarball": "http://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz" 42 | }, 43 | "_from": "utils-merge@1.0.0", 44 | "_npmVersion": "1.2.25", 45 | "_npmUser": { 46 | "name": "jaredhanson", 47 | "email": "jaredhanson@gmail.com" 48 | }, 49 | "maintainers": [ 50 | { 51 | "name": "jaredhanson", 52 | "email": "jaredhanson@gmail.com" 53 | } 54 | ], 55 | "directories": {}, 56 | "_shasum": "0294fb922bb9375153541c4f7096231f287c8af8", 57 | "_resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", 58 | "readme": "ERROR: No README data found!", 59 | "homepage": "https://github.com/jaredhanson/utils-merge" 60 | } 61 | -------------------------------------------------------------------------------- /node_modules/connect/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "connect", 3 | "description": "High performance middleware framework", 4 | "version": "3.3.5", 5 | "author": { 6 | "name": "TJ Holowaychuk", 7 | "email": "tj@vision-media.ca", 8 | "url": "http://tjholowaychuk.com" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Douglas Christopher Wilson", 13 | "email": "doug@somethingdoug.com" 14 | }, 15 | { 16 | "name": "Jonathan Ong", 17 | "email": "me@jongleberry.com" 18 | }, 19 | { 20 | "name": "Tim Caswell", 21 | "email": "tim@creationix.com" 22 | } 23 | ], 24 | "keywords": [ 25 | "framework", 26 | "web", 27 | "middleware", 28 | "connect", 29 | "rack" 30 | ], 31 | "repository": { 32 | "type": "git", 33 | "url": "https://github.com/senchalabs/connect" 34 | }, 35 | "dependencies": { 36 | "debug": "~2.1.3", 37 | "finalhandler": "0.3.4", 38 | "parseurl": "~1.3.0", 39 | "utils-merge": "1.0.0" 40 | }, 41 | "devDependencies": { 42 | "istanbul": "0.3.8", 43 | "mocha": "~2.2.1", 44 | "should": "~5.2.0", 45 | "supertest": "~0.15.0" 46 | }, 47 | "license": "MIT", 48 | "files": [ 49 | "lib/", 50 | "LICENSE", 51 | "History.md", 52 | "Readme.md", 53 | "index.js" 54 | ], 55 | "engines": { 56 | "node": ">= 0.10.0" 57 | }, 58 | "scripts": { 59 | "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/", 60 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/", 61 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/" 62 | }, 63 | "gitHead": "a5ba676e9599e145af56ad95f0f4a7dd3832dc90", 64 | "bugs": { 65 | "url": "https://github.com/senchalabs/connect/issues" 66 | }, 67 | "homepage": "https://github.com/senchalabs/connect", 68 | "_id": "connect@3.3.5", 69 | "_shasum": "d1d9958c90a830bb429271e7a0a4aaaa9d033cab", 70 | "_from": "connect@*", 71 | "_npmVersion": "1.4.28", 72 | "_npmUser": { 73 | "name": "dougwilson", 74 | "email": "doug@somethingdoug.com" 75 | }, 76 | "maintainers": [ 77 | { 78 | "name": "tjholowaychuk", 79 | "email": "tj@vision-media.ca" 80 | }, 81 | { 82 | "name": "creationix", 83 | "email": "tim@creationix.com" 84 | }, 85 | { 86 | "name": "jongleberry", 87 | "email": "jonathanrichardong@gmail.com" 88 | }, 89 | { 90 | "name": "dougwilson", 91 | "email": "doug@somethingdoug.com" 92 | } 93 | ], 94 | "dist": { 95 | "shasum": "d1d9958c90a830bb429271e7a0a4aaaa9d033cab", 96 | "tarball": "http://registry.npmjs.org/connect/-/connect-3.3.5.tgz" 97 | }, 98 | "directories": {}, 99 | "_resolved": "https://registry.npmjs.org/connect/-/connect-3.3.5.tgz" 100 | } 101 | -------------------------------------------------------------------------------- /node_modules/serve-static/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2010 Sencha Inc. 4 | Copyright (c) 2011 LearnBoost 5 | Copyright (c) 2011 TJ Holowaychuk 6 | Copyright (c) 2014 Douglas Christopher Wilson 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | 'Software'), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/escape-html/.npmignore: -------------------------------------------------------------------------------- 1 | components 2 | build 3 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/escape-html/Makefile: -------------------------------------------------------------------------------- 1 | 2 | build: components index.js 3 | @component build 4 | 5 | components: 6 | @Component install 7 | 8 | clean: 9 | rm -fr build components template.js 10 | 11 | .PHONY: clean 12 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/escape-html/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # escape-html 3 | 4 | Escape HTML entities 5 | 6 | ## Example 7 | 8 | ```js 9 | var escape = require('escape-html'); 10 | escape(str); 11 | ``` 12 | 13 | ## License 14 | 15 | MIT -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/escape-html/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "escape-html", 3 | "description": "Escape HTML entities", 4 | "version": "1.0.1", 5 | "keywords": ["escape", "html", "utility"], 6 | "dependencies": {}, 7 | "scripts": [ 8 | "index.js" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/escape-html/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Escape special characters in the given string of html. 3 | * 4 | * @param {String} html 5 | * @return {String} 6 | * @api private 7 | */ 8 | 9 | module.exports = function(html) { 10 | return String(html) 11 | .replace(/&/g, '&') 12 | .replace(/"/g, '"') 13 | .replace(/'/g, ''') 14 | .replace(//g, '>'); 16 | } 17 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/escape-html/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "escape-html", 3 | "description": "Escape HTML entities", 4 | "version": "1.0.1", 5 | "keywords": [ 6 | "escape", 7 | "html", 8 | "utility" 9 | ], 10 | "dependencies": {}, 11 | "main": "index.js", 12 | "component": { 13 | "scripts": { 14 | "escape-html/index.js": "index.js" 15 | } 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/component/escape-html.git" 20 | }, 21 | "bugs": { 22 | "url": "https://github.com/component/escape-html/issues" 23 | }, 24 | "homepage": "https://github.com/component/escape-html", 25 | "_id": "escape-html@1.0.1", 26 | "dist": { 27 | "shasum": "181a286ead397a39a92857cfb1d43052e356bff0", 28 | "tarball": "http://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz" 29 | }, 30 | "_from": "escape-html@1.0.1", 31 | "_npmVersion": "1.3.15", 32 | "_npmUser": { 33 | "name": "tjholowaychuk", 34 | "email": "tj@vision-media.ca" 35 | }, 36 | "maintainers": [ 37 | { 38 | "name": "tjholowaychuk", 39 | "email": "tj@vision-media.ca" 40 | } 41 | ], 42 | "directories": {}, 43 | "_shasum": "181a286ead397a39a92857cfb1d43052e356bff0", 44 | "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz" 45 | } 46 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/parseurl/.npmignore: -------------------------------------------------------------------------------- 1 | benchmark/ 2 | coverage/ 3 | test/ 4 | .travis.yml 5 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/parseurl/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.3.0 / 2014-08-09 2 | ================== 3 | 4 | * Add `parseurl.original` for parsing `req.originalUrl` with fallback 5 | * Return `undefined` if `req.url` is `undefined` 6 | 7 | 1.2.0 / 2014-07-21 8 | ================== 9 | 10 | * Cache URLs based on original value 11 | * Remove no-longer-needed URL mis-parse work-around 12 | * Simplify the "fast-path" `RegExp` 13 | 14 | 1.1.3 / 2014-07-08 15 | ================== 16 | 17 | * Fix typo 18 | 19 | 1.1.2 / 2014-07-08 20 | ================== 21 | 22 | * Seriously fix Node.js 0.8 compatibility 23 | 24 | 1.1.1 / 2014-07-08 25 | ================== 26 | 27 | * Fix Node.js 0.8 compatibility 28 | 29 | 1.1.0 / 2014-07-08 30 | ================== 31 | 32 | * Incorporate URL href-only parse fast-path 33 | 34 | 1.0.1 / 2014-03-08 35 | ================== 36 | 37 | * Add missing `require` 38 | 39 | 1.0.0 / 2014-03-08 40 | ================== 41 | 42 | * Genesis from `connect` 43 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/parseurl/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | (The MIT License) 3 | 4 | Copyright (c) 2014 Jonathan Ong 5 | Copyright (c) 2014 Douglas Christopher Wilson 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | 'Software'), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/parseurl/README.md: -------------------------------------------------------------------------------- 1 | # parseurl 2 | 3 | [![NPM version](https://badge.fury.io/js/parseurl.svg)](http://badge.fury.io/js/parseurl) 4 | [![Build Status](https://travis-ci.org/expressjs/parseurl.svg?branch=master)](https://travis-ci.org/expressjs/parseurl) 5 | [![Coverage Status](https://img.shields.io/coveralls/expressjs/parseurl.svg?branch=master)](https://coveralls.io/r/expressjs/parseurl) 6 | 7 | Parse a URL with memoization. 8 | 9 | ## Install 10 | 11 | ```bash 12 | $ npm install parseurl 13 | ``` 14 | 15 | ## API 16 | 17 | ```js 18 | var parseurl = require('parseurl') 19 | ``` 20 | 21 | ### parseurl(req) 22 | 23 | Parse the URL of the given request object (looks at the `req.url` property) 24 | and return the result. The result is the same as `url.parse` in Node.js core. 25 | Calling this function multiple times on the same `req` where `req.url` does 26 | not change will return a cached parsed object, rather than parsing again. 27 | 28 | ### parseurl.original(req) 29 | 30 | Parse the original URL of the given request object and return the result. 31 | This works by trying to parse `req.originalUrl` if it is a string, otherwise 32 | parses `req.url`. The result is the same as `url.parse` in Node.js core. 33 | Calling this function multiple times on the same `req` where `req.originalUrl` 34 | does not change will return a cached parsed object, rather than parsing again. 35 | 36 | ## Benchmark 37 | 38 | ```bash 39 | $ npm run-script bench 40 | 41 | > parseurl@1.3.0 bench nodejs-parseurl 42 | > node benchmark/index.js 43 | 44 | > node benchmark/fullurl.js 45 | 46 | Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" 47 | 48 | 1 test completed. 49 | 2 tests completed. 50 | 3 tests completed. 51 | 52 | fasturl x 1,290,780 ops/sec ±0.46% (195 runs sampled) 53 | nativeurl x 56,401 ops/sec ±0.22% (196 runs sampled) 54 | parseurl x 55,231 ops/sec ±0.22% (194 runs sampled) 55 | 56 | > node benchmark/pathquery.js 57 | 58 | Parsing URL "/foo/bar?user=tj&pet=fluffy" 59 | 60 | 1 test completed. 61 | 2 tests completed. 62 | 3 tests completed. 63 | 64 | fasturl x 1,986,668 ops/sec ±0.27% (190 runs sampled) 65 | nativeurl x 98,740 ops/sec ±0.21% (195 runs sampled) 66 | parseurl x 2,628,171 ops/sec ±0.36% (195 runs sampled) 67 | 68 | > node benchmark/samerequest.js 69 | 70 | Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object 71 | 72 | 1 test completed. 73 | 2 tests completed. 74 | 3 tests completed. 75 | 76 | fasturl x 2,184,468 ops/sec ±0.40% (194 runs sampled) 77 | nativeurl x 99,437 ops/sec ±0.71% (194 runs sampled) 78 | parseurl x 10,498,005 ops/sec ±0.61% (186 runs sampled) 79 | 80 | > node benchmark/simplepath.js 81 | 82 | Parsing URL "/foo/bar" 83 | 84 | 1 test completed. 85 | 2 tests completed. 86 | 3 tests completed. 87 | 88 | fasturl x 4,535,825 ops/sec ±0.27% (191 runs sampled) 89 | nativeurl x 98,769 ops/sec ±0.54% (191 runs sampled) 90 | parseurl x 4,164,865 ops/sec ±0.34% (192 runs sampled) 91 | 92 | > node benchmark/slash.js 93 | 94 | Parsing URL "/" 95 | 96 | 1 test completed. 97 | 2 tests completed. 98 | 3 tests completed. 99 | 100 | fasturl x 4,908,405 ops/sec ±0.42% (191 runs sampled) 101 | nativeurl x 100,945 ops/sec ±0.59% (188 runs sampled) 102 | parseurl x 4,333,208 ops/sec ±0.27% (194 runs sampled) 103 | ``` 104 | 105 | ## License 106 | 107 | [MIT](LICENSE) 108 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/parseurl/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * parseurl 3 | * Copyright(c) 2014 Jonathan Ong 4 | * Copyright(c) 2014 Douglas Christopher Wilson 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var url = require('url') 13 | var parse = url.parse 14 | var Url = url.Url 15 | 16 | /** 17 | * Pattern for a simple path case. 18 | * See: https://github.com/joyent/node/pull/7878 19 | */ 20 | 21 | var simplePathRegExp = /^(\/\/?(?!\/)[^\?#\s]*)(\?[^#\s]*)?$/ 22 | 23 | /** 24 | * Exports. 25 | */ 26 | 27 | module.exports = parseurl 28 | module.exports.original = originalurl 29 | 30 | /** 31 | * Parse the `req` url with memoization. 32 | * 33 | * @param {ServerRequest} req 34 | * @return {Object} 35 | * @api public 36 | */ 37 | 38 | function parseurl(req) { 39 | var url = req.url 40 | 41 | if (url === undefined) { 42 | // URL is undefined 43 | return undefined 44 | } 45 | 46 | var parsed = req._parsedUrl 47 | 48 | if (fresh(url, parsed)) { 49 | // Return cached URL parse 50 | return parsed 51 | } 52 | 53 | // Parse the URL 54 | parsed = fastparse(url) 55 | parsed._raw = url 56 | 57 | return req._parsedUrl = parsed 58 | }; 59 | 60 | /** 61 | * Parse the `req` original url with fallback and memoization. 62 | * 63 | * @param {ServerRequest} req 64 | * @return {Object} 65 | * @api public 66 | */ 67 | 68 | function originalurl(req) { 69 | var url = req.originalUrl 70 | 71 | if (typeof url !== 'string') { 72 | // Fallback 73 | return parseurl(req) 74 | } 75 | 76 | var parsed = req._parsedOriginalUrl 77 | 78 | if (fresh(url, parsed)) { 79 | // Return cached URL parse 80 | return parsed 81 | } 82 | 83 | // Parse the URL 84 | parsed = fastparse(url) 85 | parsed._raw = url 86 | 87 | return req._parsedOriginalUrl = parsed 88 | }; 89 | 90 | /** 91 | * Parse the `str` url with fast-path short-cut. 92 | * 93 | * @param {string} str 94 | * @return {Object} 95 | * @api private 96 | */ 97 | 98 | function fastparse(str) { 99 | // Try fast path regexp 100 | // See: https://github.com/joyent/node/pull/7878 101 | var simplePath = typeof str === 'string' && simplePathRegExp.exec(str) 102 | 103 | // Construct simple URL 104 | if (simplePath) { 105 | var pathname = simplePath[1] 106 | var search = simplePath[2] || null 107 | var url = Url !== undefined 108 | ? new Url() 109 | : {} 110 | url.path = str 111 | url.href = str 112 | url.pathname = pathname 113 | url.search = search 114 | url.query = search && search.substr(1) 115 | 116 | return url 117 | } 118 | 119 | return parse(str) 120 | } 121 | 122 | /** 123 | * Determine if parsed is still fresh for url. 124 | * 125 | * @param {string} url 126 | * @param {object} parsedUrl 127 | * @return {boolean} 128 | * @api private 129 | */ 130 | 131 | function fresh(url, parsedUrl) { 132 | return typeof parsedUrl === 'object' 133 | && parsedUrl !== null 134 | && (Url === undefined || parsedUrl instanceof Url) 135 | && parsedUrl._raw === url 136 | } 137 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/parseurl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "parseurl", 3 | "description": "parse a url with memoization", 4 | "version": "1.3.0", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Douglas Christopher Wilson", 13 | "email": "doug@somethingdoug.com" 14 | } 15 | ], 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/expressjs/parseurl" 19 | }, 20 | "license": "MIT", 21 | "devDependencies": { 22 | "benchmark": "1.0.0", 23 | "beautify-benchmark": "0.2.4", 24 | "fast-url-parser": "~1.0.0", 25 | "istanbul": "0.3.0", 26 | "mocha": "~1.21.4" 27 | }, 28 | "scripts": { 29 | "bench": "node benchmark/index.js", 30 | "test": "mocha --check-leaks --bail --reporter spec test/", 31 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", 32 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" 33 | }, 34 | "gitHead": "03b7ccca240e2bef5df6c25797e99175d28fb2cb", 35 | "bugs": { 36 | "url": "https://github.com/expressjs/parseurl/issues" 37 | }, 38 | "homepage": "https://github.com/expressjs/parseurl", 39 | "_id": "parseurl@1.3.0", 40 | "_shasum": "b58046db4223e145afa76009e61bac87cc2281b3", 41 | "_from": "parseurl@>=1.3.0 <1.4.0", 42 | "_npmVersion": "1.4.21", 43 | "_npmUser": { 44 | "name": "dougwilson", 45 | "email": "doug@somethingdoug.com" 46 | }, 47 | "maintainers": [ 48 | { 49 | "name": "jongleberry", 50 | "email": "jonathanrichardong@gmail.com" 51 | }, 52 | { 53 | "name": "shtylman", 54 | "email": "shtylman@gmail.com" 55 | }, 56 | { 57 | "name": "dougwilson", 58 | "email": "doug@somethingdoug.com" 59 | }, 60 | { 61 | "name": "tjholowaychuk", 62 | "email": "tj@vision-media.ca" 63 | }, 64 | { 65 | "name": "mscdex", 66 | "email": "mscdex@mscdex.net" 67 | }, 68 | { 69 | "name": "fishrock123", 70 | "email": "fishrock123@rocketmail.com" 71 | } 72 | ], 73 | "dist": { 74 | "shasum": "b58046db4223e145afa76009e61bac87cc2281b3", 75 | "tarball": "http://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz" 76 | }, 77 | "directories": {}, 78 | "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz", 79 | "readme": "ERROR: No README data found!" 80 | } 81 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 TJ Holowaychuk 4 | Copyright (c) 2014-2015 Douglas Christopher Wilson 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | 'Software'), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/.bin/mime: -------------------------------------------------------------------------------- 1 | ../mime/cli.js -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/debug/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | example 5 | *.sock 6 | dist 7 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/debug/Makefile: -------------------------------------------------------------------------------- 1 | 2 | # get Makefile directory name: http://stackoverflow.com/a/5982798/376773 3 | THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) 4 | THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) 5 | 6 | # BIN directory 7 | BIN := $(THIS_DIR)/node_modules/.bin 8 | 9 | # applications 10 | NODE ?= $(shell which node) 11 | NPM ?= $(NODE) $(shell which npm) 12 | BROWSERIFY ?= $(NODE) $(BIN)/browserify 13 | 14 | all: dist/debug.js 15 | 16 | install: node_modules 17 | 18 | clean: 19 | @rm -rf dist 20 | 21 | dist: 22 | @mkdir -p $@ 23 | 24 | dist/debug.js: node_modules browser.js debug.js dist 25 | @$(BROWSERIFY) \ 26 | --standalone debug \ 27 | . > $@ 28 | 29 | distclean: clean 30 | @rm -rf node_modules 31 | 32 | node_modules: package.json 33 | @NODE_ENV= $(NPM) install 34 | @touch node_modules 35 | 36 | .PHONY: all install clean distclean 37 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/debug/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "visionmedia-debug", 3 | "main": "dist/debug.js", 4 | "version": "2.2.0", 5 | "homepage": "https://github.com/visionmedia/debug", 6 | "authors": [ 7 | "TJ Holowaychuk " 8 | ], 9 | "description": "visionmedia-debug", 10 | "moduleType": [ 11 | "amd", 12 | "es6", 13 | "globals", 14 | "node" 15 | ], 16 | "keywords": [ 17 | "visionmedia", 18 | "debug" 19 | ], 20 | "license": "MIT", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "tests" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.2.0", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "browser.js", 12 | "scripts": [ 13 | "browser.js", 14 | "debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/debug/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "version": "2.2.0", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/visionmedia/debug.git" 7 | }, 8 | "description": "small debugging utility", 9 | "keywords": [ 10 | "debug", 11 | "log", 12 | "debugger" 13 | ], 14 | "author": { 15 | "name": "TJ Holowaychuk", 16 | "email": "tj@vision-media.ca" 17 | }, 18 | "contributors": [ 19 | { 20 | "name": "Nathan Rajlich", 21 | "email": "nathan@tootallnate.net", 22 | "url": "http://n8.io" 23 | } 24 | ], 25 | "license": "MIT", 26 | "dependencies": { 27 | "ms": "0.7.1" 28 | }, 29 | "devDependencies": { 30 | "browserify": "9.0.3", 31 | "mocha": "*" 32 | }, 33 | "main": "./node.js", 34 | "browser": "./browser.js", 35 | "component": { 36 | "scripts": { 37 | "debug/index.js": "browser.js", 38 | "debug/debug.js": "debug.js" 39 | } 40 | }, 41 | "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", 42 | "bugs": { 43 | "url": "https://github.com/visionmedia/debug/issues" 44 | }, 45 | "homepage": "https://github.com/visionmedia/debug", 46 | "_id": "debug@2.2.0", 47 | "scripts": {}, 48 | "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", 49 | "_from": "debug@>=2.2.0 <2.3.0", 50 | "_npmVersion": "2.7.4", 51 | "_nodeVersion": "0.12.2", 52 | "_npmUser": { 53 | "name": "tootallnate", 54 | "email": "nathan@tootallnate.net" 55 | }, 56 | "maintainers": [ 57 | { 58 | "name": "tjholowaychuk", 59 | "email": "tj@vision-media.ca" 60 | }, 61 | { 62 | "name": "tootallnate", 63 | "email": "nathan@tootallnate.net" 64 | } 65 | ], 66 | "dist": { 67 | "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", 68 | "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz" 69 | }, 70 | "directories": {}, 71 | "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz" 72 | } 73 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/depd/History.md: -------------------------------------------------------------------------------- 1 | 1.0.1 / 2015-04-07 2 | ================== 3 | 4 | * Fix `TypeError`s when under `'use strict'` code 5 | * Fix useless type name on auto-generated messages 6 | * Support io.js 1.x 7 | * Support Node.js 0.12 8 | 9 | 1.0.0 / 2014-09-17 10 | ================== 11 | 12 | * No changes 13 | 14 | 0.4.5 / 2014-09-09 15 | ================== 16 | 17 | * Improve call speed to functions using the function wrapper 18 | * Support Node.js 0.6 19 | 20 | 0.4.4 / 2014-07-27 21 | ================== 22 | 23 | * Work-around v8 generating empty stack traces 24 | 25 | 0.4.3 / 2014-07-26 26 | ================== 27 | 28 | * Fix exception when global `Error.stackTraceLimit` is too low 29 | 30 | 0.4.2 / 2014-07-19 31 | ================== 32 | 33 | * Correct call site for wrapped functions and properties 34 | 35 | 0.4.1 / 2014-07-19 36 | ================== 37 | 38 | * Improve automatic message generation for function properties 39 | 40 | 0.4.0 / 2014-07-19 41 | ================== 42 | 43 | * Add `TRACE_DEPRECATION` environment variable 44 | * Remove non-standard grey color from color output 45 | * Support `--no-deprecation` argument 46 | * Support `--trace-deprecation` argument 47 | * Support `deprecate.property(fn, prop, message)` 48 | 49 | 0.3.0 / 2014-06-16 50 | ================== 51 | 52 | * Add `NO_DEPRECATION` environment variable 53 | 54 | 0.2.0 / 2014-06-15 55 | ================== 56 | 57 | * Add `deprecate.property(obj, prop, message)` 58 | * Remove `supports-color` dependency for node.js 0.8 59 | 60 | 0.1.0 / 2014-06-15 61 | ================== 62 | 63 | * Add `deprecate.function(fn, message)` 64 | * Add `process.on('deprecation', fn)` emitter 65 | * Automatically generate message when omitted from `deprecate()` 66 | 67 | 0.0.1 / 2014-06-15 68 | ================== 69 | 70 | * Fix warning for dynamic calls at singe call site 71 | 72 | 0.0.0 / 2014-06-15 73 | ================== 74 | 75 | * Initial implementation 76 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/depd/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/depd/lib/compat/buffer-concat.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * depd 3 | * Copyright(c) 2014 Douglas Christopher Wilson 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | */ 10 | 11 | module.exports = bufferConcat 12 | 13 | /** 14 | * Concatenate an array of Buffers. 15 | */ 16 | 17 | function bufferConcat(bufs) { 18 | var length = 0 19 | 20 | for (var i = 0, len = bufs.length; i < len; i++) { 21 | length += bufs[i].length 22 | } 23 | 24 | var buf = new Buffer(length) 25 | var pos = 0 26 | 27 | for (var i = 0, len = bufs.length; i < len; i++) { 28 | bufs[i].copy(buf, pos) 29 | pos += bufs[i].length 30 | } 31 | 32 | return buf 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/depd/lib/compat/callsite-tostring.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * depd 3 | * Copyright(c) 2014 Douglas Christopher Wilson 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | */ 10 | 11 | module.exports = callSiteToString 12 | 13 | /** 14 | * Format a CallSite file location to a string. 15 | */ 16 | 17 | function callSiteFileLocation(callSite) { 18 | var fileName 19 | var fileLocation = '' 20 | 21 | if (callSite.isNative()) { 22 | fileLocation = 'native' 23 | } else if (callSite.isEval()) { 24 | fileName = callSite.getScriptNameOrSourceURL() 25 | if (!fileName) { 26 | fileLocation = callSite.getEvalOrigin() 27 | } 28 | } else { 29 | fileName = callSite.getFileName() 30 | } 31 | 32 | if (fileName) { 33 | fileLocation += fileName 34 | 35 | var lineNumber = callSite.getLineNumber() 36 | if (lineNumber != null) { 37 | fileLocation += ':' + lineNumber 38 | 39 | var columnNumber = callSite.getColumnNumber() 40 | if (columnNumber) { 41 | fileLocation += ':' + columnNumber 42 | } 43 | } 44 | } 45 | 46 | return fileLocation || 'unknown source' 47 | } 48 | 49 | /** 50 | * Format a CallSite to a string. 51 | */ 52 | 53 | function callSiteToString(callSite) { 54 | var addSuffix = true 55 | var fileLocation = callSiteFileLocation(callSite) 56 | var functionName = callSite.getFunctionName() 57 | var isConstructor = callSite.isConstructor() 58 | var isMethodCall = !(callSite.isToplevel() || isConstructor) 59 | var line = '' 60 | 61 | if (isMethodCall) { 62 | var methodName = callSite.getMethodName() 63 | var typeName = getConstructorName(callSite) 64 | 65 | if (functionName) { 66 | if (typeName && functionName.indexOf(typeName) !== 0) { 67 | line += typeName + '.' 68 | } 69 | 70 | line += functionName 71 | 72 | if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { 73 | line += ' [as ' + methodName + ']' 74 | } 75 | } else { 76 | line += typeName + '.' + (methodName || '') 77 | } 78 | } else if (isConstructor) { 79 | line += 'new ' + (functionName || '') 80 | } else if (functionName) { 81 | line += functionName 82 | } else { 83 | addSuffix = false 84 | line += fileLocation 85 | } 86 | 87 | if (addSuffix) { 88 | line += ' (' + fileLocation + ')' 89 | } 90 | 91 | return line 92 | } 93 | 94 | /** 95 | * Get constructor name of reviver. 96 | */ 97 | 98 | function getConstructorName(obj) { 99 | var receiver = obj.receiver 100 | return (receiver.constructor && receiver.constructor.name) || null 101 | } 102 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/depd/lib/compat/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * depd 3 | * Copyright(c) 2014 Douglas Christopher Wilson 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module exports. 9 | */ 10 | 11 | lazyProperty(module.exports, 'bufferConcat', function bufferConcat() { 12 | return Buffer.concat || require('./buffer-concat') 13 | }) 14 | 15 | lazyProperty(module.exports, 'callSiteToString', function callSiteToString() { 16 | var limit = Error.stackTraceLimit 17 | var obj = {} 18 | var prep = Error.prepareStackTrace 19 | 20 | function prepareObjectStackTrace(obj, stack) { 21 | return stack 22 | } 23 | 24 | Error.prepareStackTrace = prepareObjectStackTrace 25 | Error.stackTraceLimit = 2 26 | 27 | // capture the stack 28 | Error.captureStackTrace(obj) 29 | 30 | // slice the stack 31 | var stack = obj.stack.slice() 32 | 33 | Error.prepareStackTrace = prep 34 | Error.stackTraceLimit = limit 35 | 36 | return stack[0].toString ? toString : require('./callsite-tostring') 37 | }) 38 | 39 | /** 40 | * Define a lazy property. 41 | */ 42 | 43 | function lazyProperty(obj, prop, getter) { 44 | function get() { 45 | var val = getter() 46 | 47 | Object.defineProperty(obj, prop, { 48 | configurable: true, 49 | enumerable: true, 50 | value: val 51 | }) 52 | 53 | return val 54 | } 55 | 56 | Object.defineProperty(obj, prop, { 57 | configurable: true, 58 | enumerable: true, 59 | get: get 60 | }) 61 | } 62 | 63 | /** 64 | * Call toString() on the obj 65 | */ 66 | 67 | function toString(obj) { 68 | return obj.toString() 69 | } 70 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/depd/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "depd", 3 | "description": "Deprecate all the things", 4 | "version": "1.0.1", 5 | "author": { 6 | "name": "Douglas Christopher Wilson", 7 | "email": "doug@somethingdoug.com" 8 | }, 9 | "license": "MIT", 10 | "keywords": [ 11 | "deprecate", 12 | "deprecated" 13 | ], 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/dougwilson/nodejs-depd" 17 | }, 18 | "devDependencies": { 19 | "benchmark": "1.0.0", 20 | "beautify-benchmark": "0.2.4", 21 | "istanbul": "0.3.5", 22 | "mocha": "~1.21.5" 23 | }, 24 | "files": [ 25 | "lib/", 26 | "History.md", 27 | "LICENSE", 28 | "index.js", 29 | "Readme.md" 30 | ], 31 | "engines": { 32 | "node": ">= 0.6" 33 | }, 34 | "scripts": { 35 | "bench": "node benchmark/index.js", 36 | "test": "mocha --reporter spec --bail test/", 37 | "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", 38 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" 39 | }, 40 | "gitHead": "769e0f8108463c35a6937a9d634ab19fee45100a", 41 | "bugs": { 42 | "url": "https://github.com/dougwilson/nodejs-depd/issues" 43 | }, 44 | "homepage": "https://github.com/dougwilson/nodejs-depd", 45 | "_id": "depd@1.0.1", 46 | "_shasum": "80aec64c9d6d97e65cc2a9caa93c0aa6abf73aaa", 47 | "_from": "depd@>=1.0.1 <1.1.0", 48 | "_npmVersion": "1.4.28", 49 | "_npmUser": { 50 | "name": "dougwilson", 51 | "email": "doug@somethingdoug.com" 52 | }, 53 | "maintainers": [ 54 | { 55 | "name": "dougwilson", 56 | "email": "doug@somethingdoug.com" 57 | } 58 | ], 59 | "dist": { 60 | "shasum": "80aec64c9d6d97e65cc2a9caa93c0aa6abf73aaa", 61 | "tarball": "http://registry.npmjs.org/depd/-/depd-1.0.1.tgz" 62 | }, 63 | "directories": {}, 64 | "_resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", 65 | "readme": "ERROR: No README data found!" 66 | } 67 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/destroy/README.md: -------------------------------------------------------------------------------- 1 | # Destroy 2 | 3 | [![NPM version][npm-image]][npm-url] 4 | [![Build status][travis-image]][travis-url] 5 | [![Test coverage][coveralls-image]][coveralls-url] 6 | [![Dependency Status][david-image]][david-url] 7 | [![License][license-image]][license-url] 8 | [![Downloads][downloads-image]][downloads-url] 9 | [![Gittip][gittip-image]][gittip-url] 10 | 11 | Destroy a stream. 12 | 13 | ## API 14 | 15 | ```js 16 | var destroy = require('destroy') 17 | 18 | var fs = require('fs') 19 | var stream = fs.createReadStream('package.json') 20 | destroy(stream) 21 | ``` 22 | 23 | [npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square 24 | [npm-url]: https://npmjs.org/package/destroy 25 | [github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square 26 | [github-url]: https://github.com/stream-utils/destroy/tags 27 | [travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square 28 | [travis-url]: https://travis-ci.org/stream-utils/destroy 29 | [coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square 30 | [coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master 31 | [david-image]: http://img.shields.io/david/stream-utils/destroy.svg?style=flat-square 32 | [david-url]: https://david-dm.org/stream-utils/destroy 33 | [license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square 34 | [license-url]: LICENSE.md 35 | [downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square 36 | [downloads-url]: https://npmjs.org/package/destroy 37 | [gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square 38 | [gittip-url]: https://www.gittip.com/jonathanong/ 39 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/destroy/index.js: -------------------------------------------------------------------------------- 1 | var ReadStream = require('fs').ReadStream 2 | var Stream = require('stream') 3 | 4 | module.exports = function destroy(stream) { 5 | if (stream instanceof ReadStream) { 6 | return destroyReadStream(stream) 7 | } 8 | 9 | if (!(stream instanceof Stream)) { 10 | return stream 11 | } 12 | 13 | if (typeof stream.destroy === 'function') { 14 | stream.destroy() 15 | } 16 | 17 | return stream 18 | } 19 | 20 | function destroyReadStream(stream) { 21 | stream.destroy() 22 | 23 | if (typeof stream.close === 'function') { 24 | // node.js core bug work-around 25 | stream.on('open', onopenClose) 26 | } 27 | 28 | return stream 29 | } 30 | 31 | function onopenClose() { 32 | if (typeof this.fd === 'number') { 33 | // actually close down the fd 34 | this.close() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/destroy/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "destroy", 3 | "description": "destroy a stream if possible", 4 | "version": "1.0.3", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Douglas Christopher Wilson", 13 | "email": "doug@somethingdoug.com" 14 | } 15 | ], 16 | "license": "MIT", 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/stream-utils/destroy" 20 | }, 21 | "devDependencies": { 22 | "istanbul": "0", 23 | "mocha": "1" 24 | }, 25 | "scripts": { 26 | "test": "mocha --reporter spec", 27 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", 28 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" 29 | }, 30 | "files": [ 31 | "index.js" 32 | ], 33 | "keywords": [ 34 | "stream", 35 | "streams", 36 | "destroy", 37 | "cleanup", 38 | "leak", 39 | "fd" 40 | ], 41 | "gitHead": "50af95ece4a70202f9301bc3edc8f9fdbbad0f26", 42 | "bugs": { 43 | "url": "https://github.com/stream-utils/destroy/issues" 44 | }, 45 | "homepage": "https://github.com/stream-utils/destroy", 46 | "_id": "destroy@1.0.3", 47 | "_shasum": "b433b4724e71fd8551d9885174851c5fc377e2c9", 48 | "_from": "destroy@1.0.3", 49 | "_npmVersion": "1.4.21", 50 | "_npmUser": { 51 | "name": "jongleberry", 52 | "email": "jonathanrichardong@gmail.com" 53 | }, 54 | "maintainers": [ 55 | { 56 | "name": "jongleberry", 57 | "email": "jonathanrichardong@gmail.com" 58 | } 59 | ], 60 | "dist": { 61 | "shasum": "b433b4724e71fd8551d9885174851c5fc377e2c9", 62 | "tarball": "http://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz" 63 | }, 64 | "directories": {}, 65 | "_resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz", 66 | "readme": "ERROR: No README data found!" 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.6.0 / 2015-05-10 2 | ================== 3 | 4 | * Improve support for JXcore 5 | * Remove requirement of `atime` in the stats object 6 | * Support "fake" stats objects in environments without `fs` 7 | 8 | 1.5.1 / 2014-11-19 9 | ================== 10 | 11 | * deps: crc@3.2.1 12 | - Minor fixes 13 | 14 | 1.5.0 / 2014-10-14 15 | ================== 16 | 17 | * Improve string performance 18 | * Slightly improve speed for weak ETags over 1KB 19 | 20 | 1.4.0 / 2014-09-21 21 | ================== 22 | 23 | * Support "fake" stats objects 24 | * Support Node.js 0.6 25 | 26 | 1.3.1 / 2014-09-14 27 | ================== 28 | 29 | * Use the (new and improved) `crc` for crc32 30 | 31 | 1.3.0 / 2014-08-29 32 | ================== 33 | 34 | * Default strings to strong ETags 35 | * Improve speed for weak ETags over 1KB 36 | 37 | 1.2.1 / 2014-08-29 38 | ================== 39 | 40 | * Use the (much faster) `buffer-crc32` for crc32 41 | 42 | 1.2.0 / 2014-08-24 43 | ================== 44 | 45 | * Add support for file stat objects 46 | 47 | 1.1.0 / 2014-08-24 48 | ================== 49 | 50 | * Add fast-path for empty entity 51 | * Add weak ETag generation 52 | * Shrink size of generated ETags 53 | 54 | 1.0.1 / 2014-08-24 55 | ================== 56 | 57 | * Fix behavior of string containing Unicode 58 | 59 | 1.0.0 / 2014-05-18 60 | ================== 61 | 62 | * Initial release 63 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014-2015 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/.npmignore: -------------------------------------------------------------------------------- 1 | benchmark 2 | src 3 | test 4 | .travis.yml 5 | bitcoin.png 6 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2014 Alex Gorbatchev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/crc.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | var CRC, hex; 3 | 4 | hex = require('./hex'); 5 | 6 | module.exports = CRC = (function() { 7 | CRC.prototype.INIT_CRC = 0x00; 8 | 9 | CRC.prototype.XOR_MASK = 0x00; 10 | 11 | CRC.prototype.WIDTH = 0; 12 | 13 | CRC.prototype.pack = function(crc) { 14 | return ''; 15 | }; 16 | 17 | CRC.prototype.each_byte = function(buf, cb) { 18 | var i, _i, _ref, _results; 19 | if (!Buffer.isBuffer(buf)) { 20 | buf = Buffer(buf); 21 | } 22 | _results = []; 23 | for (i = _i = 0, _ref = buf.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) { 24 | _results.push(cb(buf[i])); 25 | } 26 | return _results; 27 | }; 28 | 29 | function CRC() { 30 | this.crc = this.INIT_CRC; 31 | } 32 | 33 | CRC.prototype.digest_length = function() { 34 | return Math.ceil(this.WIDTH / 8.0); 35 | }; 36 | 37 | CRC.prototype.update = function(data) {}; 38 | 39 | CRC.prototype.reset = function() { 40 | return this.crc = this.INIT_CRC; 41 | }; 42 | 43 | CRC.prototype.checksum = function(signed) { 44 | var sum; 45 | if (signed == null) { 46 | signed = true; 47 | } 48 | sum = this.crc ^ this.XOR_MASK; 49 | if (signed) { 50 | sum = sum >>> 0; 51 | } 52 | return sum; 53 | }; 54 | 55 | CRC.prototype.finish = function() { 56 | return this.pack(this.checksum()); 57 | }; 58 | 59 | CRC.prototype.hexdigest = function(value) { 60 | var result; 61 | if (value != null) { 62 | this.update(value); 63 | } 64 | result = this.finish(); 65 | this.reset(); 66 | return result; 67 | }; 68 | 69 | return CRC; 70 | 71 | })(); 72 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/crc1.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | var Buffer, create; 3 | 4 | Buffer = require('buffer').Buffer; 5 | 6 | create = require('./create'); 7 | 8 | module.exports = create('crc1', function(buf, previous) { 9 | var accum, byte, crc, _i, _len; 10 | if (!Buffer.isBuffer(buf)) { 11 | buf = Buffer(buf); 12 | } 13 | crc = ~~previous; 14 | accum = 0; 15 | for (_i = 0, _len = buf.length; _i < _len; _i++) { 16 | byte = buf[_i]; 17 | accum += byte; 18 | } 19 | crc += accum % 256; 20 | return crc % 256; 21 | }); 22 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/crc16.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | var Buffer, TABLE, create; 3 | 4 | Buffer = require('buffer').Buffer; 5 | 6 | create = require('./create'); 7 | 8 | TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040]; 9 | 10 | if (typeof Int32Array !== 'undefined') { 11 | TABLE = new Int32Array(TABLE); 12 | } 13 | 14 | module.exports = create('crc-16', function(buf, previous) { 15 | var byte, crc, _i, _len; 16 | if (!Buffer.isBuffer(buf)) { 17 | buf = Buffer(buf); 18 | } 19 | crc = ~~previous; 20 | for (_i = 0, _len = buf.length; _i < _len; _i++) { 21 | byte = buf[_i]; 22 | crc = (TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8)) & 0xffff; 23 | } 24 | return crc; 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/crc16_ccitt.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | var Buffer, TABLE, create; 3 | 4 | Buffer = require('buffer').Buffer; 5 | 6 | create = require('./create'); 7 | 8 | TABLE = [0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0]; 9 | 10 | if (typeof Int32Array !== 'undefined') { 11 | TABLE = new Int32Array(TABLE); 12 | } 13 | 14 | module.exports = create('ccitt', function(buf, previous) { 15 | var byte, crc, _i, _len; 16 | if (!Buffer.isBuffer(buf)) { 17 | buf = Buffer(buf); 18 | } 19 | crc = previous != null ? ~~previous : 0xffff; 20 | for (_i = 0, _len = buf.length; _i < _len; _i++) { 21 | byte = buf[_i]; 22 | crc = (TABLE[((crc >> 8) ^ byte) & 0xff] ^ (crc << 8)) & 0xffff; 23 | } 24 | return crc; 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/crc16_modbus.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | var Buffer, TABLE, create; 3 | 4 | Buffer = require('buffer').Buffer; 5 | 6 | create = require('./create'); 7 | 8 | TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040]; 9 | 10 | if (typeof Int32Array !== 'undefined') { 11 | TABLE = new Int32Array(TABLE); 12 | } 13 | 14 | module.exports = create('crc-16-modbus', function(buf, previous) { 15 | var byte, crc, _i, _len; 16 | if (!Buffer.isBuffer(buf)) { 17 | buf = Buffer(buf); 18 | } 19 | crc = previous != null ? ~~previous : 0xffff; 20 | for (_i = 0, _len = buf.length; _i < _len; _i++) { 21 | byte = buf[_i]; 22 | crc = (TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8)) & 0xffff; 23 | } 24 | return crc; 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/crc24.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | var Buffer, TABLE, create; 3 | 4 | Buffer = require('buffer').Buffer; 5 | 6 | create = require('./create'); 7 | 8 | TABLE = [0x000000, 0x864cfb, 0x8ad50d, 0x0c99f6, 0x93e6e1, 0x15aa1a, 0x1933ec, 0x9f7f17, 0xa18139, 0x27cdc2, 0x2b5434, 0xad18cf, 0x3267d8, 0xb42b23, 0xb8b2d5, 0x3efe2e, 0xc54e89, 0x430272, 0x4f9b84, 0xc9d77f, 0x56a868, 0xd0e493, 0xdc7d65, 0x5a319e, 0x64cfb0, 0xe2834b, 0xee1abd, 0x685646, 0xf72951, 0x7165aa, 0x7dfc5c, 0xfbb0a7, 0x0cd1e9, 0x8a9d12, 0x8604e4, 0x00481f, 0x9f3708, 0x197bf3, 0x15e205, 0x93aefe, 0xad50d0, 0x2b1c2b, 0x2785dd, 0xa1c926, 0x3eb631, 0xb8faca, 0xb4633c, 0x322fc7, 0xc99f60, 0x4fd39b, 0x434a6d, 0xc50696, 0x5a7981, 0xdc357a, 0xd0ac8c, 0x56e077, 0x681e59, 0xee52a2, 0xe2cb54, 0x6487af, 0xfbf8b8, 0x7db443, 0x712db5, 0xf7614e, 0x19a3d2, 0x9fef29, 0x9376df, 0x153a24, 0x8a4533, 0x0c09c8, 0x00903e, 0x86dcc5, 0xb822eb, 0x3e6e10, 0x32f7e6, 0xb4bb1d, 0x2bc40a, 0xad88f1, 0xa11107, 0x275dfc, 0xdced5b, 0x5aa1a0, 0x563856, 0xd074ad, 0x4f0bba, 0xc94741, 0xc5deb7, 0x43924c, 0x7d6c62, 0xfb2099, 0xf7b96f, 0x71f594, 0xee8a83, 0x68c678, 0x645f8e, 0xe21375, 0x15723b, 0x933ec0, 0x9fa736, 0x19ebcd, 0x8694da, 0x00d821, 0x0c41d7, 0x8a0d2c, 0xb4f302, 0x32bff9, 0x3e260f, 0xb86af4, 0x2715e3, 0xa15918, 0xadc0ee, 0x2b8c15, 0xd03cb2, 0x567049, 0x5ae9bf, 0xdca544, 0x43da53, 0xc596a8, 0xc90f5e, 0x4f43a5, 0x71bd8b, 0xf7f170, 0xfb6886, 0x7d247d, 0xe25b6a, 0x641791, 0x688e67, 0xeec29c, 0x3347a4, 0xb50b5f, 0xb992a9, 0x3fde52, 0xa0a145, 0x26edbe, 0x2a7448, 0xac38b3, 0x92c69d, 0x148a66, 0x181390, 0x9e5f6b, 0x01207c, 0x876c87, 0x8bf571, 0x0db98a, 0xf6092d, 0x7045d6, 0x7cdc20, 0xfa90db, 0x65efcc, 0xe3a337, 0xef3ac1, 0x69763a, 0x578814, 0xd1c4ef, 0xdd5d19, 0x5b11e2, 0xc46ef5, 0x42220e, 0x4ebbf8, 0xc8f703, 0x3f964d, 0xb9dab6, 0xb54340, 0x330fbb, 0xac70ac, 0x2a3c57, 0x26a5a1, 0xa0e95a, 0x9e1774, 0x185b8f, 0x14c279, 0x928e82, 0x0df195, 0x8bbd6e, 0x872498, 0x016863, 0xfad8c4, 0x7c943f, 0x700dc9, 0xf64132, 0x693e25, 0xef72de, 0xe3eb28, 0x65a7d3, 0x5b59fd, 0xdd1506, 0xd18cf0, 0x57c00b, 0xc8bf1c, 0x4ef3e7, 0x426a11, 0xc426ea, 0x2ae476, 0xaca88d, 0xa0317b, 0x267d80, 0xb90297, 0x3f4e6c, 0x33d79a, 0xb59b61, 0x8b654f, 0x0d29b4, 0x01b042, 0x87fcb9, 0x1883ae, 0x9ecf55, 0x9256a3, 0x141a58, 0xefaaff, 0x69e604, 0x657ff2, 0xe33309, 0x7c4c1e, 0xfa00e5, 0xf69913, 0x70d5e8, 0x4e2bc6, 0xc8673d, 0xc4fecb, 0x42b230, 0xddcd27, 0x5b81dc, 0x57182a, 0xd154d1, 0x26359f, 0xa07964, 0xace092, 0x2aac69, 0xb5d37e, 0x339f85, 0x3f0673, 0xb94a88, 0x87b4a6, 0x01f85d, 0x0d61ab, 0x8b2d50, 0x145247, 0x921ebc, 0x9e874a, 0x18cbb1, 0xe37b16, 0x6537ed, 0x69ae1b, 0xefe2e0, 0x709df7, 0xf6d10c, 0xfa48fa, 0x7c0401, 0x42fa2f, 0xc4b6d4, 0xc82f22, 0x4e63d9, 0xd11cce, 0x575035, 0x5bc9c3, 0xdd8538]; 9 | 10 | if (typeof Int32Array !== 'undefined') { 11 | TABLE = new Int32Array(TABLE); 12 | } 13 | 14 | module.exports = create('crc-24', function(buf, previous) { 15 | var byte, crc, _i, _len; 16 | if (!Buffer.isBuffer(buf)) { 17 | buf = Buffer(buf); 18 | } 19 | crc = previous != null ? ~~previous : 0xb704ce; 20 | for (_i = 0, _len = buf.length; _i < _len; _i++) { 21 | byte = buf[_i]; 22 | crc = (TABLE[((crc >> 16) ^ byte) & 0xff] ^ (crc << 8)) & 0xffffff; 23 | } 24 | return crc; 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/crc8.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | var Buffer, TABLE, create; 3 | 4 | Buffer = require('buffer').Buffer; 5 | 6 | create = require('./create'); 7 | 8 | TABLE = [0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2, 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea, 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2, 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a, 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32, 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a, 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42, 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a, 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c, 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4, 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec, 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4, 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c, 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44, 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c, 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34, 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b, 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63, 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b, 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13, 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83, 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3]; 9 | 10 | if (typeof Int32Array !== 'undefined') { 11 | TABLE = new Int32Array(TABLE); 12 | } 13 | 14 | module.exports = create('crc-8', function(buf, previous) { 15 | var byte, crc, _i, _len; 16 | if (!Buffer.isBuffer(buf)) { 17 | buf = Buffer(buf); 18 | } 19 | crc = ~~previous; 20 | for (_i = 0, _len = buf.length; _i < _len; _i++) { 21 | byte = buf[_i]; 22 | crc = TABLE[(crc ^ byte) & 0xff] & 0xff; 23 | } 24 | return crc; 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/crc8_1wire.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | var Buffer, TABLE, create; 3 | 4 | Buffer = require('buffer').Buffer; 5 | 6 | create = require('./create'); 7 | 8 | TABLE = [0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83, 0xc2, 0x9c, 0x7e, 0x20, 0xa3, 0xfd, 0x1f, 0x41, 0x9d, 0xc3, 0x21, 0x7f, 0xfc, 0xa2, 0x40, 0x1e, 0x5f, 0x01, 0xe3, 0xbd, 0x3e, 0x60, 0x82, 0xdc, 0x23, 0x7d, 0x9f, 0xc1, 0x42, 0x1c, 0xfe, 0xa0, 0xe1, 0xbf, 0x5d, 0x03, 0x80, 0xde, 0x3c, 0x62, 0xbe, 0xe0, 0x02, 0x5c, 0xdf, 0x81, 0x63, 0x3d, 0x7c, 0x22, 0xc0, 0x9e, 0x1d, 0x43, 0xa1, 0xff, 0x46, 0x18, 0xfa, 0xa4, 0x27, 0x79, 0x9b, 0xc5, 0x84, 0xda, 0x38, 0x66, 0xe5, 0xbb, 0x59, 0x07, 0xdb, 0x85, 0x67, 0x39, 0xba, 0xe4, 0x06, 0x58, 0x19, 0x47, 0xa5, 0xfb, 0x78, 0x26, 0xc4, 0x9a, 0x65, 0x3b, 0xd9, 0x87, 0x04, 0x5a, 0xb8, 0xe6, 0xa7, 0xf9, 0x1b, 0x45, 0xc6, 0x98, 0x7a, 0x24, 0xf8, 0xa6, 0x44, 0x1a, 0x99, 0xc7, 0x25, 0x7b, 0x3a, 0x64, 0x86, 0xd8, 0x5b, 0x05, 0xe7, 0xb9, 0x8c, 0xd2, 0x30, 0x6e, 0xed, 0xb3, 0x51, 0x0f, 0x4e, 0x10, 0xf2, 0xac, 0x2f, 0x71, 0x93, 0xcd, 0x11, 0x4f, 0xad, 0xf3, 0x70, 0x2e, 0xcc, 0x92, 0xd3, 0x8d, 0x6f, 0x31, 0xb2, 0xec, 0x0e, 0x50, 0xaf, 0xf1, 0x13, 0x4d, 0xce, 0x90, 0x72, 0x2c, 0x6d, 0x33, 0xd1, 0x8f, 0x0c, 0x52, 0xb0, 0xee, 0x32, 0x6c, 0x8e, 0xd0, 0x53, 0x0d, 0xef, 0xb1, 0xf0, 0xae, 0x4c, 0x12, 0x91, 0xcf, 0x2d, 0x73, 0xca, 0x94, 0x76, 0x28, 0xab, 0xf5, 0x17, 0x49, 0x08, 0x56, 0xb4, 0xea, 0x69, 0x37, 0xd5, 0x8b, 0x57, 0x09, 0xeb, 0xb5, 0x36, 0x68, 0x8a, 0xd4, 0x95, 0xcb, 0x29, 0x77, 0xf4, 0xaa, 0x48, 0x16, 0xe9, 0xb7, 0x55, 0x0b, 0x88, 0xd6, 0x34, 0x6a, 0x2b, 0x75, 0x97, 0xc9, 0x4a, 0x14, 0xf6, 0xa8, 0x74, 0x2a, 0xc8, 0x96, 0x15, 0x4b, 0xa9, 0xf7, 0xb6, 0xe8, 0x0a, 0x54, 0xd7, 0x89, 0x6b, 0x35]; 9 | 10 | if (typeof Int32Array !== 'undefined') { 11 | TABLE = new Int32Array(TABLE); 12 | } 13 | 14 | module.exports = create('dallas-1-wire', function(buf, previous) { 15 | var byte, crc, _i, _len; 16 | if (!Buffer.isBuffer(buf)) { 17 | buf = Buffer(buf); 18 | } 19 | crc = ~~previous; 20 | for (_i = 0, _len = buf.length; _i < _len; _i++) { 21 | byte = buf[_i]; 22 | crc = TABLE[(crc ^ byte) & 0xff] & 0xff; 23 | } 24 | return crc; 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/create.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | module.exports = function(model, calc) { 3 | var fn; 4 | fn = function(buf, previous) { 5 | return calc(buf, previous) >>> 0; 6 | }; 7 | fn.signed = calc; 8 | fn.unsigned = fn; 9 | fn.model = model; 10 | return fn; 11 | }; 12 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/hex.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | module.exports = function(number) { 3 | var result; 4 | result = number.toString(16); 5 | while (result.length % 2) { 6 | result = "0" + result; 7 | } 8 | return result; 9 | }; 10 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/lib/index.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.7.1 2 | module.exports = { 3 | crc1: require('./crc1'), 4 | crc8: require('./crc8'), 5 | crc81wire: require('./crc8_1wire'), 6 | crc16: require('./crc16'), 7 | crc16ccitt: require('./crc16_ccitt'), 8 | crc16modbus: require('./crc16_modbus'), 9 | crc24: require('./crc24'), 10 | crc32: require('./crc32') 11 | }; 12 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/node_modules/crc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "crc", 3 | "version": "3.2.1", 4 | "description": "Various CRC JavaScript implementations", 5 | "keywords": [ 6 | "crc" 7 | ], 8 | "main": "./lib/index.js", 9 | "scripts": { 10 | "test": "mocha test/*.spec.coffee", 11 | "pretest": "coffee --bare --output ./lib --compile ./src/*.coffee" 12 | }, 13 | "author": { 14 | "name": "Alex Gorbatchev", 15 | "url": "https://github.com/alexgorbatchev" 16 | }, 17 | "devDependencies": { 18 | "beautify-benchmark": "^0.2.4", 19 | "benchmark": "^1.0.0", 20 | "buffer-crc32": "^0.2.3", 21 | "chai": "~1.9.1", 22 | "coffee-errors": "~0.8.6", 23 | "coffee-script": "~1.7.1", 24 | "mocha": "*", 25 | "seedrandom": "^2.3.6" 26 | }, 27 | "homepage": "https://github.com/alexgorbatchev/node-crc", 28 | "bugs": { 29 | "url": "https://github.com/alexgorbatchev/node-crc/issues" 30 | }, 31 | "repository": { 32 | "type": "git", 33 | "url": "git://github.com/alexgorbatchev/node-crc.git" 34 | }, 35 | "license": "MIT", 36 | "gitHead": "71caf362b061992bfe4ca8706ee264e764d2e88e", 37 | "_id": "crc@3.2.1", 38 | "_shasum": "5d9c8fb77a245cd5eca291e5d2d005334bab0082", 39 | "_from": "crc@3.2.1", 40 | "_npmVersion": "1.4.13", 41 | "_npmUser": { 42 | "name": "alexgorbatchev", 43 | "email": "alex.gorbatchev@gmail.com" 44 | }, 45 | "maintainers": [ 46 | { 47 | "name": "alexgorbatchev", 48 | "email": "alex.gorbatchev@gmail.com" 49 | } 50 | ], 51 | "dist": { 52 | "shasum": "5d9c8fb77a245cd5eca291e5d2d005334bab0082", 53 | "tarball": "http://registry.npmjs.org/crc/-/crc-3.2.1.tgz" 54 | }, 55 | "directories": {}, 56 | "_resolved": "https://registry.npmjs.org/crc/-/crc-3.2.1.tgz" 57 | } 58 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/etag/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "etag", 3 | "description": "Create simple ETags", 4 | "version": "1.6.0", 5 | "contributors": [ 6 | { 7 | "name": "Douglas Christopher Wilson", 8 | "email": "doug@somethingdoug.com" 9 | }, 10 | { 11 | "name": "David Björklund", 12 | "email": "david.bjorklund@gmail.com" 13 | } 14 | ], 15 | "license": "MIT", 16 | "keywords": [ 17 | "etag", 18 | "http", 19 | "res" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "https://github.com/jshttp/etag" 24 | }, 25 | "dependencies": { 26 | "crc": "3.2.1" 27 | }, 28 | "devDependencies": { 29 | "benchmark": "1.0.0", 30 | "beautify-benchmark": "0.2.4", 31 | "istanbul": "0.3.9", 32 | "mocha": "~1.21.4", 33 | "seedrandom": "2.3.11" 34 | }, 35 | "files": [ 36 | "LICENSE", 37 | "HISTORY.md", 38 | "README.md", 39 | "index.js" 40 | ], 41 | "engines": { 42 | "node": ">= 0.6" 43 | }, 44 | "scripts": { 45 | "bench": "node benchmark/index.js", 46 | "test": "mocha --reporter spec --bail --check-leaks test/", 47 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 48 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 49 | }, 50 | "gitHead": "76a8f5250b02e85bc1c9b1b049d83b853a87df44", 51 | "bugs": { 52 | "url": "https://github.com/jshttp/etag/issues" 53 | }, 54 | "homepage": "https://github.com/jshttp/etag", 55 | "_id": "etag@1.6.0", 56 | "_shasum": "8bcb2c6af1254c481dfc8b997c906ef4e442c207", 57 | "_from": "etag@>=1.6.0 <1.7.0", 58 | "_npmVersion": "1.4.28", 59 | "_npmUser": { 60 | "name": "dougwilson", 61 | "email": "doug@somethingdoug.com" 62 | }, 63 | "maintainers": [ 64 | { 65 | "name": "dougwilson", 66 | "email": "doug@somethingdoug.com" 67 | } 68 | ], 69 | "dist": { 70 | "shasum": "8bcb2c6af1254c481dfc8b997c906ef4e442c207", 71 | "tarball": "http://registry.npmjs.org/etag/-/etag-1.6.0.tgz" 72 | }, 73 | "directories": {}, 74 | "_resolved": "https://registry.npmjs.org/etag/-/etag-1.6.0.tgz" 75 | } 76 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/fresh/HISTORY.md: -------------------------------------------------------------------------------- 1 | 0.2.4 / 2014-09-07 2 | ================== 3 | 4 | * Support Node.js 0.6 5 | 6 | 0.2.3 / 2014-09-07 7 | ================== 8 | 9 | * Move repository to jshttp 10 | 11 | 0.2.2 / 2014-02-19 12 | ================== 13 | 14 | * Revert "Fix for blank page on Safari reload" 15 | 16 | 0.2.1 / 2014-01-29 17 | ================== 18 | 19 | * fix: support max-age=0 for end-to-end revalidation 20 | 21 | 0.2.0 / 2013-08-11 22 | ================== 23 | 24 | * fix: return false for no-cache 25 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/fresh/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/fresh/README.md: -------------------------------------------------------------------------------- 1 | # fresh 2 | 3 | [![NPM Version][npm-image]][npm-url] 4 | [![NPM Downloads][downloads-image]][downloads-url] 5 | [![Node.js Version][node-version-image]][node-version-url] 6 | [![Build Status][travis-image]][travis-url] 7 | [![Test Coverage][coveralls-image]][coveralls-url] 8 | 9 | HTTP response freshness testing 10 | 11 | ## Installation 12 | 13 | ``` 14 | $ npm install fresh 15 | ``` 16 | 17 | ## API 18 | 19 | ```js 20 | var fresh = require('fresh') 21 | ``` 22 | 23 | ### fresh(req, res) 24 | 25 | Check freshness of `req` and `res` headers. 26 | 27 | When the cache is "fresh" __true__ is returned, 28 | otherwise __false__ is returned to indicate that 29 | the cache is now stale. 30 | 31 | ## Example 32 | 33 | ```js 34 | var req = { 'if-none-match': 'tobi' }; 35 | var res = { 'etag': 'luna' }; 36 | fresh(req, res); 37 | // => false 38 | 39 | var req = { 'if-none-match': 'tobi' }; 40 | var res = { 'etag': 'tobi' }; 41 | fresh(req, res); 42 | // => true 43 | ``` 44 | 45 | ## License 46 | 47 | [MIT](LICENSE) 48 | 49 | [npm-image]: https://img.shields.io/npm/v/fresh.svg?style=flat 50 | [npm-url]: https://npmjs.org/package/fresh 51 | [node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat 52 | [node-version-url]: http://nodejs.org/download/ 53 | [travis-image]: https://img.shields.io/travis/jshttp/fresh.svg?style=flat 54 | [travis-url]: https://travis-ci.org/jshttp/fresh 55 | [coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh.svg?style=flat 56 | [coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master 57 | [downloads-image]: https://img.shields.io/npm/dm/fresh.svg?style=flat 58 | [downloads-url]: https://npmjs.org/package/fresh 59 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/fresh/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Expose `fresh()`. 4 | */ 5 | 6 | module.exports = fresh; 7 | 8 | /** 9 | * Check freshness of `req` and `res` headers. 10 | * 11 | * When the cache is "fresh" __true__ is returned, 12 | * otherwise __false__ is returned to indicate that 13 | * the cache is now stale. 14 | * 15 | * @param {Object} req 16 | * @param {Object} res 17 | * @return {Boolean} 18 | * @api public 19 | */ 20 | 21 | function fresh(req, res) { 22 | // defaults 23 | var etagMatches = true; 24 | var notModified = true; 25 | 26 | // fields 27 | var modifiedSince = req['if-modified-since']; 28 | var noneMatch = req['if-none-match']; 29 | var lastModified = res['last-modified']; 30 | var etag = res['etag']; 31 | var cc = req['cache-control']; 32 | 33 | // unconditional request 34 | if (!modifiedSince && !noneMatch) return false; 35 | 36 | // check for no-cache cache request directive 37 | if (cc && cc.indexOf('no-cache') !== -1) return false; 38 | 39 | // parse if-none-match 40 | if (noneMatch) noneMatch = noneMatch.split(/ *, */); 41 | 42 | // if-none-match 43 | if (noneMatch) etagMatches = ~noneMatch.indexOf(etag) || '*' == noneMatch[0]; 44 | 45 | // if-modified-since 46 | if (modifiedSince) { 47 | modifiedSince = new Date(modifiedSince); 48 | lastModified = new Date(lastModified); 49 | notModified = lastModified <= modifiedSince; 50 | } 51 | 52 | return !! (etagMatches && notModified); 53 | } -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/fresh/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fresh", 3 | "description": "HTTP response freshness testing", 4 | "version": "0.2.4", 5 | "author": { 6 | "name": "TJ Holowaychuk", 7 | "email": "tj@vision-media.ca", 8 | "url": "http://tjholowaychuk.com" 9 | }, 10 | "license": "MIT", 11 | "keywords": [ 12 | "fresh", 13 | "http", 14 | "conditional", 15 | "cache" 16 | ], 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/jshttp/fresh" 20 | }, 21 | "devDependencies": { 22 | "istanbul": "0", 23 | "mocha": "1", 24 | "should": "3" 25 | }, 26 | "files": [ 27 | "HISTORY.md", 28 | "LICENSE", 29 | "index.js" 30 | ], 31 | "engines": { 32 | "node": ">= 0.6" 33 | }, 34 | "scripts": { 35 | "test": "mocha --reporter spec --require should", 36 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should", 37 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should" 38 | }, 39 | "gitHead": "8440a4ca75fb091dec06e88654b3b1c31d7e7164", 40 | "bugs": { 41 | "url": "https://github.com/jshttp/fresh/issues" 42 | }, 43 | "homepage": "https://github.com/jshttp/fresh", 44 | "_id": "fresh@0.2.4", 45 | "_shasum": "3582499206c9723714190edd74b4604feb4a614c", 46 | "_from": "fresh@0.2.4", 47 | "_npmVersion": "1.4.21", 48 | "_npmUser": { 49 | "name": "dougwilson", 50 | "email": "doug@somethingdoug.com" 51 | }, 52 | "maintainers": [ 53 | { 54 | "name": "tjholowaychuk", 55 | "email": "tj@vision-media.ca" 56 | }, 57 | { 58 | "name": "jonathanong", 59 | "email": "jonathanrichardong@gmail.com" 60 | }, 61 | { 62 | "name": "dougwilson", 63 | "email": "doug@somethingdoug.com" 64 | }, 65 | { 66 | "name": "jongleberry", 67 | "email": "jonathanrichardong@gmail.com" 68 | } 69 | ], 70 | "dist": { 71 | "shasum": "3582499206c9723714190edd74b4604feb4a614c", 72 | "tarball": "http://registry.npmjs.org/fresh/-/fresh-0.2.4.tgz" 73 | }, 74 | "directories": {}, 75 | "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.4.tgz" 76 | } 77 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/mime/.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OhJia/p5MobileWebExamples/777751b10ca506267fc8b20fcf5a9b9a8b0c3b7b/node_modules/serve-static/node_modules/send/node_modules/mime/.npmignore -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/mime/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Benjamin Thomas, Robert Kieffer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/mime/README.md: -------------------------------------------------------------------------------- 1 | # mime 2 | 3 | Comprehensive MIME type mapping API based on mime-db module. 4 | 5 | ## Install 6 | 7 | Install with [npm](http://github.com/isaacs/npm): 8 | 9 | npm install mime 10 | 11 | ## Contributing / Testing 12 | 13 | npm run test 14 | 15 | ## Command Line 16 | 17 | mime [path_string] 18 | 19 | E.g. 20 | 21 | > mime scripts/jquery.js 22 | application/javascript 23 | 24 | ## API - Queries 25 | 26 | ### mime.lookup(path) 27 | 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. 28 | 29 | ```js 30 | var mime = require('mime'); 31 | 32 | mime.lookup('/path/to/file.txt'); // => 'text/plain' 33 | mime.lookup('file.txt'); // => 'text/plain' 34 | mime.lookup('.TXT'); // => 'text/plain' 35 | mime.lookup('htm'); // => 'text/html' 36 | ``` 37 | 38 | ### mime.default_type 39 | Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) 40 | 41 | ### mime.extension(type) 42 | Get the default extension for `type` 43 | 44 | ```js 45 | mime.extension('text/html'); // => 'html' 46 | mime.extension('application/octet-stream'); // => 'bin' 47 | ``` 48 | 49 | ### mime.charsets.lookup() 50 | 51 | Map mime-type to charset 52 | 53 | ```js 54 | mime.charsets.lookup('text/plain'); // => 'UTF-8' 55 | ``` 56 | 57 | (The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) 58 | 59 | ## API - Defining Custom Types 60 | 61 | Custom type mappings can be added on a per-project basis via the following APIs. 62 | 63 | ### mime.define() 64 | 65 | Add custom mime/extension mappings 66 | 67 | ```js 68 | mime.define({ 69 | 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], 70 | 'application/x-my-type': ['x-mt', 'x-mtt'], 71 | // etc ... 72 | }); 73 | 74 | mime.lookup('x-sft'); // => 'text/x-some-format' 75 | ``` 76 | 77 | The first entry in the extensions array is returned by `mime.extension()`. E.g. 78 | 79 | ```js 80 | mime.extension('text/x-some-format'); // => 'x-sf' 81 | ``` 82 | 83 | ### mime.load(filepath) 84 | 85 | Load mappings from an Apache ".types" format file 86 | 87 | ```js 88 | mime.load('./my_project.types'); 89 | ``` 90 | The .types file format is simple - See the `types` dir for examples. 91 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/mime/build/build.js: -------------------------------------------------------------------------------- 1 | var db = require('mime-db'); 2 | 3 | var mapByType = {}; 4 | Object.keys(db).forEach(function(key) { 5 | var extensions = db[key].extensions; 6 | if (extensions) { 7 | mapByType[key] = extensions; 8 | } 9 | }); 10 | 11 | console.log(JSON.stringify(mapByType)); 12 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/mime/build/test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Usage: node test.js 3 | */ 4 | 5 | var mime = require('../mime'); 6 | var assert = require('assert'); 7 | var path = require('path'); 8 | 9 | // 10 | // Test mime lookups 11 | // 12 | 13 | assert.equal('text/plain', mime.lookup('text.txt')); // normal file 14 | assert.equal('text/plain', mime.lookup('TEXT.TXT')); // uppercase 15 | assert.equal('text/plain', mime.lookup('dir/text.txt')); // dir + file 16 | assert.equal('text/plain', mime.lookup('.text.txt')); // hidden file 17 | assert.equal('text/plain', mime.lookup('.txt')); // nameless 18 | assert.equal('text/plain', mime.lookup('txt')); // extension-only 19 | assert.equal('text/plain', mime.lookup('/txt')); // extension-less () 20 | assert.equal('text/plain', mime.lookup('\\txt')); // Windows, extension-less 21 | assert.equal('application/octet-stream', mime.lookup('text.nope')); // unrecognized 22 | assert.equal('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default 23 | 24 | // 25 | // Test extensions 26 | // 27 | 28 | assert.equal('txt', mime.extension(mime.types.text)); 29 | assert.equal('html', mime.extension(mime.types.htm)); 30 | assert.equal('bin', mime.extension('application/octet-stream')); 31 | assert.equal('bin', mime.extension('application/octet-stream ')); 32 | assert.equal('html', mime.extension(' text/html; charset=UTF-8')); 33 | assert.equal('html', mime.extension('text/html; charset=UTF-8 ')); 34 | assert.equal('html', mime.extension('text/html; charset=UTF-8')); 35 | assert.equal('html', mime.extension('text/html ; charset=UTF-8')); 36 | assert.equal('html', mime.extension('text/html;charset=UTF-8')); 37 | assert.equal('html', mime.extension('text/Html;charset=UTF-8')); 38 | assert.equal(undefined, mime.extension('unrecognized')); 39 | 40 | // 41 | // Test node.types lookups 42 | // 43 | 44 | assert.equal('application/font-woff', mime.lookup('file.woff')); 45 | assert.equal('application/octet-stream', mime.lookup('file.buffer')); 46 | assert.equal('audio/mp4', mime.lookup('file.m4a')); 47 | assert.equal('font/opentype', mime.lookup('file.otf')); 48 | 49 | // 50 | // Test charsets 51 | // 52 | 53 | assert.equal('UTF-8', mime.charsets.lookup('text/plain')); 54 | assert.equal(undefined, mime.charsets.lookup(mime.types.js)); 55 | assert.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); 56 | 57 | console.log('\nAll tests passed'); 58 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/mime/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var mime = require('./mime.js'); 4 | var file = process.argv[2]; 5 | var type = mime.lookup(file); 6 | 7 | process.stdout.write(type + '\n'); 8 | 9 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/mime/mime.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | 4 | function Mime() { 5 | // Map of extension -> mime type 6 | this.types = Object.create(null); 7 | 8 | // Map of mime type -> extension 9 | this.extensions = Object.create(null); 10 | } 11 | 12 | /** 13 | * Define mimetype -> extension mappings. Each key is a mime-type that maps 14 | * to an array of extensions associated with the type. The first extension is 15 | * used as the default extension for the type. 16 | * 17 | * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); 18 | * 19 | * @param map (Object) type definitions 20 | */ 21 | Mime.prototype.define = function (map) { 22 | for (var type in map) { 23 | var exts = map[type]; 24 | for (var i = 0; i < exts.length; i++) { 25 | if (process.env.DEBUG_MIME && this.types[exts]) { 26 | console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + 27 | this.types[exts] + ' to ' + type); 28 | } 29 | 30 | this.types[exts[i]] = type; 31 | } 32 | 33 | // Default extension is the first one we encounter 34 | if (!this.extensions[type]) { 35 | this.extensions[type] = exts[0]; 36 | } 37 | } 38 | }; 39 | 40 | /** 41 | * Load an Apache2-style ".types" file 42 | * 43 | * This may be called multiple times (it's expected). Where files declare 44 | * overlapping types/extensions, the last file wins. 45 | * 46 | * @param file (String) path of file to load. 47 | */ 48 | Mime.prototype.load = function(file) { 49 | this._loading = file; 50 | // Read file and split into lines 51 | var map = {}, 52 | content = fs.readFileSync(file, 'ascii'), 53 | lines = content.split(/[\r\n]+/); 54 | 55 | lines.forEach(function(line) { 56 | // Clean up whitespace/comments, and split into fields 57 | var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); 58 | map[fields.shift()] = fields; 59 | }); 60 | 61 | this.define(map); 62 | 63 | this._loading = null; 64 | }; 65 | 66 | /** 67 | * Lookup a mime type based on extension 68 | */ 69 | Mime.prototype.lookup = function(path, fallback) { 70 | var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); 71 | 72 | return this.types[ext] || fallback || this.default_type; 73 | }; 74 | 75 | /** 76 | * Return file extension associated with a mime type 77 | */ 78 | Mime.prototype.extension = function(mimeType) { 79 | var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); 80 | return this.extensions[type]; 81 | }; 82 | 83 | // Default instance 84 | var mime = new Mime(); 85 | 86 | // Define built-in types 87 | mime.define(require('./types.json')); 88 | 89 | // Default type 90 | mime.default_type = mime.lookup('bin'); 91 | 92 | // 93 | // Additional API specific to the default instance 94 | // 95 | 96 | mime.Mime = Mime; 97 | 98 | /** 99 | * Lookup a charset based on mime type. 100 | */ 101 | mime.charsets = { 102 | lookup: function(mimeType, fallback) { 103 | // Assume text types are utf8 104 | return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; 105 | } 106 | }; 107 | 108 | module.exports = mime; 109 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/mime/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Robert Kieffer", 4 | "email": "robert@broofa.com", 5 | "url": "http://github.com/broofa" 6 | }, 7 | "scripts": { 8 | "prepublish": "node build/build.js > types.json", 9 | "test": "node build/test.js" 10 | }, 11 | "bin": { 12 | "mime": "cli.js" 13 | }, 14 | "contributors": [ 15 | { 16 | "name": "Benjamin Thomas", 17 | "email": "benjamin@benjaminthomas.org", 18 | "url": "http://github.com/bentomas" 19 | } 20 | ], 21 | "description": "A comprehensive library for mime-type mapping", 22 | "licenses": [ 23 | { 24 | "type": "MIT", 25 | "url": "https://raw.github.com/broofa/node-mime/master/LICENSE" 26 | } 27 | ], 28 | "dependencies": {}, 29 | "devDependencies": { 30 | "mime-db": "^1.2.0" 31 | }, 32 | "keywords": [ 33 | "util", 34 | "mime" 35 | ], 36 | "main": "mime.js", 37 | "name": "mime", 38 | "repository": { 39 | "url": "https://github.com/broofa/node-mime", 40 | "type": "git" 41 | }, 42 | "version": "1.3.4", 43 | "gitHead": "1628f6e0187095009dcef4805c3a49706f137974", 44 | "bugs": { 45 | "url": "https://github.com/broofa/node-mime/issues" 46 | }, 47 | "homepage": "https://github.com/broofa/node-mime", 48 | "_id": "mime@1.3.4", 49 | "_shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53", 50 | "_from": "mime@1.3.4", 51 | "_npmVersion": "1.4.28", 52 | "_npmUser": { 53 | "name": "broofa", 54 | "email": "robert@broofa.com" 55 | }, 56 | "maintainers": [ 57 | { 58 | "name": "broofa", 59 | "email": "robert@broofa.com" 60 | }, 61 | { 62 | "name": "bentomas", 63 | "email": "benjamin@benjaminthomas.org" 64 | } 65 | ], 66 | "dist": { 67 | "shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53", 68 | "tarball": "http://registry.npmjs.org/mime/-/mime-1.3.4.tgz" 69 | }, 70 | "directories": {}, 71 | "_resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", 72 | "readme": "ERROR: No README data found!" 73 | } 74 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/ms/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | History.md 4 | Makefile 5 | component.json 6 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/ms/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.7.1 / 2015-04-20 3 | ================== 4 | 5 | * prevent extraordinary long inputs (@evilpacket) 6 | * Fixed broken readme link 7 | 8 | 0.7.0 / 2014-11-24 9 | ================== 10 | 11 | * add time abbreviations, updated tests and readme for the new units 12 | * fix example in the readme. 13 | * add LICENSE file 14 | 15 | 0.6.2 / 2013-12-05 16 | ================== 17 | 18 | * Adding repository section to package.json to suppress warning from NPM. 19 | 20 | 0.6.1 / 2013-05-10 21 | ================== 22 | 23 | * fix singularization [visionmedia] 24 | 25 | 0.6.0 / 2013-03-15 26 | ================== 27 | 28 | * fix minutes 29 | 30 | 0.5.1 / 2013-02-24 31 | ================== 32 | 33 | * add component namespace 34 | 35 | 0.5.0 / 2012-11-09 36 | ================== 37 | 38 | * add short formatting as default and .long option 39 | * add .license property to component.json 40 | * add version to component.json 41 | 42 | 0.4.0 / 2012-10-22 43 | ================== 44 | 45 | * add rounding to fix crazy decimals 46 | 47 | 0.3.0 / 2012-09-07 48 | ================== 49 | 50 | * fix `ms()` [visionmedia] 51 | 52 | 0.2.0 / 2012-09-03 53 | ================== 54 | 55 | * add component.json [visionmedia] 56 | * add days support [visionmedia] 57 | * add hours support [visionmedia] 58 | * add minutes support [visionmedia] 59 | * add seconds support [visionmedia] 60 | * add ms string support [visionmedia] 61 | * refactor tests to facilitate ms(number) [visionmedia] 62 | 63 | 0.1.0 / 2012-03-07 64 | ================== 65 | 66 | * Initial release 67 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/ms/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Guillermo Rauch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/ms/README.md: -------------------------------------------------------------------------------- 1 | # ms.js: miliseconds conversion utility 2 | 3 | ```js 4 | ms('2 days') // 172800000 5 | ms('1d') // 86400000 6 | ms('10h') // 36000000 7 | ms('2.5 hrs') // 9000000 8 | ms('2h') // 7200000 9 | ms('1m') // 60000 10 | ms('5s') // 5000 11 | ms('100') // 100 12 | ``` 13 | 14 | ```js 15 | ms(60000) // "1m" 16 | ms(2 * 60000) // "2m" 17 | ms(ms('10 hours')) // "10h" 18 | ``` 19 | 20 | ```js 21 | ms(60000, { long: true }) // "1 minute" 22 | ms(2 * 60000, { long: true }) // "2 minutes" 23 | ms(ms('10 hours'), { long: true }) // "10 hours" 24 | ``` 25 | 26 | - Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). 27 | - If a number is supplied to `ms`, a string with a unit is returned. 28 | - If a string that contains the number is supplied, it returns it as 29 | a number (e.g: it returns `100` for `'100'`). 30 | - If you pass a string with a number and a valid unit, the number of 31 | equivalent ms is returned. 32 | 33 | ## License 34 | 35 | MIT 36 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/ms/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Helpers. 3 | */ 4 | 5 | var s = 1000; 6 | var m = s * 60; 7 | var h = m * 60; 8 | var d = h * 24; 9 | var y = d * 365.25; 10 | 11 | /** 12 | * Parse or format the given `val`. 13 | * 14 | * Options: 15 | * 16 | * - `long` verbose formatting [false] 17 | * 18 | * @param {String|Number} val 19 | * @param {Object} options 20 | * @return {String|Number} 21 | * @api public 22 | */ 23 | 24 | module.exports = function(val, options){ 25 | options = options || {}; 26 | if ('string' == typeof val) return parse(val); 27 | return options.long 28 | ? long(val) 29 | : short(val); 30 | }; 31 | 32 | /** 33 | * Parse the given `str` and return milliseconds. 34 | * 35 | * @param {String} str 36 | * @return {Number} 37 | * @api private 38 | */ 39 | 40 | function parse(str) { 41 | str = '' + str; 42 | if (str.length > 10000) return; 43 | var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); 44 | if (!match) return; 45 | var n = parseFloat(match[1]); 46 | var type = (match[2] || 'ms').toLowerCase(); 47 | switch (type) { 48 | case 'years': 49 | case 'year': 50 | case 'yrs': 51 | case 'yr': 52 | case 'y': 53 | return n * y; 54 | case 'days': 55 | case 'day': 56 | case 'd': 57 | return n * d; 58 | case 'hours': 59 | case 'hour': 60 | case 'hrs': 61 | case 'hr': 62 | case 'h': 63 | return n * h; 64 | case 'minutes': 65 | case 'minute': 66 | case 'mins': 67 | case 'min': 68 | case 'm': 69 | return n * m; 70 | case 'seconds': 71 | case 'second': 72 | case 'secs': 73 | case 'sec': 74 | case 's': 75 | return n * s; 76 | case 'milliseconds': 77 | case 'millisecond': 78 | case 'msecs': 79 | case 'msec': 80 | case 'ms': 81 | return n; 82 | } 83 | } 84 | 85 | /** 86 | * Short format for `ms`. 87 | * 88 | * @param {Number} ms 89 | * @return {String} 90 | * @api private 91 | */ 92 | 93 | function short(ms) { 94 | if (ms >= d) return Math.round(ms / d) + 'd'; 95 | if (ms >= h) return Math.round(ms / h) + 'h'; 96 | if (ms >= m) return Math.round(ms / m) + 'm'; 97 | if (ms >= s) return Math.round(ms / s) + 's'; 98 | return ms + 'ms'; 99 | } 100 | 101 | /** 102 | * Long format for `ms`. 103 | * 104 | * @param {Number} ms 105 | * @return {String} 106 | * @api private 107 | */ 108 | 109 | function long(ms) { 110 | return plural(ms, d, 'day') 111 | || plural(ms, h, 'hour') 112 | || plural(ms, m, 'minute') 113 | || plural(ms, s, 'second') 114 | || ms + ' ms'; 115 | } 116 | 117 | /** 118 | * Pluralization helper. 119 | */ 120 | 121 | function plural(ms, n, name) { 122 | if (ms < n) return; 123 | if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; 124 | return Math.ceil(ms / n) + ' ' + name + 's'; 125 | } 126 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/ms/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ms", 3 | "version": "0.7.1", 4 | "description": "Tiny ms conversion utility", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/guille/ms.js.git" 8 | }, 9 | "main": "./index", 10 | "devDependencies": { 11 | "mocha": "*", 12 | "expect.js": "*", 13 | "serve": "*" 14 | }, 15 | "component": { 16 | "scripts": { 17 | "ms/index.js": "index.js" 18 | } 19 | }, 20 | "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", 21 | "bugs": { 22 | "url": "https://github.com/guille/ms.js/issues" 23 | }, 24 | "homepage": "https://github.com/guille/ms.js", 25 | "_id": "ms@0.7.1", 26 | "scripts": {}, 27 | "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", 28 | "_from": "ms@0.7.1", 29 | "_npmVersion": "2.7.5", 30 | "_nodeVersion": "0.12.2", 31 | "_npmUser": { 32 | "name": "rauchg", 33 | "email": "rauchg@gmail.com" 34 | }, 35 | "maintainers": [ 36 | { 37 | "name": "rauchg", 38 | "email": "rauchg@gmail.com" 39 | } 40 | ], 41 | "dist": { 42 | "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", 43 | "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" 44 | }, 45 | "directories": {}, 46 | "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" 47 | } 48 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/on-finished/HISTORY.md: -------------------------------------------------------------------------------- 1 | 2.2.1 / 2015-04-22 2 | ================== 3 | 4 | * Fix `isFinished(req)` when data buffered 5 | 6 | 2.2.0 / 2014-12-22 7 | ================== 8 | 9 | * Add message object to callback arguments 10 | 11 | 2.1.1 / 2014-10-22 12 | ================== 13 | 14 | * Fix handling of pipelined requests 15 | 16 | 2.1.0 / 2014-08-16 17 | ================== 18 | 19 | * Check if `socket` is detached 20 | * Return `undefined` for `isFinished` if state unknown 21 | 22 | 2.0.0 / 2014-08-16 23 | ================== 24 | 25 | * Add `isFinished` function 26 | * Move to `jshttp` organization 27 | * Remove support for plain socket argument 28 | * Rename to `on-finished` 29 | * Support both `req` and `res` as arguments 30 | * deps: ee-first@1.0.5 31 | 32 | 1.2.2 / 2014-06-10 33 | ================== 34 | 35 | * Reduce listeners added to emitters 36 | - avoids "event emitter leak" warnings when used multiple times on same request 37 | 38 | 1.2.1 / 2014-06-08 39 | ================== 40 | 41 | * Fix returned value when already finished 42 | 43 | 1.2.0 / 2014-06-05 44 | ================== 45 | 46 | * Call callback when called on already-finished socket 47 | 48 | 1.1.4 / 2014-05-27 49 | ================== 50 | 51 | * Support node.js 0.8 52 | 53 | 1.1.3 / 2014-04-30 54 | ================== 55 | 56 | * Make sure errors passed as instanceof `Error` 57 | 58 | 1.1.2 / 2014-04-18 59 | ================== 60 | 61 | * Default the `socket` to passed-in object 62 | 63 | 1.1.1 / 2014-01-16 64 | ================== 65 | 66 | * Rename module to `finished` 67 | 68 | 1.1.0 / 2013-12-25 69 | ================== 70 | 71 | * Call callback when called on already-errored socket 72 | 73 | 1.0.1 / 2013-12-20 74 | ================== 75 | 76 | * Actually pass the error to the callback 77 | 78 | 1.0.0 / 2013-12-20 79 | ================== 80 | 81 | * Initial release 82 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/on-finished/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2013 Jonathan Ong 4 | Copyright (c) 2014 Douglas Christopher Wilson 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | 'Software'), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/on-finished/node_modules/ee-first/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014 Jonathan Ong me@jongleberry.com 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/on-finished/node_modules/ee-first/README.md: -------------------------------------------------------------------------------- 1 | # EE First 2 | 3 | [![NPM version][npm-image]][npm-url] 4 | [![Build status][travis-image]][travis-url] 5 | [![Test coverage][coveralls-image]][coveralls-url] 6 | [![License][license-image]][license-url] 7 | [![Downloads][downloads-image]][downloads-url] 8 | [![Gittip][gittip-image]][gittip-url] 9 | 10 | Get the first event in a set of event emitters and event pairs, 11 | then clean up after itself. 12 | 13 | ## Install 14 | 15 | ```sh 16 | $ npm install ee-first 17 | ``` 18 | 19 | ## API 20 | 21 | ```js 22 | var first = require('ee-first') 23 | ``` 24 | 25 | ### first(arr, listener) 26 | 27 | Invoke `listener` on the first event from the list specified in `arr`. `arr` is 28 | an array of arrays, with each array in the format `[ee, ...event]`. `listener` 29 | will be called only once, the first time any of the given events are emitted. If 30 | `error` is one of the listened events, then if that fires first, the `listener` 31 | will be given the `err` argument. 32 | 33 | The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the 34 | first argument emitted from an `error` event, if applicable; `ee` is the event 35 | emitter that fired; `event` is the string event name that fired; and `args` is an 36 | array of the arguments that were emitted on the event. 37 | 38 | ```js 39 | var ee1 = new EventEmitter() 40 | var ee2 = new EventEmitter() 41 | 42 | first([ 43 | [ee1, 'close', 'end', 'error'], 44 | [ee2, 'error'] 45 | ], function (err, ee, event, args) { 46 | // listener invoked 47 | }) 48 | ``` 49 | 50 | #### .cancel() 51 | 52 | The group of listeners can be cancelled before being invoked and have all the event 53 | listeners removed from the underlying event emitters. 54 | 55 | ```js 56 | var thunk = first([ 57 | [ee1, 'close', 'end', 'error'], 58 | [ee2, 'error'] 59 | ], function (err, ee, event, args) { 60 | // listener invoked 61 | }) 62 | 63 | // cancel and clean up 64 | thunk.cancel() 65 | ``` 66 | 67 | [npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square 68 | [npm-url]: https://npmjs.org/package/ee-first 69 | [github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square 70 | [github-url]: https://github.com/jonathanong/ee-first/tags 71 | [travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square 72 | [travis-url]: https://travis-ci.org/jonathanong/ee-first 73 | [coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square 74 | [coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master 75 | [license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square 76 | [license-url]: LICENSE.md 77 | [downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square 78 | [downloads-url]: https://npmjs.org/package/ee-first 79 | [gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square 80 | [gittip-url]: https://www.gittip.com/jonathanong/ 81 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/on-finished/node_modules/ee-first/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function first(stuff, done) { 3 | if (!Array.isArray(stuff)) 4 | throw new TypeError('arg must be an array of [ee, events...] arrays') 5 | 6 | var cleanups = [] 7 | 8 | for (var i = 0; i < stuff.length; i++) { 9 | var arr = stuff[i] 10 | 11 | if (!Array.isArray(arr) || arr.length < 2) 12 | throw new TypeError('each array member must be [ee, events...]') 13 | 14 | var ee = arr[0] 15 | 16 | for (var j = 1; j < arr.length; j++) { 17 | var event = arr[j] 18 | var fn = listener(event, callback) 19 | 20 | // listen to the event 21 | ee.on(event, fn) 22 | // push this listener to the list of cleanups 23 | cleanups.push({ 24 | ee: ee, 25 | event: event, 26 | fn: fn, 27 | }) 28 | } 29 | } 30 | 31 | function callback() { 32 | cleanup() 33 | done.apply(null, arguments) 34 | } 35 | 36 | function cleanup() { 37 | var x 38 | for (var i = 0; i < cleanups.length; i++) { 39 | x = cleanups[i] 40 | x.ee.removeListener(x.event, x.fn) 41 | } 42 | } 43 | 44 | function thunk(fn) { 45 | done = fn 46 | } 47 | 48 | thunk.cancel = cleanup 49 | 50 | return thunk 51 | } 52 | 53 | function listener(event, done) { 54 | return function onevent(arg1) { 55 | var args = new Array(arguments.length) 56 | var ee = this 57 | var err = event === 'error' 58 | ? arg1 59 | : null 60 | 61 | // copy args to prevent arguments escaping scope 62 | for (var i = 0; i < args.length; i++) { 63 | args[i] = arguments[i] 64 | } 65 | 66 | done(err, ee, event, args) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/on-finished/node_modules/ee-first/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ee-first", 3 | "description": "return the first event in a set of ee/event pairs", 4 | "version": "1.1.0", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Douglas Christopher Wilson", 13 | "email": "doug@somethingdoug.com" 14 | } 15 | ], 16 | "license": "MIT", 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/jonathanong/ee-first" 20 | }, 21 | "devDependencies": { 22 | "istanbul": "0.3.2", 23 | "mocha": "1" 24 | }, 25 | "files": [ 26 | "index.js", 27 | "LICENSE" 28 | ], 29 | "scripts": { 30 | "test": "mocha --reporter spec --bail --check-leaks test/", 31 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 32 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 33 | }, 34 | "gitHead": "a6412004da4745941af2fc98ec30c8da570da7ea", 35 | "bugs": { 36 | "url": "https://github.com/jonathanong/ee-first/issues" 37 | }, 38 | "homepage": "https://github.com/jonathanong/ee-first", 39 | "_id": "ee-first@1.1.0", 40 | "_shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", 41 | "_from": "ee-first@1.1.0", 42 | "_npmVersion": "1.4.21", 43 | "_npmUser": { 44 | "name": "dougwilson", 45 | "email": "doug@somethingdoug.com" 46 | }, 47 | "maintainers": [ 48 | { 49 | "name": "jongleberry", 50 | "email": "jonathanrichardong@gmail.com" 51 | }, 52 | { 53 | "name": "dougwilson", 54 | "email": "doug@somethingdoug.com" 55 | } 56 | ], 57 | "dist": { 58 | "shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", 59 | "tarball": "http://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz" 60 | }, 61 | "directories": {}, 62 | "_resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz", 63 | "readme": "ERROR: No README data found!" 64 | } 65 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/on-finished/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "on-finished", 3 | "description": "Execute a callback when a request closes, finishes, or errors", 4 | "version": "2.2.1", 5 | "contributors": [ 6 | { 7 | "name": "Douglas Christopher Wilson", 8 | "email": "doug@somethingdoug.com" 9 | }, 10 | { 11 | "name": "Jonathan Ong", 12 | "email": "me@jongleberry.com", 13 | "url": "http://jongleberry.com" 14 | } 15 | ], 16 | "license": "MIT", 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/jshttp/on-finished" 20 | }, 21 | "dependencies": { 22 | "ee-first": "1.1.0" 23 | }, 24 | "devDependencies": { 25 | "istanbul": "0.3.9", 26 | "mocha": "~2.2.4" 27 | }, 28 | "engines": { 29 | "node": ">= 0.8" 30 | }, 31 | "files": [ 32 | "HISTORY.md", 33 | "LICENSE", 34 | "index.js" 35 | ], 36 | "scripts": { 37 | "test": "mocha --reporter spec --bail --check-leaks test/", 38 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 39 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 40 | }, 41 | "gitHead": "f3ecb92fb09d590d314ffe772a6ffd6f76c84223", 42 | "bugs": { 43 | "url": "https://github.com/jshttp/on-finished/issues" 44 | }, 45 | "homepage": "https://github.com/jshttp/on-finished", 46 | "_id": "on-finished@2.2.1", 47 | "_shasum": "5c85c1cc36299f78029653f667f27b6b99ebc029", 48 | "_from": "on-finished@>=2.2.0 <2.3.0", 49 | "_npmVersion": "1.4.28", 50 | "_npmUser": { 51 | "name": "dougwilson", 52 | "email": "doug@somethingdoug.com" 53 | }, 54 | "maintainers": [ 55 | { 56 | "name": "dougwilson", 57 | "email": "doug@somethingdoug.com" 58 | }, 59 | { 60 | "name": "jongleberry", 61 | "email": "jonathanrichardong@gmail.com" 62 | } 63 | ], 64 | "dist": { 65 | "shasum": "5c85c1cc36299f78029653f667f27b6b99ebc029", 66 | "tarball": "http://registry.npmjs.org/on-finished/-/on-finished-2.2.1.tgz" 67 | }, 68 | "directories": {}, 69 | "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.2.1.tgz", 70 | "readme": "ERROR: No README data found!" 71 | } 72 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/range-parser/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.2 / 2014-09-08 2 | ================== 3 | 4 | * Support Node.js 0.6 5 | 6 | 1.0.1 / 2014-09-07 7 | ================== 8 | 9 | * Move repository to jshttp 10 | 11 | 1.0.0 / 2013-12-11 12 | ================== 13 | 14 | * Add repository to package.json 15 | * Add MIT license 16 | 17 | 0.0.4 / 2012-06-17 18 | ================== 19 | 20 | * Change ret -1 for unsatisfiable and -2 when invalid 21 | 22 | 0.0.3 / 2012-06-17 23 | ================== 24 | 25 | * Fix last-byte-pos default to len - 1 26 | 27 | 0.0.2 / 2012-06-14 28 | ================== 29 | 30 | * Add `.type` 31 | 32 | 0.0.1 / 2012-06-11 33 | ================== 34 | 35 | * Initial release 36 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/range-parser/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012-2014 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/range-parser/README.md: -------------------------------------------------------------------------------- 1 | # range-parser 2 | 3 | [![NPM Version][npm-image]][npm-url] 4 | [![NPM Downloads][downloads-image]][downloads-url] 5 | [![Node.js Version][node-version-image]][node-version-url] 6 | [![Build Status][travis-image]][travis-url] 7 | [![Test Coverage][coveralls-image]][coveralls-url] 8 | 9 | Range header field parser. 10 | 11 | ## Installation 12 | 13 | ``` 14 | $ npm install range-parser 15 | ``` 16 | 17 | ## Examples 18 | 19 | ```js 20 | assert(-1 == parse(200, 'bytes=500-20')); 21 | assert(-2 == parse(200, 'bytes=malformed')); 22 | parse(200, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 199 }])); 23 | parse(1000, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 499 }])); 24 | parse(1000, 'bytes=40-80').should.eql(arr('bytes', [{ start: 40, end: 80 }])); 25 | parse(1000, 'bytes=-500').should.eql(arr('bytes', [{ start: 500, end: 999 }])); 26 | parse(1000, 'bytes=-400').should.eql(arr('bytes', [{ start: 600, end: 999 }])); 27 | parse(1000, 'bytes=500-').should.eql(arr('bytes', [{ start: 500, end: 999 }])); 28 | parse(1000, 'bytes=400-').should.eql(arr('bytes', [{ start: 400, end: 999 }])); 29 | parse(1000, 'bytes=0-0').should.eql(arr('bytes', [{ start: 0, end: 0 }])); 30 | parse(1000, 'bytes=-1').should.eql(arr('bytes', [{ start: 999, end: 999 }])); 31 | parse(1000, 'items=0-5').should.eql(arr('items', [{ start: 0, end: 5 }])); 32 | parse(1000, 'bytes=40-80,-1').should.eql(arr('bytes', [{ start: 40, end: 80 }, { start: 999, end: 999 }])); 33 | ``` 34 | 35 | ## License 36 | 37 | [MIT](LICENSE) 38 | 39 | [npm-image]: https://img.shields.io/npm/v/range-parser.svg?style=flat 40 | [npm-url]: https://npmjs.org/package/range-parser 41 | [node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat 42 | [node-version-url]: http://nodejs.org/download/ 43 | [travis-image]: https://img.shields.io/travis/jshttp/range-parser.svg?style=flat 44 | [travis-url]: https://travis-ci.org/jshttp/range-parser 45 | [coveralls-image]: https://img.shields.io/coveralls/jshttp/range-parser.svg?style=flat 46 | [coveralls-url]: https://coveralls.io/r/jshttp/range-parser 47 | [downloads-image]: https://img.shields.io/npm/dm/range-parser.svg?style=flat 48 | [downloads-url]: https://npmjs.org/package/range-parser 49 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/range-parser/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Parse "Range" header `str` relative to the given file `size`. 4 | * 5 | * @param {Number} size 6 | * @param {String} str 7 | * @return {Array} 8 | * @api public 9 | */ 10 | 11 | module.exports = function(size, str){ 12 | var valid = true; 13 | var i = str.indexOf('='); 14 | 15 | if (-1 == i) return -2; 16 | 17 | var arr = str.slice(i + 1).split(',').map(function(range){ 18 | var range = range.split('-') 19 | , start = parseInt(range[0], 10) 20 | , end = parseInt(range[1], 10); 21 | 22 | // -nnn 23 | if (isNaN(start)) { 24 | start = size - end; 25 | end = size - 1; 26 | // nnn- 27 | } else if (isNaN(end)) { 28 | end = size - 1; 29 | } 30 | 31 | // limit last-byte-pos to current length 32 | if (end > size - 1) end = size - 1; 33 | 34 | // invalid 35 | if (isNaN(start) 36 | || isNaN(end) 37 | || start > end 38 | || start < 0) valid = false; 39 | 40 | return { 41 | start: start, 42 | end: end 43 | }; 44 | }); 45 | 46 | arr.type = str.slice(0, i); 47 | 48 | return valid ? arr : -1; 49 | }; 50 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/node_modules/range-parser/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "range-parser", 3 | "author": { 4 | "name": "TJ Holowaychuk", 5 | "email": "tj@vision-media.ca", 6 | "url": "http://tjholowaychuk.com" 7 | }, 8 | "description": "Range header field string parser", 9 | "version": "1.0.2", 10 | "license": "MIT", 11 | "keywords": [ 12 | "range", 13 | "parser", 14 | "http" 15 | ], 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/jshttp/range-parser" 19 | }, 20 | "devDependencies": { 21 | "istanbul": "0", 22 | "mocha": "1", 23 | "should": "2" 24 | }, 25 | "files": [ 26 | "HISTORY.md", 27 | "LICENSE", 28 | "index.js" 29 | ], 30 | "engines": { 31 | "node": ">= 0.6" 32 | }, 33 | "scripts": { 34 | "test": "mocha --reporter spec --require should", 35 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should", 36 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should" 37 | }, 38 | "gitHead": "ae23b02ce705b56e7f7c48e832d41fa710227ecc", 39 | "bugs": { 40 | "url": "https://github.com/jshttp/range-parser/issues" 41 | }, 42 | "homepage": "https://github.com/jshttp/range-parser", 43 | "_id": "range-parser@1.0.2", 44 | "_shasum": "06a12a42e5131ba8e457cd892044867f2344e549", 45 | "_from": "range-parser@>=1.0.2 <1.1.0", 46 | "_npmVersion": "1.4.21", 47 | "_npmUser": { 48 | "name": "dougwilson", 49 | "email": "doug@somethingdoug.com" 50 | }, 51 | "maintainers": [ 52 | { 53 | "name": "tjholowaychuk", 54 | "email": "tj@vision-media.ca" 55 | }, 56 | { 57 | "name": "jonathanong", 58 | "email": "jonathanrichardong@gmail.com" 59 | }, 60 | { 61 | "name": "dougwilson", 62 | "email": "doug@somethingdoug.com" 63 | }, 64 | { 65 | "name": "jongleberry", 66 | "email": "jonathanrichardong@gmail.com" 67 | } 68 | ], 69 | "dist": { 70 | "shasum": "06a12a42e5131ba8e457cd892044867f2344e549", 71 | "tarball": "http://registry.npmjs.org/range-parser/-/range-parser-1.0.2.tgz" 72 | }, 73 | "directories": {}, 74 | "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.2.tgz", 75 | "readme": "ERROR: No README data found!" 76 | } 77 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/send/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "send", 3 | "description": "Better streaming static file server with Range and conditional-GET support", 4 | "version": "0.12.3", 5 | "author": { 6 | "name": "TJ Holowaychuk", 7 | "email": "tj@vision-media.ca" 8 | }, 9 | "contributors": [ 10 | { 11 | "name": "Douglas Christopher Wilson", 12 | "email": "doug@somethingdoug.com" 13 | } 14 | ], 15 | "license": "MIT", 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/pillarjs/send" 19 | }, 20 | "keywords": [ 21 | "static", 22 | "file", 23 | "server" 24 | ], 25 | "dependencies": { 26 | "debug": "~2.2.0", 27 | "depd": "~1.0.1", 28 | "destroy": "1.0.3", 29 | "escape-html": "1.0.1", 30 | "etag": "~1.6.0", 31 | "fresh": "0.2.4", 32 | "mime": "1.3.4", 33 | "ms": "0.7.1", 34 | "on-finished": "~2.2.1", 35 | "range-parser": "~1.0.2" 36 | }, 37 | "devDependencies": { 38 | "after": "0.8.1", 39 | "istanbul": "0.3.9", 40 | "mocha": "2.2.4", 41 | "supertest": "~0.15.0" 42 | }, 43 | "files": [ 44 | "HISTORY.md", 45 | "LICENSE", 46 | "README.md", 47 | "index.js" 48 | ], 49 | "engines": { 50 | "node": ">= 0.8.0" 51 | }, 52 | "scripts": { 53 | "test": "mocha --check-leaks --reporter spec --bail", 54 | "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec", 55 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot" 56 | }, 57 | "gitHead": "db460d914de7114d267a55e2a2d60f869c8ddd33", 58 | "bugs": { 59 | "url": "https://github.com/pillarjs/send/issues" 60 | }, 61 | "homepage": "https://github.com/pillarjs/send", 62 | "_id": "send@0.12.3", 63 | "_shasum": "cd12dc58fde21e4f91902b39b2fda05a7a6d9bdc", 64 | "_from": "send@0.12.3", 65 | "_npmVersion": "1.4.28", 66 | "_npmUser": { 67 | "name": "dougwilson", 68 | "email": "doug@somethingdoug.com" 69 | }, 70 | "maintainers": [ 71 | { 72 | "name": "tjholowaychuk", 73 | "email": "tj@vision-media.ca" 74 | }, 75 | { 76 | "name": "dougwilson", 77 | "email": "doug@somethingdoug.com" 78 | } 79 | ], 80 | "dist": { 81 | "shasum": "cd12dc58fde21e4f91902b39b2fda05a7a6d9bdc", 82 | "tarball": "http://registry.npmjs.org/send/-/send-0.12.3.tgz" 83 | }, 84 | "directories": {}, 85 | "_resolved": "https://registry.npmjs.org/send/-/send-0.12.3.tgz" 86 | } 87 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/utils-merge/.travis.yml: -------------------------------------------------------------------------------- 1 | language: "node_js" 2 | node_js: 3 | - "0.4" 4 | - "0.6" 5 | - "0.8" 6 | - "0.10" 7 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/utils-merge/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2013 Jared Hanson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/utils-merge/README.md: -------------------------------------------------------------------------------- 1 | # utils-merge 2 | 3 | Merges the properties from a source object into a destination object. 4 | 5 | ## Install 6 | 7 | $ npm install utils-merge 8 | 9 | ## Usage 10 | 11 | ```javascript 12 | var a = { foo: 'bar' } 13 | , b = { bar: 'baz' }; 14 | 15 | merge(a, b); 16 | // => { foo: 'bar', bar: 'baz' } 17 | ``` 18 | 19 | ## Tests 20 | 21 | $ npm install 22 | $ npm test 23 | 24 | [![Build Status](https://secure.travis-ci.org/jaredhanson/utils-merge.png)](http://travis-ci.org/jaredhanson/utils-merge) 25 | 26 | ## Credits 27 | 28 | - [Jared Hanson](http://github.com/jaredhanson) 29 | 30 | ## License 31 | 32 | [The MIT License](http://opensource.org/licenses/MIT) 33 | 34 | Copyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> 35 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/utils-merge/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Merge object b with object a. 3 | * 4 | * var a = { foo: 'bar' } 5 | * , b = { bar: 'baz' }; 6 | * 7 | * merge(a, b); 8 | * // => { foo: 'bar', bar: 'baz' } 9 | * 10 | * @param {Object} a 11 | * @param {Object} b 12 | * @return {Object} 13 | * @api public 14 | */ 15 | 16 | exports = module.exports = function(a, b){ 17 | if (a && b) { 18 | for (var key in b) { 19 | a[key] = b[key]; 20 | } 21 | } 22 | return a; 23 | }; 24 | -------------------------------------------------------------------------------- /node_modules/serve-static/node_modules/utils-merge/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "utils-merge", 3 | "version": "1.0.0", 4 | "description": "merge() utility function", 5 | "keywords": [ 6 | "util" 7 | ], 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/jaredhanson/utils-merge.git" 11 | }, 12 | "bugs": { 13 | "url": "http://github.com/jaredhanson/utils-merge/issues" 14 | }, 15 | "author": { 16 | "name": "Jared Hanson", 17 | "email": "jaredhanson@gmail.com", 18 | "url": "http://www.jaredhanson.net/" 19 | }, 20 | "licenses": [ 21 | { 22 | "type": "MIT", 23 | "url": "http://www.opensource.org/licenses/MIT" 24 | } 25 | ], 26 | "main": "./index", 27 | "dependencies": {}, 28 | "devDependencies": { 29 | "mocha": "1.x.x", 30 | "chai": "1.x.x" 31 | }, 32 | "scripts": { 33 | "test": "mocha --reporter spec --require test/bootstrap/node test/*.test.js" 34 | }, 35 | "engines": { 36 | "node": ">= 0.4.0" 37 | }, 38 | "_id": "utils-merge@1.0.0", 39 | "dist": { 40 | "shasum": "0294fb922bb9375153541c4f7096231f287c8af8", 41 | "tarball": "http://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz" 42 | }, 43 | "_from": "utils-merge@1.0.0", 44 | "_npmVersion": "1.2.25", 45 | "_npmUser": { 46 | "name": "jaredhanson", 47 | "email": "jaredhanson@gmail.com" 48 | }, 49 | "maintainers": [ 50 | { 51 | "name": "jaredhanson", 52 | "email": "jaredhanson@gmail.com" 53 | } 54 | ], 55 | "directories": {}, 56 | "_shasum": "0294fb922bb9375153541c4f7096231f287c8af8", 57 | "_resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", 58 | "readme": "ERROR: No README data found!", 59 | "homepage": "https://github.com/jaredhanson/utils-merge" 60 | } 61 | -------------------------------------------------------------------------------- /node_modules/serve-static/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "serve-static", 3 | "description": "Serve static files", 4 | "version": "1.9.3", 5 | "author": { 6 | "name": "Douglas Christopher Wilson", 7 | "email": "doug@somethingdoug.com" 8 | }, 9 | "license": "MIT", 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/expressjs/serve-static" 13 | }, 14 | "dependencies": { 15 | "escape-html": "1.0.1", 16 | "parseurl": "~1.3.0", 17 | "send": "0.12.3", 18 | "utils-merge": "1.0.0" 19 | }, 20 | "devDependencies": { 21 | "istanbul": "0.3.9", 22 | "mocha": "2.2.5", 23 | "supertest": "1.0.1" 24 | }, 25 | "files": [ 26 | "LICENSE", 27 | "HISTORY.md", 28 | "index.js" 29 | ], 30 | "engines": { 31 | "node": ">= 0.8.0" 32 | }, 33 | "scripts": { 34 | "test": "mocha --reporter spec --bail --check-leaks test/", 35 | "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", 36 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" 37 | }, 38 | "gitHead": "c76d20a9f51a15a467eab2b0610e5de60506dfbc", 39 | "bugs": { 40 | "url": "https://github.com/expressjs/serve-static/issues" 41 | }, 42 | "homepage": "https://github.com/expressjs/serve-static", 43 | "_id": "serve-static@1.9.3", 44 | "_shasum": "5f8da07323ad385ff3dc541f1a7917b2e436eb57", 45 | "_from": "serve-static@*", 46 | "_npmVersion": "1.4.28", 47 | "_npmUser": { 48 | "name": "dougwilson", 49 | "email": "doug@somethingdoug.com" 50 | }, 51 | "maintainers": [ 52 | { 53 | "name": "dougwilson", 54 | "email": "doug@somethingdoug.com" 55 | }, 56 | { 57 | "name": "jongleberry", 58 | "email": "jonathanrichardong@gmail.com" 59 | }, 60 | { 61 | "name": "tjholowaychuk", 62 | "email": "tj@vision-media.ca" 63 | }, 64 | { 65 | "name": "mscdex", 66 | "email": "mscdex@mscdex.net" 67 | }, 68 | { 69 | "name": "fishrock123", 70 | "email": "fishrock123@rocketmail.com" 71 | }, 72 | { 73 | "name": "defunctzombie", 74 | "email": "shtylman@gmail.com" 75 | } 76 | ], 77 | "dist": { 78 | "shasum": "5f8da07323ad385ff3dc541f1a7917b2e436eb57", 79 | "tarball": "http://registry.npmjs.org/serve-static/-/serve-static-1.9.3.tgz" 80 | }, 81 | "directories": {}, 82 | "_resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.9.3.tgz" 83 | } 84 | -------------------------------------------------------------------------------- /p5HammerDoubleTap/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /p5HammerDoubleTap/sketch.js: -------------------------------------------------------------------------------- 1 | var xspacing = 4; // Distance between each horizontal location 2 | var w; // Width of entire wave 3 | var theta = 0.0; // Start angle at 0 4 | var amplitude = 15.0; // Height of wave 5 | var period = 500.0; // How many pixels before the wave repeats 6 | var dx; // Value for incrementing x 7 | var yvalues; // Using an array to store height values for the wave 8 | 9 | // Hammer 10 | var mc; 11 | 12 | var changeValue = 0; 13 | var changeAmp = 0; 14 | 15 | function setup() { 16 | var myCan = createCanvas(windowWidth, windowHeight); 17 | mc = new Hammer(myCan.elt); 18 | w = width+16; 19 | dx = (TWO_PI / period) * xspacing; 20 | yvalues = new Array(floor(w/xspacing)); 21 | 22 | setupDoubleTap(); 23 | } 24 | 25 | function draw() { 26 | background(0); 27 | calcWave(); 28 | renderWave(); 29 | } 30 | 31 | function calcWave() { 32 | // Increment theta (try different values for 33 | // 'angular velocity' here 34 | theta = theta + 0.02 + changeValue; 35 | 36 | // For every x value, calculate a y value with sine function 37 | var x = theta; 38 | for (var i = 0; i < yvalues.length; i++) { 39 | yvalues[i] = sin(x)*(amplitude+changeAmp); 40 | x+=dx; 41 | } 42 | } 43 | 44 | function renderWave() { 45 | stroke(255); 46 | fill(255); 47 | // A simple way to draw the wave with an ellipse at each location 48 | for (var x = 0; x < yvalues.length; x++) { 49 | line(x*xspacing, height, x*xspacing, height/2+yvalues[x]); 50 | //ellipse(x*xspacing, height/2+yvalues[x], 16, 16); 51 | } 52 | } 53 | 54 | function setupDoubleTap() { 55 | mc.on("doubletap", function(e){ 56 | changeValue = 0.6; 57 | changeAmp = 35; 58 | }); 59 | setInterval(function(){ 60 | if (changeValue > 0){ 61 | changeValue = changeValue / 1.5; 62 | } 63 | if (changeAmp > 0){ 64 | changeAmp = changeAmp / 5; 65 | } 66 | }, 900); 67 | } -------------------------------------------------------------------------------- /p5HammerPinch/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /p5HammerPinch/sketch.js: -------------------------------------------------------------------------------- 1 | var diameter; 2 | var distance; 3 | var ex, ey; 4 | var mc 5 | 6 | function setup(){ 7 | var myCan = createCanvas(windowWidth, windowHeight); 8 | var element = document.getElementById(myCan.elt); 9 | mc = new Hammer(element); 10 | mc.get('pinch').set({ enable: true }); 11 | 12 | diameter = 50; 13 | ex = int(windowWidth/2); 14 | ey = int(windowHeight/2); 15 | 16 | setupPinch(); 17 | } 18 | 19 | function draw(){ 20 | background(255); 21 | noStroke(); 22 | fill(color(0)); 23 | ellipse(ex, ey, diameter, diameter); 24 | } 25 | 26 | function setupPinch() { 27 | mc.on("pinchout pinchin", function(e){ 28 | distance = int(dist(e.center.x, e.center.y, ex, ey)); 29 | //console.log(e); 30 | if (distance < diameter/2) { 31 | if (e.type === "pinchin") { 32 | diameter = diameter - 3; 33 | } else if (e.type === "pinchout") { 34 | diameter = diameter + 3; 35 | } 36 | } 37 | }); 38 | } -------------------------------------------------------------------------------- /p5HammerPress/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /p5HammerPress/sketch.js: -------------------------------------------------------------------------------- 1 | var diameter; 2 | var distance; 3 | var ex, ey; 4 | var mc 5 | var count; 6 | 7 | function setup(){ 8 | var myCan = createCanvas(windowWidth, windowHeight); 9 | var element = document.getElementById(myCan.elt); 10 | mc = new Hammer(element); 11 | 12 | count = 0; 13 | diameter = 50; 14 | ex = int(windowWidth/2); 15 | ey = int(windowHeight/2); 16 | 17 | setupPress(); 18 | } 19 | 20 | function draw(){ 21 | background(255); 22 | noStroke(); 23 | if (count > 0){ 24 | fill(color(ex, ey, count * 10.2, count * 10.2)); 25 | ellipse(ex, ey, 100 + (40 - count), 100 + (40 - count)); 26 | --count; 27 | } 28 | fill(color(ex, ey, 0)); 29 | ellipse(ex, ey, diameter, diameter); 30 | } 31 | 32 | function touchMoved() { 33 | ex = touchX; 34 | ey = touchY; 35 | return false; 36 | } 37 | 38 | function setupPress() { 39 | mc.on("press", function(e){ 40 | distance = int(dist(e.center.x, e.center.y, ex, ey)); 41 | //console.log(e.center.x, e.center.y, ex, ey); 42 | //console.log(distance, diameter/2); 43 | if (distance < diameter/2) { 44 | //console.log('on ellipse') 45 | count = 25; 46 | } 47 | }); 48 | } 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /p5HammerRotate/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /p5HammerRotate/sketch.js: -------------------------------------------------------------------------------- 1 | var diameter; 2 | var ex, ey; 3 | var mc; 4 | var rotation = 0; 5 | var size; 6 | var s; 7 | 8 | function setup(){ 9 | var myCan = createCanvas(windowWidth, windowHeight); 10 | mc = new Hammer(myCan.elt); 11 | mc.get('rotate').set({ enable: true }); 12 | 13 | diameter = 100; 14 | ex = int(windowWidth/2); 15 | ey = int(windowHeight/2); 16 | s = ex - 100; 17 | size = s / 5; 18 | 19 | setupRotate(); 20 | } 21 | 22 | function draw(){ 23 | background(255); 24 | noStroke(); 25 | 26 | translate(ex, ey); 27 | for (var i = s; i > 0; i--) { 28 | if (i % 2 === 0) { 29 | fill(255, 0, 0); 30 | } else { 31 | fill(255); 32 | } 33 | rotate(rotation); 34 | diameter = i * size + 20; 35 | rect(-diameter/2, -diameter/2, diameter, diameter, 20 + i * 3); 36 | } 37 | 38 | } 39 | 40 | function setupRotate() { 41 | mc.on("rotate", function(e){ 42 | rotation = e.rotation/10; 43 | }); 44 | } -------------------------------------------------------------------------------- /p5HammerSwipe/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /p5HammerSwipe/sketch.js: -------------------------------------------------------------------------------- 1 | var diameter; 2 | var distance; 3 | var ex, ey; 4 | var moveH; 5 | 6 | // new Hammer 7 | var mc 8 | 9 | function setup(){ 10 | var myCan = createCanvas(windowWidth, windowHeight); 11 | var element = document.getElementById(myCan.elt); 12 | mc = new Hammer(element); 13 | 14 | moveH = 0; 15 | diameter = 100; 16 | ex = int(windowWidth/2); 17 | ey = int(windowHeight/2); 18 | 19 | setupSwipe(); 20 | } 21 | 22 | function draw(){ 23 | background(255); 24 | 25 | noStroke(); 26 | fill(color(0)); 27 | 28 | if (moveH != 0) { 29 | ex = ex + moveH; 30 | if (ex + diameter < 0) { 31 | ex = width; 32 | } else if (ex > width) { 33 | ex = 0; 34 | } 35 | } 36 | 37 | rectMode(CENTER); 38 | rect(ex, ey, diameter, diameter); 39 | 40 | } 41 | function touchMoved() { 42 | return false; 43 | } 44 | 45 | function setupSwipe() { 46 | mc.on("swipeleft swiperight", function(e){ 47 | if (e.type === "swipeleft") { 48 | moveH = -3; 49 | } else if (e.type === "swiperight") { 50 | moveH = 3; 51 | } 52 | }); 53 | } -------------------------------------------------------------------------------- /p5jQueryMobilePages/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | draw p5 5 | 6 | 7 | 8 | 9 | 16 | 17 | 18 | 19 |
20 | 21 |
22 |

Home

23 | bar 24 |
25 | 26 |
27 |
28 | 29 |
30 | 31 |
32 | 33 | 34 | 35 |
36 | 37 |
38 |

Second

39 |
40 | 41 |
42 |

Back to home

43 |
44 | 45 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /p5jQueryMobilePages/sketch.js: -------------------------------------------------------------------------------- 1 | var diameter; 2 | var ex, ey; 3 | var mc; 4 | var rotation = 0; 5 | var size; 6 | var s; 7 | 8 | function setup(){ 9 | var myCan = createCanvas(windowWidth, windowHeight); 10 | myCan.parent('p5Container'); 11 | var element = document.getElementById('p5Container'); 12 | mc = new Hammer(element); 13 | mc.get('rotate').set({ enable: true }); 14 | 15 | diameter = 100; 16 | ex = int(windowWidth/2); 17 | ey = int(windowHeight/2); 18 | s = ex - 100; 19 | size = s / 5; 20 | 21 | setupRotate(); 22 | } 23 | 24 | function draw(){ 25 | background(255); 26 | noStroke(); 27 | 28 | translate(ex, ey); 29 | for (var i = s; i > 0; i--) { 30 | if (i % 2 === 0) { 31 | fill(255, 0, 0); 32 | } else { 33 | fill(255); 34 | } 35 | rotate(rotation); 36 | diameter = i * size + 20; 37 | rect(-diameter/2, -diameter/2, diameter, diameter, 20 + i * 3); 38 | } 39 | 40 | } 41 | 42 | function setupRotate() { 43 | mc.on("rotate", function(e){ 44 | rotation = e.rotation/10; 45 | }); 46 | } -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var connect = require('connect'); 2 | var serveStatic = require('serve-static'); 3 | connect().use(serveStatic('./simpleDraw')).listen(8080); // change the folder to the sketch you want -------------------------------------------------------------------------------- /shake/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /simpleDraw/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | draw p5 10 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /simpleDraw/js/sketch.js: -------------------------------------------------------------------------------- 1 | // document.body.addEventListener('touchstart', function(e){ e.preventDefault(); }); 2 | 3 | function setup() { 4 | var myCan = createCanvas(windowWidth, windowHeight); 5 | myCan.parent('p5Container'); 6 | 7 | strokeWeight(10) 8 | stroke(0); 9 | } 10 | 11 | function touchMoved() { 12 | line(touchX, touchY, ptouchX, ptouchY); 13 | return false; 14 | } 15 | -------------------------------------------------------------------------------- /sketch.js: -------------------------------------------------------------------------------- 1 | // template http://bit.ly/1g8h17S 2 | 3 | var diameter; 4 | var distance; 5 | var ex, ey; 6 | var mc 7 | var count; 8 | 9 | function setup(){ 10 | var myCan = createCanvas(windowWidth, windowHeight); 11 | myCan.parent('p5Container'); 12 | var element = document.getElementById('p5Container'); 13 | mc = new Hammer(element); 14 | mc.get('pinch').set({ enable: true }); 15 | 16 | count = 0; 17 | diameter = 50; 18 | ex = int(windowWidth/2); 19 | ey = int(windowHeight/2); 20 | 21 | pinched(); 22 | } 23 | 24 | function draw(){ 25 | background(255); 26 | noStroke(); 27 | if (count > 0){ 28 | fill(color(ex, ey, count * 10.2, count * 10.2)); 29 | ellipse(ex, ey, 100 + (40 - count), 100 + (40 - count)); 30 | --count; 31 | } 32 | fill(color(ex, ey, 0)); 33 | ellipse(ex, ey, diameter, diameter); 34 | } 35 | 36 | // function touchMoved() { 37 | // ex = touchX; 38 | // ey = touchY; 39 | // return false; 40 | // } 41 | 42 | function pinched() { 43 | mc.on("pinch", function(e){ 44 | distance = int(dist(e.center.x, e.center.y, ex, ey)); 45 | //console.log(e.center.x, e.center.y, ex, ey); 46 | //console.log(distance, diameter/2); 47 | //e.preventDefault(); 48 | if (distance < diameter/2) { 49 | //console.log('on ellipse') 50 | count = 25; 51 | } 52 | }); 53 | } 54 | 55 | 56 | 57 | 58 | 59 | 60 | --------------------------------------------------------------------------------