├── README ├── README.md ├── UNLICENSE ├── bower.json ├── jquery.jsonrpc.js ├── node_modules ├── .bin │ └── express └── express │ ├── .npmignore │ ├── .travis.yml │ ├── History.md │ ├── LICENSE │ ├── Makefile │ ├── Readme.md │ ├── bin │ └── express │ ├── client.js │ ├── index.js │ ├── lib │ ├── application.js │ ├── express.js │ ├── middleware.js │ ├── request.js │ ├── response.js │ ├── router │ │ ├── index.js │ │ └── route.js │ ├── utils.js │ └── view.js │ ├── node_modules │ ├── buffer-crc32 │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── index.js │ │ ├── package.json │ │ └── tests │ │ │ └── crc.test.js │ ├── commander │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── History.md │ │ ├── Makefile │ │ ├── Readme.md │ │ ├── index.js │ │ ├── lib │ │ │ └── commander.js │ │ └── package.json │ ├── connect │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Readme.md │ │ ├── index.js │ │ ├── lib │ │ │ ├── cache.js │ │ │ ├── connect.js │ │ │ ├── index.js │ │ │ ├── middleware │ │ │ │ ├── basicAuth.js │ │ │ │ ├── bodyParser.js │ │ │ │ ├── compress.js │ │ │ │ ├── cookieParser.js │ │ │ │ ├── cookieSession.js │ │ │ │ ├── csrf.js │ │ │ │ ├── directory.js │ │ │ │ ├── errorHandler.js │ │ │ │ ├── favicon.js │ │ │ │ ├── json.js │ │ │ │ ├── limit.js │ │ │ │ ├── logger.js │ │ │ │ ├── methodOverride.js │ │ │ │ ├── multipart.js │ │ │ │ ├── query.js │ │ │ │ ├── responseTime.js │ │ │ │ ├── session.js │ │ │ │ ├── session │ │ │ │ │ ├── cookie.js │ │ │ │ │ ├── memory.js │ │ │ │ │ ├── session.js │ │ │ │ │ └── store.js │ │ │ │ ├── static.js │ │ │ │ ├── staticCache.js │ │ │ │ ├── timeout.js │ │ │ │ ├── urlencoded.js │ │ │ │ └── vhost.js │ │ │ ├── patch.js │ │ │ ├── proto.js │ │ │ ├── public │ │ │ │ ├── directory.html │ │ │ │ ├── error.html │ │ │ │ ├── favicon.ico │ │ │ │ ├── icons │ │ │ │ │ ├── page.png │ │ │ │ │ ├── page_add.png │ │ │ │ │ ├── page_attach.png │ │ │ │ │ ├── page_code.png │ │ │ │ │ ├── page_copy.png │ │ │ │ │ ├── page_delete.png │ │ │ │ │ ├── page_edit.png │ │ │ │ │ ├── page_error.png │ │ │ │ │ ├── page_excel.png │ │ │ │ │ ├── page_find.png │ │ │ │ │ ├── page_gear.png │ │ │ │ │ ├── page_go.png │ │ │ │ │ ├── page_green.png │ │ │ │ │ ├── page_key.png │ │ │ │ │ ├── page_lightning.png │ │ │ │ │ ├── page_link.png │ │ │ │ │ ├── page_paintbrush.png │ │ │ │ │ ├── page_paste.png │ │ │ │ │ ├── page_red.png │ │ │ │ │ ├── page_refresh.png │ │ │ │ │ ├── page_save.png │ │ │ │ │ ├── page_white.png │ │ │ │ │ ├── page_white_acrobat.png │ │ │ │ │ ├── page_white_actionscript.png │ │ │ │ │ ├── page_white_add.png │ │ │ │ │ ├── page_white_c.png │ │ │ │ │ ├── page_white_camera.png │ │ │ │ │ ├── page_white_cd.png │ │ │ │ │ ├── page_white_code.png │ │ │ │ │ ├── page_white_code_red.png │ │ │ │ │ ├── page_white_coldfusion.png │ │ │ │ │ ├── page_white_compressed.png │ │ │ │ │ ├── page_white_copy.png │ │ │ │ │ ├── page_white_cplusplus.png │ │ │ │ │ ├── page_white_csharp.png │ │ │ │ │ ├── page_white_cup.png │ │ │ │ │ ├── page_white_database.png │ │ │ │ │ ├── page_white_delete.png │ │ │ │ │ ├── page_white_dvd.png │ │ │ │ │ ├── page_white_edit.png │ │ │ │ │ ├── page_white_error.png │ │ │ │ │ ├── page_white_excel.png │ │ │ │ │ ├── page_white_find.png │ │ │ │ │ ├── page_white_flash.png │ │ │ │ │ ├── page_white_freehand.png │ │ │ │ │ ├── page_white_gear.png │ │ │ │ │ ├── page_white_get.png │ │ │ │ │ ├── page_white_go.png │ │ │ │ │ ├── page_white_h.png │ │ │ │ │ ├── page_white_horizontal.png │ │ │ │ │ ├── page_white_key.png │ │ │ │ │ ├── page_white_lightning.png │ │ │ │ │ ├── page_white_link.png │ │ │ │ │ ├── page_white_magnify.png │ │ │ │ │ ├── page_white_medal.png │ │ │ │ │ ├── page_white_office.png │ │ │ │ │ ├── page_white_paint.png │ │ │ │ │ ├── page_white_paintbrush.png │ │ │ │ │ ├── page_white_paste.png │ │ │ │ │ ├── page_white_php.png │ │ │ │ │ ├── page_white_picture.png │ │ │ │ │ ├── page_white_powerpoint.png │ │ │ │ │ ├── page_white_put.png │ │ │ │ │ ├── page_white_ruby.png │ │ │ │ │ ├── page_white_stack.png │ │ │ │ │ ├── page_white_star.png │ │ │ │ │ ├── page_white_swoosh.png │ │ │ │ │ ├── page_white_text.png │ │ │ │ │ ├── page_white_text_width.png │ │ │ │ │ ├── page_white_tux.png │ │ │ │ │ ├── page_white_vector.png │ │ │ │ │ ├── page_white_visualstudio.png │ │ │ │ │ ├── page_white_width.png │ │ │ │ │ ├── page_white_word.png │ │ │ │ │ ├── page_white_world.png │ │ │ │ │ ├── page_white_wrench.png │ │ │ │ │ ├── page_white_zip.png │ │ │ │ │ ├── page_word.png │ │ │ │ │ └── page_world.png │ │ │ │ └── style.css │ │ │ └── utils.js │ │ ├── node_modules │ │ │ ├── bytes │ │ │ │ ├── .npmignore │ │ │ │ ├── History.md │ │ │ │ ├── Makefile │ │ │ │ ├── Readme.md │ │ │ │ ├── component.json │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── crc │ │ │ │ ├── .gitmodules │ │ │ │ ├── .npmignore │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── lib │ │ │ │ │ └── crc.js │ │ │ │ ├── package.json │ │ │ │ └── test │ │ │ │ │ └── crc.js │ │ │ ├── formidable │ │ │ │ ├── .npmignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── Makefile │ │ │ │ ├── Readme.md │ │ │ │ ├── TODO │ │ │ │ ├── benchmark │ │ │ │ │ └── bench-multipart-parser.js │ │ │ │ ├── example │ │ │ │ │ ├── post.js │ │ │ │ │ └── upload.js │ │ │ │ ├── index.js │ │ │ │ ├── lib │ │ │ │ │ ├── file.js │ │ │ │ │ ├── incoming_form.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── multipart_parser.js │ │ │ │ │ ├── querystring_parser.js │ │ │ │ │ └── util.js │ │ │ │ ├── node-gently │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── Readme.md │ │ │ │ │ ├── example │ │ │ │ │ │ ├── dog.js │ │ │ │ │ │ └── event_emitter.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── lib │ │ │ │ │ │ └── gently │ │ │ │ │ │ │ ├── gently.js │ │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── test │ │ │ │ │ │ ├── common.js │ │ │ │ │ │ └── simple │ │ │ │ │ │ └── test-gently.js │ │ │ │ ├── package.json │ │ │ │ ├── test │ │ │ │ │ ├── common.js │ │ │ │ │ ├── fixture │ │ │ │ │ │ ├── file │ │ │ │ │ │ │ ├── funkyfilename.txt │ │ │ │ │ │ │ └── plain.txt │ │ │ │ │ │ ├── http │ │ │ │ │ │ │ └── special-chars-in-filename │ │ │ │ │ │ │ │ └── info.md │ │ │ │ │ │ ├── js │ │ │ │ │ │ │ ├── no-filename.js │ │ │ │ │ │ │ └── special-chars-in-filename.js │ │ │ │ │ │ └── multipart.js │ │ │ │ │ ├── integration │ │ │ │ │ │ └── test-fixtures.js │ │ │ │ │ ├── legacy │ │ │ │ │ │ ├── common.js │ │ │ │ │ │ ├── integration │ │ │ │ │ │ │ └── test-multipart-parser.js │ │ │ │ │ │ ├── simple │ │ │ │ │ │ │ ├── test-file.js │ │ │ │ │ │ │ ├── test-incoming-form.js │ │ │ │ │ │ │ ├── test-multipart-parser.js │ │ │ │ │ │ │ └── test-querystring-parser.js │ │ │ │ │ │ └── system │ │ │ │ │ │ │ └── test-multi-video-upload.js │ │ │ │ │ ├── run.js │ │ │ │ │ └── unit │ │ │ │ │ │ └── test-incoming-form.js │ │ │ │ └── tool │ │ │ │ │ └── record.js │ │ │ ├── pause │ │ │ │ ├── .npmignore │ │ │ │ ├── History.md │ │ │ │ ├── Makefile │ │ │ │ ├── Readme.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ └── qs │ │ │ │ ├── .gitmodules │ │ │ │ ├── .npmignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── History.md │ │ │ │ ├── Makefile │ │ │ │ ├── Readme.md │ │ │ │ ├── benchmark.js │ │ │ │ ├── component.json │ │ │ │ ├── examples.js │ │ │ │ ├── index.js │ │ │ │ ├── lib │ │ │ │ ├── head.js │ │ │ │ ├── querystring.js │ │ │ │ └── tail.js │ │ │ │ ├── package.json │ │ │ │ ├── querystring.js │ │ │ │ └── test │ │ │ │ ├── browser │ │ │ │ ├── expect.js │ │ │ │ ├── index.html │ │ │ │ ├── jquery.js │ │ │ │ ├── mocha.css │ │ │ │ ├── mocha.js │ │ │ │ ├── qs.css │ │ │ │ └── qs.js │ │ │ │ ├── parse.js │ │ │ │ └── stringify.js │ │ ├── package.json │ │ └── test.js │ ├── cookie-signature │ │ ├── .npmignore │ │ ├── History.md │ │ ├── Makefile │ │ ├── Readme.md │ │ ├── index.js │ │ └── package.json │ ├── cookie │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── index.js │ │ ├── package.json │ │ └── test │ │ │ ├── mocha.opts │ │ │ ├── parse.js │ │ │ └── serialize.js │ ├── debug │ │ ├── .npmignore │ │ ├── History.md │ │ ├── Makefile │ │ ├── Readme.md │ │ ├── debug.component.js │ │ ├── debug.js │ │ ├── example │ │ │ ├── app.js │ │ │ ├── browser.html │ │ │ ├── wildcards.js │ │ │ └── worker.js │ │ ├── head.js │ │ ├── index.js │ │ ├── lib │ │ │ └── debug.js │ │ ├── package.json │ │ └── tail.js │ ├── fresh │ │ ├── .npmignore │ │ ├── Makefile │ │ ├── Readme.md │ │ ├── index.js │ │ └── package.json │ ├── methods │ │ ├── index.js │ │ └── package.json │ ├── mkdirp │ │ ├── .gitignore.orig │ │ ├── .gitignore.rej │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.markdown │ │ ├── examples │ │ │ ├── pow.js │ │ │ ├── pow.js.orig │ │ │ └── pow.js.rej │ │ ├── index.js │ │ ├── package.json │ │ └── test │ │ │ ├── chmod.js │ │ │ ├── clobber.js │ │ │ ├── mkdirp.js │ │ │ ├── perm.js │ │ │ ├── perm_sync.js │ │ │ ├── race.js │ │ │ ├── rel.js │ │ │ ├── return.js │ │ │ ├── return_sync.js │ │ │ ├── root.js │ │ │ ├── sync.js │ │ │ ├── umask.js │ │ │ └── umask_sync.js │ ├── range-parser │ │ ├── .npmignore │ │ ├── History.md │ │ ├── Makefile │ │ ├── Readme.md │ │ ├── index.js │ │ └── package.json │ └── send │ │ ├── .npmignore │ │ ├── History.md │ │ ├── Makefile │ │ ├── Readme.md │ │ ├── index.js │ │ ├── lib │ │ ├── send.js │ │ └── utils.js │ │ ├── node_modules │ │ └── mime │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── mime.js │ │ │ ├── package.json │ │ │ ├── test.js │ │ │ └── types │ │ │ ├── mime.types │ │ │ └── node.types │ │ └── package.json │ ├── package.json │ └── test.js ├── server.js └── test ├── data ├── invalid.js ├── invalid_batch.js ├── valid.js └── valid_batch.js ├── index.html ├── qunit.css ├── qunit.js └── tests.js /README: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /UNLICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-jsonrpc", 3 | "version": "0.1.1", 4 | "homepage": "https://github.com/datagraph/jquery-jsonrpc", 5 | "description": "A JSON RPC 2.0 client for jQuery", 6 | "main": "jquery.jsonrpc.js", 7 | "moduleType": [ 8 | "globals" 9 | ], 10 | "keywords": [ 11 | "jquery", 12 | "jsonrpc" 13 | ], 14 | "license": "Unlicense", 15 | "dependencies": { 16 | "jquery": ">=1.4" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /node_modules/.bin/express: -------------------------------------------------------------------------------- 1 | ../express/bin/express -------------------------------------------------------------------------------- /node_modules/express/.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | docs/ 3 | examples/ 4 | support/ 5 | test/ 6 | testing.js 7 | .DS_Store 8 | coverage.html 9 | lib-cov 10 | -------------------------------------------------------------------------------- /node_modules/express/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 -------------------------------------------------------------------------------- /node_modules/express/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2009-2011 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. -------------------------------------------------------------------------------- /node_modules/express/Makefile: -------------------------------------------------------------------------------- 1 | 2 | MOCHA_OPTS= 3 | REPORTER = dot 4 | 5 | check: test 6 | 7 | test: test-unit test-acceptance 8 | 9 | test-unit: 10 | @NODE_ENV=test ./node_modules/.bin/mocha \ 11 | --reporter $(REPORTER) \ 12 | $(MOCHA_OPTS) 13 | 14 | test-acceptance: 15 | @NODE_ENV=test ./node_modules/.bin/mocha \ 16 | --reporter $(REPORTER) \ 17 | --bail \ 18 | test/acceptance/*.js 19 | 20 | test-cov: lib-cov 21 | @EXPRESS_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html 22 | 23 | lib-cov: 24 | @jscoverage lib lib-cov 25 | 26 | benchmark: 27 | @./support/bench 28 | 29 | clean: 30 | rm -f coverage.html 31 | rm -fr lib-cov 32 | 33 | .PHONY: test test-unit test-acceptance benchmark clean 34 | -------------------------------------------------------------------------------- /node_modules/express/client.js: -------------------------------------------------------------------------------- 1 | 2 | var http = require('http'); 3 | 4 | var times = 50; 5 | 6 | while (times--) { 7 | var req = http.request({ 8 | port: 3000 9 | , method: 'POST' 10 | , headers: { 'Content-Type': 'application/x-www-form-urlencoded' } 11 | }); 12 | 13 | req.on('response', function(res){ 14 | console.log(res.statusCode); 15 | }); 16 | 17 | var n = 500000; 18 | while (n--) { 19 | req.write('foo=bar&bar=baz&'); 20 | } 21 | 22 | req.write('foo=bar&bar=baz'); 23 | 24 | req.end(); 25 | } -------------------------------------------------------------------------------- /node_modules/express/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = process.env.EXPRESS_COV 3 | ? require('./lib-cov/express') 4 | : require('./lib/express'); -------------------------------------------------------------------------------- /node_modules/express/lib/express.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var connect = require('connect') 6 | , proto = require('./application') 7 | , Route = require('./router/route') 8 | , Router = require('./router') 9 | , req = require('./request') 10 | , res = require('./response') 11 | , utils = connect.utils; 12 | 13 | /** 14 | * Expose `createApplication()`. 15 | */ 16 | 17 | exports = module.exports = createApplication; 18 | 19 | /** 20 | * Framework version. 21 | */ 22 | 23 | exports.version = '3.0.3'; 24 | 25 | /** 26 | * Expose mime. 27 | */ 28 | 29 | exports.mime = connect.mime; 30 | 31 | /** 32 | * Create an express application. 33 | * 34 | * @return {Function} 35 | * @api public 36 | */ 37 | 38 | function createApplication() { 39 | var app = connect(); 40 | utils.merge(app, proto); 41 | app.request = { __proto__: req }; 42 | app.response = { __proto__: res }; 43 | app.init(); 44 | return app; 45 | } 46 | 47 | /** 48 | * Expose connect.middleware as express.* 49 | * for example `express.logger` etc. 50 | */ 51 | 52 | for (var key in connect.middleware) { 53 | Object.defineProperty( 54 | exports 55 | , key 56 | , Object.getOwnPropertyDescriptor(connect.middleware, key)); 57 | } 58 | 59 | /** 60 | * Error on createServer(). 61 | */ 62 | 63 | exports.createServer = function(){ 64 | console.warn('Warning: express.createServer() is deprecated, express'); 65 | console.warn('applications no longer inherit from http.Server,'); 66 | console.warn('please use:'); 67 | console.warn(''); 68 | console.warn(' var express = require("express");'); 69 | console.warn(' var app = express();'); 70 | console.warn(''); 71 | return createApplication(); 72 | }; 73 | 74 | /** 75 | * Expose the prototypes. 76 | */ 77 | 78 | exports.application = proto; 79 | exports.request = req; 80 | exports.response = res; 81 | 82 | /** 83 | * Expose constructors. 84 | */ 85 | 86 | exports.Route = Route; 87 | exports.Router = Router; 88 | 89 | // Error handler title 90 | 91 | exports.errorHandler.title = 'Express'; 92 | 93 | -------------------------------------------------------------------------------- /node_modules/express/lib/middleware.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var utils = require('./utils'); 7 | 8 | /** 9 | * Initialization middleware, exposing the 10 | * request and response to eachother, as well 11 | * as defaulting the X-Powered-By header field. 12 | * 13 | * @param {Function} app 14 | * @return {Function} 15 | * @api private 16 | */ 17 | 18 | exports.init = function(app){ 19 | return function expressInit(req, res, next){ 20 | req.app = res.app = app; 21 | if (app.settings['x-powered-by']) res.setHeader('X-Powered-By', 'Express'); 22 | req.res = res; 23 | res.req = req; 24 | req.next = next; 25 | 26 | req.__proto__ = app.request; 27 | res.__proto__ = app.response; 28 | 29 | res.locals = res.locals || utils.locals(res); 30 | 31 | next(); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /node_modules/express/lib/router/route.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var utils = require('../utils'); 7 | 8 | /** 9 | * Expose `Route`. 10 | */ 11 | 12 | module.exports = Route; 13 | 14 | /** 15 | * Initialize `Route` with the given HTTP `method`, `path`, 16 | * and an array of `callbacks` and `options`. 17 | * 18 | * Options: 19 | * 20 | * - `sensitive` enable case-sensitive routes 21 | * - `strict` enable strict matching for trailing slashes 22 | * 23 | * @param {String} method 24 | * @param {String} path 25 | * @param {Array} callbacks 26 | * @param {Object} options. 27 | * @api private 28 | */ 29 | 30 | function Route(method, path, callbacks, options) { 31 | options = options || {}; 32 | this.path = path; 33 | this.method = method; 34 | this.callbacks = callbacks; 35 | this.regexp = utils.pathRegexp(path 36 | , this.keys = [] 37 | , options.sensitive 38 | , options.strict); 39 | } 40 | 41 | /** 42 | * Check if this route matches `path`, if so 43 | * populate `.params`. 44 | * 45 | * @param {String} path 46 | * @return {Boolean} 47 | * @api private 48 | */ 49 | 50 | Route.prototype.match = function(path){ 51 | var keys = this.keys 52 | , params = this.params = [] 53 | , m = this.regexp.exec(path); 54 | 55 | if (!m) return false; 56 | 57 | for (var i = 1, len = m.length; i < len; ++i) { 58 | var key = keys[i - 1]; 59 | 60 | var val = 'string' == typeof m[i] 61 | ? decodeURIComponent(m[i]) 62 | : m[i]; 63 | 64 | if (key) { 65 | params[key.name] = val; 66 | } else { 67 | params.push(val); 68 | } 69 | } 70 | 71 | return true; 72 | }; 73 | -------------------------------------------------------------------------------- /node_modules/express/lib/view.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Module dependencies. 3 | */ 4 | 5 | var path = require('path') 6 | , fs = require('fs') 7 | , utils = require('./utils') 8 | , dirname = path.dirname 9 | , basename = path.basename 10 | , extname = path.extname 11 | , exists = fs.existsSync || path.existsSync 12 | , join = path.join; 13 | 14 | /** 15 | * Expose `View`. 16 | */ 17 | 18 | module.exports = View; 19 | 20 | /** 21 | * Initialize a new `View` with the given `name`. 22 | * 23 | * Options: 24 | * 25 | * - `defaultEngine` the default template engine name 26 | * - `engines` template engine require() cache 27 | * - `root` root path for view lookup 28 | * 29 | * @param {String} name 30 | * @param {Object} options 31 | * @api private 32 | */ 33 | 34 | function View(name, options) { 35 | options = options || {}; 36 | this.name = name; 37 | this.root = options.root; 38 | var engines = options.engines; 39 | this.defaultEngine = options.defaultEngine; 40 | var ext = this.ext = extname(name); 41 | if (!ext) name += (ext = this.ext = '.' + this.defaultEngine); 42 | this.engine = engines[ext] || (engines[ext] = require(ext.slice(1)).__express); 43 | this.path = this.lookup(name); 44 | } 45 | 46 | /** 47 | * Lookup view by the given `path` 48 | * 49 | * @param {String} path 50 | * @return {String} 51 | * @api private 52 | */ 53 | 54 | View.prototype.lookup = function(path){ 55 | var ext = this.ext; 56 | 57 | // . 58 | if (!utils.isAbsolute(path)) path = join(this.root, path); 59 | if (exists(path)) return path; 60 | 61 | // /index. 62 | path = join(dirname(path), basename(path, ext), 'index' + ext); 63 | if (exists(path)) return path; 64 | }; 65 | 66 | /** 67 | * Render with the given `options` and callback `fn(err, str)`. 68 | * 69 | * @param {Object} options 70 | * @param {Function} fn 71 | * @api private 72 | */ 73 | 74 | View.prototype.render = function(options, fn){ 75 | this.engine(this.path, options, fn); 76 | }; 77 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/buffer-crc32/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /node_modules/express/node_modules/buffer-crc32/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | notifications: 6 | email: 7 | recipients: 8 | - brianloveswords@gmail.com -------------------------------------------------------------------------------- /node_modules/express/node_modules/buffer-crc32/README.md: -------------------------------------------------------------------------------- 1 | # buffer-crc32 2 | 3 | [![Build Status](https://secure.travis-ci.org/brianloveswords/buffer-crc32.png?branch=master)](http://travis-ci.org/brianloveswords/buffer-crc32) 4 | 5 | crc32 that works with binary data and fancy character sets, outputs 6 | buffer, signed or unsigned data and has tests. 7 | 8 | Derived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix 9 | 10 | # install 11 | ``` 12 | npm install buffer-crc32 13 | ``` 14 | 15 | # example 16 | ```js 17 | var crc32 = require('buffer-crc32'); 18 | // works with buffers 19 | var buf = Buffer([[0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]) 20 | crc32(buf) // -> 21 | 22 | // has convenience methods for getting signed or unsigned ints 23 | crc32.signed(buf) // -> -1805997238 24 | crc32.unsigned(buf) // -> 2488970058 25 | 26 | // will cast to buffer if given a string, so you can 27 | // directly use foreign characters safely 28 | crc32('自動販売機') // -> 29 | ``` 30 | 31 | # tests 32 | This was tested against the output of zlib's crc32 method. You can run 33 | the tests with`npm test` (requires tap) 34 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/buffer-crc32/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Brian J. Brennan", 4 | "email": "brianloveswords@gmail.com", 5 | "url": "http://bjb.io" 6 | }, 7 | "name": "buffer-crc32", 8 | "description": "A pure javascript CRC32 algorithm that plays nice with binary data", 9 | "version": "0.1.1", 10 | "homepage": "https://github.com/brianloveswords/buffer-crc32", 11 | "repository": { 12 | "type": "git", 13 | "url": "git://github.com/brianloveswords/buffer-crc32.git" 14 | }, 15 | "main": "index.js", 16 | "scripts": { 17 | "test": "./node_modules/.bin/tap tests/*.test.js" 18 | }, 19 | "dependencies": {}, 20 | "devDependencies": { 21 | "tap": "~0.2.5" 22 | }, 23 | "optionalDependencies": {}, 24 | "engines": { 25 | "node": "*" 26 | }, 27 | "readme": "# buffer-crc32\n\n[![Build Status](https://secure.travis-ci.org/brianloveswords/buffer-crc32.png?branch=master)](http://travis-ci.org/brianloveswords/buffer-crc32)\n\ncrc32 that works with binary data and fancy character sets, outputs\nbuffer, signed or unsigned data and has tests.\n\nDerived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix\n\n# install\n```\nnpm install buffer-crc32\n```\n\n# example\n```js\nvar crc32 = require('buffer-crc32');\n// works with buffers\nvar buf = Buffer([[0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00])\ncrc32(buf) // -> \n\n// has convenience methods for getting signed or unsigned ints\ncrc32.signed(buf) // -> -1805997238\ncrc32.unsigned(buf) // -> 2488970058\n\n// will cast to buffer if given a string, so you can\n// directly use foreign characters safely\ncrc32('自動販売機') // -> \n```\n\n# tests\nThis was tested against the output of zlib's crc32 method. You can run\nthe tests with`npm test` (requires tap)\n", 28 | "readmeFilename": "README.md", 29 | "_id": "buffer-crc32@0.1.1", 30 | "dist": { 31 | "shasum": "7e110dc9953908ab7c32acdc70c9f945b1cbc526" 32 | }, 33 | "_from": "buffer-crc32@0.1.1" 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/buffer-crc32/tests/crc.test.js: -------------------------------------------------------------------------------- 1 | var crc32 = require('..'); 2 | var test = require('tap').test; 3 | 4 | test('simple crc32 is no problem', function (t) { 5 | var input = Buffer('hey sup bros'); 6 | var expected = Buffer([0x47, 0xfa, 0x55, 0x70]); 7 | t.same(crc32(input), expected); 8 | t.end(); 9 | }); 10 | 11 | test('another simple one', function (t) { 12 | var input = Buffer('IEND'); 13 | var expected = Buffer([0xae, 0x42, 0x60, 0x82]); 14 | t.same(crc32(input), expected); 15 | t.end(); 16 | }); 17 | 18 | test('slightly more complex', function (t) { 19 | var input = Buffer([0x00, 0x00, 0x00]); 20 | var expected = Buffer([0xff, 0x41, 0xd9, 0x12]); 21 | t.same(crc32(input), expected); 22 | t.end(); 23 | }); 24 | 25 | test('complex crc32 gets calculated like a champ', function (t) { 26 | var input = Buffer('शीर्षक'); 27 | var expected = Buffer([0x17, 0xb8, 0xaf, 0xf1]); 28 | t.same(crc32(input), expected); 29 | t.end(); 30 | }); 31 | 32 | test('casts to buffer if necessary', function (t) { 33 | var input = 'शीर्षक'; 34 | var expected = Buffer([0x17, 0xb8, 0xaf, 0xf1]); 35 | t.same(crc32(input), expected); 36 | t.end(); 37 | }); 38 | 39 | test('can do unsigned', function (t) { 40 | var input = 'ham sandwich'; 41 | var expected = -1891873021; 42 | t.same(crc32.signed(input), expected); 43 | t.end(); 44 | }); 45 | 46 | test('can do signed', function (t) { 47 | var input = 'bear sandwich'; 48 | var expected = 3711466352; 49 | t.same(crc32.unsigned(input), expected); 50 | t.end(); 51 | }); 52 | 53 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/commander/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/commander/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/commander/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.6.1 / 2012-06-01 3 | ================== 4 | 5 | * Added: append (yes or no) on confirmation 6 | * Added: allow node.js v0.7.x 7 | 8 | 0.6.0 / 2012-04-10 9 | ================== 10 | 11 | * Added `.prompt(obj, callback)` support. Closes #49 12 | * Added default support to .choose(). Closes #41 13 | * Fixed the choice example 14 | 15 | 0.5.1 / 2011-12-20 16 | ================== 17 | 18 | * Fixed `password()` for recent nodes. Closes #36 19 | 20 | 0.5.0 / 2011-12-04 21 | ================== 22 | 23 | * Added sub-command option support [itay] 24 | 25 | 0.4.3 / 2011-12-04 26 | ================== 27 | 28 | * Fixed custom help ordering. Closes #32 29 | 30 | 0.4.2 / 2011-11-24 31 | ================== 32 | 33 | * Added travis support 34 | * Fixed: line-buffered input automatically trimmed. Closes #31 35 | 36 | 0.4.1 / 2011-11-18 37 | ================== 38 | 39 | * Removed listening for "close" on --help 40 | 41 | 0.4.0 / 2011-11-15 42 | ================== 43 | 44 | * Added support for `--`. Closes #24 45 | 46 | 0.3.3 / 2011-11-14 47 | ================== 48 | 49 | * Fixed: wait for close event when writing help info [Jerry Hamlet] 50 | 51 | 0.3.2 / 2011-11-01 52 | ================== 53 | 54 | * Fixed long flag definitions with values [felixge] 55 | 56 | 0.3.1 / 2011-10-31 57 | ================== 58 | 59 | * Changed `--version` short flag to `-V` from `-v` 60 | * Changed `.version()` so it's configurable [felixge] 61 | 62 | 0.3.0 / 2011-10-31 63 | ================== 64 | 65 | * Added support for long flags only. Closes #18 66 | 67 | 0.2.1 / 2011-10-24 68 | ================== 69 | 70 | * "node": ">= 0.4.x < 0.7.0". Closes #20 71 | 72 | 0.2.0 / 2011-09-26 73 | ================== 74 | 75 | * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] 76 | 77 | 0.1.0 / 2011-08-24 78 | ================== 79 | 80 | * Added support for custom `--help` output 81 | 82 | 0.0.5 / 2011-08-18 83 | ================== 84 | 85 | * Changed: when the user enters nothing prompt for password again 86 | * Fixed issue with passwords beginning with numbers [NuckChorris] 87 | 88 | 0.0.4 / 2011-08-15 89 | ================== 90 | 91 | * Fixed `Commander#args` 92 | 93 | 0.0.3 / 2011-08-15 94 | ================== 95 | 96 | * Added default option value support 97 | 98 | 0.0.2 / 2011-08-15 99 | ================== 100 | 101 | * Added mask support to `Command#password(str[, mask], fn)` 102 | * Added `Command#password(str, fn)` 103 | 104 | 0.0.1 / 2010-01-03 105 | ================== 106 | 107 | * Initial release 108 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/commander/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TESTS = $(shell find test/test.*.js) 3 | 4 | test: 5 | @./test/run $(TESTS) 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/commander/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/commander'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/.npmignore: -------------------------------------------------------------------------------- 1 | *.markdown 2 | *.md 3 | .git* 4 | Makefile 5 | benchmarks/ 6 | docs/ 7 | examples/ 8 | install.sh 9 | support/ 10 | test/ 11 | .DS_Store 12 | coverage.html 13 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | - 0.9 -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2010 Sencha Inc. 4 | Copyright (c) 2011 LearnBoost 5 | Copyright (c) 2011 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. -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = process.env.CONNECT_COV 3 | ? require('./lib-cov/connect') 4 | : require('./lib/connect'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/cache.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - Cache 4 | * Copyright(c) 2011 Sencha Inc. 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Expose `Cache`. 10 | */ 11 | 12 | module.exports = Cache; 13 | 14 | /** 15 | * LRU cache store. 16 | * 17 | * @param {Number} limit 18 | * @api private 19 | */ 20 | 21 | function Cache(limit) { 22 | this.store = {}; 23 | this.keys = []; 24 | this.limit = limit; 25 | } 26 | 27 | /** 28 | * Touch `key`, promoting the object. 29 | * 30 | * @param {String} key 31 | * @param {Number} i 32 | * @api private 33 | */ 34 | 35 | Cache.prototype.touch = function(key, i){ 36 | this.keys.splice(i,1); 37 | this.keys.push(key); 38 | }; 39 | 40 | /** 41 | * Remove `key`. 42 | * 43 | * @param {String} key 44 | * @api private 45 | */ 46 | 47 | Cache.prototype.remove = function(key){ 48 | delete this.store[key]; 49 | }; 50 | 51 | /** 52 | * Get the object stored for `key`. 53 | * 54 | * @param {String} key 55 | * @return {Array} 56 | * @api private 57 | */ 58 | 59 | Cache.prototype.get = function(key){ 60 | return this.store[key]; 61 | }; 62 | 63 | /** 64 | * Add a cache `key`. 65 | * 66 | * @param {String} key 67 | * @return {Array} 68 | * @api private 69 | */ 70 | 71 | Cache.prototype.add = function(key){ 72 | // initialize store 73 | var len = this.keys.push(key); 74 | 75 | // limit reached, invalidate LRU 76 | if (len > this.limit) this.remove(this.keys.shift()); 77 | 78 | var arr = this.store[key] = []; 79 | arr.createdAt = new Date; 80 | return arr; 81 | }; 82 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/connect.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var EventEmitter = require('events').EventEmitter 14 | , proto = require('./proto') 15 | , utils = require('./utils') 16 | , path = require('path') 17 | , basename = path.basename 18 | , fs = require('fs'); 19 | 20 | // node patches 21 | 22 | require('./patch'); 23 | 24 | // expose createServer() as the module 25 | 26 | exports = module.exports = createServer; 27 | 28 | /** 29 | * Framework version. 30 | */ 31 | 32 | exports.version = '2.6.1'; 33 | 34 | /** 35 | * Expose mime module. 36 | */ 37 | 38 | exports.mime = require('./middleware/static').mime; 39 | 40 | /** 41 | * Expose the prototype. 42 | */ 43 | 44 | exports.proto = proto; 45 | 46 | /** 47 | * Auto-load middleware getters. 48 | */ 49 | 50 | exports.middleware = {}; 51 | 52 | /** 53 | * Expose utilities. 54 | */ 55 | 56 | exports.utils = utils; 57 | 58 | /** 59 | * Create a new connect server. 60 | * 61 | * @return {Function} 62 | * @api public 63 | */ 64 | 65 | function createServer() { 66 | function app(req, res){ app.handle(req, res); } 67 | utils.merge(app, proto); 68 | utils.merge(app, EventEmitter.prototype); 69 | app.route = '/'; 70 | app.stack = []; 71 | for (var i = 0; i < arguments.length; ++i) { 72 | app.use(arguments[i]); 73 | } 74 | return app; 75 | }; 76 | 77 | /** 78 | * Support old `.createServer()` method. 79 | */ 80 | 81 | createServer.createServer = createServer; 82 | 83 | /** 84 | * Auto-load bundled middleware with getters. 85 | */ 86 | 87 | fs.readdirSync(__dirname + '/middleware').forEach(function(filename){ 88 | if (!/\.js$/.test(filename)) return; 89 | var name = basename(filename, '.js'); 90 | function load(){ return require('./middleware/' + name); } 91 | exports.middleware.__defineGetter__(name, load); 92 | exports.__defineGetter__(name, load); 93 | }); 94 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Connect is a middleware framework for node, 4 | * shipping with over 18 bundled middleware and a rich selection of 5 | * 3rd-party middleware. 6 | * 7 | * var app = connect() 8 | * .use(connect.logger('dev')) 9 | * .use(connect.static('public')) 10 | * .use(function(req, res){ 11 | * res.end('hello world\n'); 12 | * }) 13 | * .listen(3000); 14 | * 15 | * Installation: 16 | * 17 | * $ npm install connect 18 | * 19 | * Middleware: 20 | * 21 | * - [logger](logger.html) request logger with custom format support 22 | * - [csrf](csrf.html) Cross-site request forgery protection 23 | * - [compress](compress.html) Gzip compression middleware 24 | * - [basicAuth](basicAuth.html) basic http authentication 25 | * - [bodyParser](bodyParser.html) extensible request body parser 26 | * - [json](json.html) application/json parser 27 | * - [urlencoded](urlencoded.html) application/x-www-form-urlencoded parser 28 | * - [multipart](multipart.html) multipart/form-data parser 29 | * - [timeout](timeout.html) request timeouts 30 | * - [cookieParser](cookieParser.html) cookie parser 31 | * - [session](session.html) session management support with bundled MemoryStore 32 | * - [cookieSession](cookieSession.html) cookie-based session support 33 | * - [methodOverride](methodOverride.html) faux HTTP method support 34 | * - [responseTime](responseTime.html) calculates response-time and exposes via X-Response-Time 35 | * - [staticCache](staticCache.html) memory cache layer for the static() middleware 36 | * - [static](static.html) streaming static file server supporting `Range` and more 37 | * - [directory](directory.html) directory listing middleware 38 | * - [vhost](vhost.html) virtual host sub-domain mapping middleware 39 | * - [favicon](favicon.html) efficient favicon server (with default icon) 40 | * - [limit](limit.html) limit the bytesize of request bodies 41 | * - [query](query.html) automatic querystring parser, populating `req.query` 42 | * - [errorHandler](errorHandler.html) flexible error handler 43 | * 44 | * Links: 45 | * 46 | * - list of [3rd-party](https://github.com/senchalabs/connect/wiki) middleware 47 | * - GitHub [repository](http://github.com/senchalabs/connect) 48 | * - [test documentation](https://github.com/senchalabs/connect/blob/gh-pages/tests.md) 49 | * 50 | */ -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/bodyParser.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - bodyParser 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var multipart = require('./multipart') 14 | , urlencoded = require('./urlencoded') 15 | , json = require('./json'); 16 | 17 | /** 18 | * Body parser: 19 | * 20 | * Parse request bodies, supports _application/json_, 21 | * _application/x-www-form-urlencoded_, and _multipart/form-data_. 22 | * 23 | * This is equivalent to: 24 | * 25 | * app.use(connect.json()); 26 | * app.use(connect.urlencoded()); 27 | * app.use(connect.multipart()); 28 | * 29 | * Examples: 30 | * 31 | * connect() 32 | * .use(connect.bodyParser()) 33 | * .use(function(req, res) { 34 | * res.end('viewing user ' + req.body.user.name); 35 | * }); 36 | * 37 | * $ curl -d 'user[name]=tj' http://local/ 38 | * $ curl -d '{"user":{"name":"tj"}}' -H "Content-Type: application/json" http://local/ 39 | * 40 | * View [json](json.html), [urlencoded](urlencoded.html), and [multipart](multipart.html) for more info. 41 | * 42 | * @param {Object} options 43 | * @return {Function} 44 | * @api public 45 | */ 46 | 47 | exports = module.exports = function bodyParser(options){ 48 | var _urlencoded = urlencoded(options) 49 | , _multipart = multipart(options) 50 | , _json = json(options); 51 | 52 | return function bodyParser(req, res, next) { 53 | _json(req, res, function(err){ 54 | if (err) return next(err); 55 | _urlencoded(req, res, function(err){ 56 | if (err) return next(err); 57 | _multipart(req, res, next); 58 | }); 59 | }); 60 | } 61 | }; -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/cookieParser.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - cookieParser 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var utils = require('./../utils') 14 | , cookie = require('cookie'); 15 | 16 | /** 17 | * Cookie parser: 18 | * 19 | * Parse _Cookie_ header and populate `req.cookies` 20 | * with an object keyed by the cookie names. Optionally 21 | * you may enabled signed cookie support by passing 22 | * a `secret` string, which assigns `req.secret` so 23 | * it may be used by other middleware. 24 | * 25 | * Examples: 26 | * 27 | * connect() 28 | * .use(connect.cookieParser('optional secret string')) 29 | * .use(function(req, res, next){ 30 | * res.end(JSON.stringify(req.cookies)); 31 | * }) 32 | * 33 | * @param {String} secret 34 | * @return {Function} 35 | * @api public 36 | */ 37 | 38 | module.exports = function cookieParser(secret){ 39 | return function cookieParser(req, res, next) { 40 | if (req.cookies) return next(); 41 | var cookies = req.headers.cookie; 42 | 43 | req.secret = secret; 44 | req.cookies = {}; 45 | req.signedCookies = {}; 46 | 47 | if (cookies) { 48 | try { 49 | req.cookies = cookie.parse(cookies); 50 | if (secret) { 51 | req.signedCookies = utils.parseSignedCookies(req.cookies, secret); 52 | req.signedCookies = utils.parseJSONCookies(req.signedCookies); 53 | } 54 | req.cookies = utils.parseJSONCookies(req.cookies); 55 | } catch (err) { 56 | err.status = 400; 57 | return next(err); 58 | } 59 | } 60 | next(); 61 | }; 62 | }; 63 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/csrf.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Connect - csrf 3 | * Copyright(c) 2011 Sencha Inc. 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * Module dependencies. 9 | */ 10 | 11 | var utils = require('../utils'); 12 | 13 | /** 14 | * Anti CSRF: 15 | * 16 | * CRSF protection middleware. 17 | * 18 | * By default this middleware generates a token named "_csrf" 19 | * which should be added to requests which mutate 20 | * state, within a hidden form field, query-string etc. This 21 | * token is validated against the visitor's `req.session._csrf` 22 | * property. 23 | * 24 | * The default `value` function checks `req.body` generated 25 | * by the `bodyParser()` middleware, `req.query` generated 26 | * by `query()`, and the "X-CSRF-Token" header field. 27 | * 28 | * This middleware requires session support, thus should be added 29 | * somewhere _below_ `session()` and `cookieParser()`. 30 | * 31 | * Options: 32 | * 33 | * - `value` a function accepting the request, returning the token 34 | * 35 | * @param {Object} options 36 | * @api public 37 | */ 38 | 39 | module.exports = function csrf(options) { 40 | options = options || {}; 41 | var value = options.value || defaultValue; 42 | 43 | return function(req, res, next){ 44 | // generate CSRF token 45 | var token = req.session._csrf || (req.session._csrf = utils.uid(24)); 46 | 47 | // ignore these methods 48 | if ('GET' == req.method || 'HEAD' == req.method || 'OPTIONS' == req.method) return next(); 49 | 50 | // determine value 51 | var val = value(req); 52 | 53 | // check 54 | if (val != token) return next(utils.error(403)); 55 | 56 | next(); 57 | } 58 | }; 59 | 60 | /** 61 | * Default value function, checking the `req.body` 62 | * and `req.query` for the CSRF token. 63 | * 64 | * @param {IncomingMessage} req 65 | * @return {String} 66 | * @api private 67 | */ 68 | 69 | function defaultValue(req) { 70 | return (req.body && req.body._csrf) 71 | || (req.query && req.query._csrf) 72 | || (req.headers['x-csrf-token']); 73 | } 74 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/errorHandler.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Connect - errorHandler 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 utils = require('../utils') 13 | , fs = require('fs'); 14 | 15 | // environment 16 | 17 | var env = process.env.NODE_ENV || 'development'; 18 | 19 | /** 20 | * Error handler: 21 | * 22 | * Development error handler, providing stack traces 23 | * and error message responses for requests accepting text, html, 24 | * or json. 25 | * 26 | * Text: 27 | * 28 | * By default, and when _text/plain_ is accepted a simple stack trace 29 | * or error message will be returned. 30 | * 31 | * JSON: 32 | * 33 | * When _application/json_ is accepted, connect will respond with 34 | * an object in the form of `{ "error": error }`. 35 | * 36 | * HTML: 37 | * 38 | * When accepted connect will output a nice html stack trace. 39 | * 40 | * @return {Function} 41 | * @api public 42 | */ 43 | 44 | exports = module.exports = function errorHandler(){ 45 | return function errorHandler(err, req, res, next){ 46 | if (err.status) res.statusCode = err.status; 47 | if (res.statusCode < 400) res.statusCode = 500; 48 | if ('test' != env) console.error(err.stack); 49 | var accept = req.headers.accept || ''; 50 | // html 51 | if (~accept.indexOf('html')) { 52 | fs.readFile(__dirname + '/../public/style.css', 'utf8', function(e, style){ 53 | fs.readFile(__dirname + '/../public/error.html', 'utf8', function(e, html){ 54 | var stack = (err.stack || '') 55 | .split('\n').slice(1) 56 | .map(function(v){ return '
  • ' + v + '
  • '; }).join(''); 57 | html = html 58 | .replace('{style}', style) 59 | .replace('{stack}', stack) 60 | .replace('{title}', exports.title) 61 | .replace('{statusCode}', res.statusCode) 62 | .replace(/\{error\}/g, utils.escape(err.toString())); 63 | res.setHeader('Content-Type', 'text/html; charset=utf-8'); 64 | res.end(html); 65 | }); 66 | }); 67 | // json 68 | } else if (~accept.indexOf('json')) { 69 | var error = { message: err.message, stack: err.stack }; 70 | for (var prop in err) error[prop] = err[prop]; 71 | var json = JSON.stringify({ error: error }); 72 | res.setHeader('Content-Type', 'application/json'); 73 | res.end(json); 74 | // plain text 75 | } else { 76 | res.writeHead(res.statusCode, { 'Content-Type': 'text/plain' }); 77 | res.end(err.stack); 78 | } 79 | }; 80 | }; 81 | 82 | /** 83 | * Template title, framework authors may override this value. 84 | */ 85 | 86 | exports.title = 'Connect'; 87 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/favicon.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - favicon 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var fs = require('fs') 14 | , utils = require('../utils'); 15 | 16 | /** 17 | * Favicon: 18 | * 19 | * By default serves the connect favicon, or the favicon 20 | * located by the given `path`. 21 | * 22 | * Options: 23 | * 24 | * - `maxAge` cache-control max-age directive, defaulting to 1 day 25 | * 26 | * Examples: 27 | * 28 | * Serve default favicon: 29 | * 30 | * connect() 31 | * .use(connect.favicon()) 32 | * 33 | * Serve favicon before logging for brevity: 34 | * 35 | * connect() 36 | * .use(connect.favicon()) 37 | * .use(connect.logger('dev')) 38 | * 39 | * Serve custom favicon: 40 | * 41 | * connect() 42 | * .use(connect.favicon('public/favicon.ico)) 43 | * 44 | * @param {String} path 45 | * @param {Object} options 46 | * @return {Function} 47 | * @api public 48 | */ 49 | 50 | module.exports = function favicon(path, options){ 51 | var options = options || {} 52 | , path = path || __dirname + '/../public/favicon.ico' 53 | , maxAge = options.maxAge || 86400000 54 | , icon; // favicon cache 55 | 56 | return function favicon(req, res, next){ 57 | if ('/favicon.ico' == req.url) { 58 | if (icon) { 59 | res.writeHead(200, icon.headers); 60 | res.end(icon.body); 61 | } else { 62 | fs.readFile(path, function(err, buf){ 63 | if (err) return next(err); 64 | icon = { 65 | headers: { 66 | 'Content-Type': 'image/x-icon' 67 | , 'Content-Length': buf.length 68 | , 'ETag': '"' + utils.md5(buf) + '"' 69 | , 'Cache-Control': 'public, max-age=' + (maxAge / 1000) 70 | }, 71 | body: buf 72 | }; 73 | res.writeHead(200, icon.headers); 74 | res.end(icon.body); 75 | }); 76 | } 77 | } else { 78 | next(); 79 | } 80 | }; 81 | }; 82 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/json.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - json 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var utils = require('../utils') 14 | , _limit = require('./limit'); 15 | 16 | /** 17 | * noop middleware. 18 | */ 19 | 20 | function noop(req, res, next) { 21 | next(); 22 | } 23 | 24 | /** 25 | * JSON: 26 | * 27 | * Parse JSON request bodies, providing the 28 | * parsed object as `req.body`. 29 | * 30 | * Options: 31 | * 32 | * - `strict` when `false` anything `JSON.parse()` accepts will be parsed 33 | * - `reviver` used as the second "reviver" argument for JSON.parse 34 | * - `limit` byte limit disabled by default 35 | * 36 | * @param {Object} options 37 | * @return {Function} 38 | * @api public 39 | */ 40 | 41 | exports = module.exports = function(options){ 42 | var options = options || {} 43 | , strict = options.strict !== false; 44 | 45 | var limit = options.limit 46 | ? _limit(options.limit) 47 | : noop; 48 | 49 | return function json(req, res, next) { 50 | if (req._body) return next(); 51 | req.body = req.body || {}; 52 | 53 | if (!utils.hasBody(req)) return next(); 54 | 55 | // check Content-Type 56 | if ('application/json' != utils.mime(req)) return next(); 57 | 58 | // flag as parsed 59 | req._body = true; 60 | 61 | // parse 62 | limit(req, res, function(err){ 63 | if (err) return next(err); 64 | var buf = ''; 65 | req.setEncoding('utf8'); 66 | req.on('data', function(chunk){ buf += chunk }); 67 | req.on('end', function(){ 68 | var first = buf.trim()[0]; 69 | if (strict && '{' != first && '[' != first) return next(utils.error(400, 'invalid json')); 70 | try { 71 | req.body = JSON.parse(buf, options.reviver); 72 | next(); 73 | } catch (err){ 74 | err.body = buf; 75 | err.status = 400; 76 | next(err); 77 | } 78 | }); 79 | }); 80 | } 81 | }; 82 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/limit.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - limit 4 | * Copyright(c) 2011 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var utils = require('../utils'); 13 | 14 | /** 15 | * Limit: 16 | * 17 | * Limit request bodies to the given size in `bytes`. 18 | * 19 | * A string representation of the bytesize may also be passed, 20 | * for example "5mb", "200kb", "1gb", etc. 21 | * 22 | * connect() 23 | * .use(connect.limit('5.5mb')) 24 | * .use(handleImageUpload) 25 | * 26 | * @param {Number|String} bytes 27 | * @return {Function} 28 | * @api public 29 | */ 30 | 31 | module.exports = function limit(bytes){ 32 | if ('string' == typeof bytes) bytes = utils.parseBytes(bytes); 33 | if ('number' != typeof bytes) throw new Error('limit() bytes required'); 34 | return function limit(req, res, next){ 35 | var received = 0 36 | , len = req.headers['content-length'] 37 | ? parseInt(req.headers['content-length'], 10) 38 | : null; 39 | 40 | // self-awareness 41 | if (req._limit) return next(); 42 | req._limit = true; 43 | 44 | // limit by content-length 45 | if (len && len > bytes) return next(utils.error(413)); 46 | 47 | // limit 48 | req.on('data', function(chunk){ 49 | received += chunk.length; 50 | if (received > bytes) req.destroy(); 51 | }); 52 | 53 | next(); 54 | }; 55 | }; 56 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/methodOverride.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - methodOverride 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Method Override: 11 | * 12 | * Provides faux HTTP method support. 13 | * 14 | * Pass an optional `key` to use when checking for 15 | * a method override, othewise defaults to _\_method_. 16 | * The original method is available via `req.originalMethod`. 17 | * 18 | * @param {String} key 19 | * @return {Function} 20 | * @api public 21 | */ 22 | 23 | module.exports = function methodOverride(key){ 24 | key = key || "_method"; 25 | return function methodOverride(req, res, next) { 26 | req.originalMethod = req.originalMethod || req.method; 27 | 28 | // req.body 29 | if (req.body && key in req.body) { 30 | req.method = req.body[key].toUpperCase(); 31 | delete req.body[key]; 32 | // check X-HTTP-Method-Override 33 | } else if (req.headers['x-http-method-override']) { 34 | req.method = req.headers['x-http-method-override'].toUpperCase(); 35 | } 36 | 37 | next(); 38 | }; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/query.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Connect - query 3 | * Copyright(c) 2011 TJ Holowaychuk 4 | * Copyright(c) 2011 Sencha Inc. 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var qs = require('qs') 13 | , parse = require('../utils').parseUrl; 14 | 15 | /** 16 | * Query: 17 | * 18 | * Automatically parse the query-string when available, 19 | * populating the `req.query` object. 20 | * 21 | * Examples: 22 | * 23 | * connect() 24 | * .use(connect.query()) 25 | * .use(function(req, res){ 26 | * res.end(JSON.stringify(req.query)); 27 | * }); 28 | * 29 | * The `options` passed are provided to qs.parse function. 30 | * 31 | * @param {Object} options 32 | * @return {Function} 33 | * @api public 34 | */ 35 | 36 | module.exports = function query(options){ 37 | return function query(req, res, next){ 38 | if (!req.query) { 39 | req.query = ~req.url.indexOf('?') 40 | ? qs.parse(parse(req).query, options) 41 | : {}; 42 | } 43 | 44 | next(); 45 | }; 46 | }; 47 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/responseTime.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - responseTime 4 | * Copyright(c) 2011 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Reponse time: 10 | * 11 | * Adds the `X-Response-Time` header displaying the response 12 | * duration in milliseconds. 13 | * 14 | * @return {Function} 15 | * @api public 16 | */ 17 | 18 | module.exports = function responseTime(){ 19 | return function(req, res, next){ 20 | var start = new Date; 21 | 22 | if (res._responseTime) return next(); 23 | res._responseTime = true; 24 | 25 | res.on('header', function(){ 26 | var duration = new Date - start; 27 | res.setHeader('X-Response-Time', duration + 'ms'); 28 | }); 29 | 30 | next(); 31 | }; 32 | }; 33 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/session/cookie.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - session - Cookie 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var utils = require('../../utils') 14 | , cookie = require('cookie'); 15 | 16 | /** 17 | * Initialize a new `Cookie` with the given `options`. 18 | * 19 | * @param {IncomingMessage} req 20 | * @param {Object} options 21 | * @api private 22 | */ 23 | 24 | var Cookie = module.exports = function Cookie(options) { 25 | this.path = '/'; 26 | this.maxAge = null; 27 | this.httpOnly = true; 28 | if (options) utils.merge(this, options); 29 | this.originalMaxAge = undefined == this.originalMaxAge 30 | ? this.maxAge 31 | : this.originalMaxAge; 32 | }; 33 | 34 | /*! 35 | * Prototype. 36 | */ 37 | 38 | Cookie.prototype = { 39 | 40 | /** 41 | * Set expires `date`. 42 | * 43 | * @param {Date} date 44 | * @api public 45 | */ 46 | 47 | set expires(date) { 48 | this._expires = date; 49 | this.originalMaxAge = this.maxAge; 50 | }, 51 | 52 | /** 53 | * Get expires `date`. 54 | * 55 | * @return {Date} 56 | * @api public 57 | */ 58 | 59 | get expires() { 60 | return this._expires; 61 | }, 62 | 63 | /** 64 | * Set expires via max-age in `ms`. 65 | * 66 | * @param {Number} ms 67 | * @api public 68 | */ 69 | 70 | set maxAge(ms) { 71 | this.expires = 'number' == typeof ms 72 | ? new Date(Date.now() + ms) 73 | : ms; 74 | }, 75 | 76 | /** 77 | * Get expires max-age in `ms`. 78 | * 79 | * @return {Number} 80 | * @api public 81 | */ 82 | 83 | get maxAge() { 84 | return this.expires instanceof Date 85 | ? this.expires.valueOf() - Date.now() 86 | : this.expires; 87 | }, 88 | 89 | /** 90 | * Return cookie data object. 91 | * 92 | * @return {Object} 93 | * @api private 94 | */ 95 | 96 | get data() { 97 | return { 98 | originalMaxAge: this.originalMaxAge 99 | , expires: this._expires 100 | , secure: this.secure 101 | , httpOnly: this.httpOnly 102 | , domain: this.domain 103 | , path: this.path 104 | } 105 | }, 106 | 107 | /** 108 | * Return a serialized cookie string. 109 | * 110 | * @return {String} 111 | * @api public 112 | */ 113 | 114 | serialize: function(name, val){ 115 | return cookie.serialize(name, val, this.data); 116 | }, 117 | 118 | /** 119 | * Return JSON representation of this cookie. 120 | * 121 | * @return {Object} 122 | * @api private 123 | */ 124 | 125 | toJSON: function(){ 126 | return this.data; 127 | } 128 | }; 129 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/session/store.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - session - Store 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var EventEmitter = require('events').EventEmitter 14 | , Session = require('./session') 15 | , Cookie = require('./cookie'); 16 | 17 | /** 18 | * Initialize abstract `Store`. 19 | * 20 | * @api private 21 | */ 22 | 23 | var Store = module.exports = function Store(options){}; 24 | 25 | /** 26 | * Inherit from `EventEmitter.prototype`. 27 | */ 28 | 29 | Store.prototype.__proto__ = EventEmitter.prototype; 30 | 31 | /** 32 | * Re-generate the given requests's session. 33 | * 34 | * @param {IncomingRequest} req 35 | * @return {Function} fn 36 | * @api public 37 | */ 38 | 39 | Store.prototype.regenerate = function(req, fn){ 40 | var self = this; 41 | this.destroy(req.sessionID, function(err){ 42 | self.generate(req); 43 | fn(err); 44 | }); 45 | }; 46 | 47 | /** 48 | * Load a `Session` instance via the given `sid` 49 | * and invoke the callback `fn(err, sess)`. 50 | * 51 | * @param {String} sid 52 | * @param {Function} fn 53 | * @api public 54 | */ 55 | 56 | Store.prototype.load = function(sid, fn){ 57 | var self = this; 58 | this.get(sid, function(err, sess){ 59 | if (err) return fn(err); 60 | if (!sess) return fn(); 61 | var req = { sessionID: sid, sessionStore: self }; 62 | sess = self.createSession(req, sess); 63 | fn(null, sess); 64 | }); 65 | }; 66 | 67 | /** 68 | * Create session from JSON `sess` data. 69 | * 70 | * @param {IncomingRequest} req 71 | * @param {Object} sess 72 | * @return {Session} 73 | * @api private 74 | */ 75 | 76 | Store.prototype.createSession = function(req, sess){ 77 | var expires = sess.cookie.expires 78 | , orig = sess.cookie.originalMaxAge; 79 | sess.cookie = new Cookie(sess.cookie); 80 | if ('string' == typeof expires) sess.cookie.expires = new Date(expires); 81 | sess.cookie.originalMaxAge = orig; 82 | req.session = new Session(req, sess); 83 | return req.session; 84 | }; 85 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/static.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - static 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var send = require('send') 14 | , utils = require('../utils') 15 | , parse = utils.parseUrl 16 | , url = require('url'); 17 | 18 | /** 19 | * Static: 20 | * 21 | * Static file server with the given `root` path. 22 | * 23 | * Examples: 24 | * 25 | * var oneDay = 86400000; 26 | * 27 | * connect() 28 | * .use(connect.static(__dirname + '/public')) 29 | * 30 | * connect() 31 | * .use(connect.static(__dirname + '/public', { maxAge: oneDay })) 32 | * 33 | * Options: 34 | * 35 | * - `maxAge` Browser cache maxAge in milliseconds. defaults to 0 36 | * - `hidden` Allow transfer of hidden files. defaults to false 37 | * - `redirect` Redirect to trailing "/" when the pathname is a dir. defaults to true 38 | * 39 | * @param {String} root 40 | * @param {Object} options 41 | * @return {Function} 42 | * @api public 43 | */ 44 | 45 | exports = module.exports = function static(root, options){ 46 | options = options || {}; 47 | 48 | // root required 49 | if (!root) throw new Error('static() root path required'); 50 | 51 | // default redirect 52 | var redirect = false !== options.redirect; 53 | 54 | return function static(req, res, next) { 55 | if ('GET' != req.method && 'HEAD' != req.method) return next(); 56 | var path = parse(req).pathname; 57 | var pause = utils.pause(req); 58 | 59 | function resume() { 60 | next(); 61 | pause.resume(); 62 | } 63 | 64 | function directory() { 65 | if (!redirect) return resume(); 66 | var pathname = url.parse(req.originalUrl).pathname; 67 | res.statusCode = 301; 68 | res.setHeader('Location', pathname + '/'); 69 | res.end('Redirecting to ' + utils.escape(pathname) + '/'); 70 | } 71 | 72 | function error(err) { 73 | if (404 == err.status) return resume(); 74 | next(err); 75 | } 76 | 77 | send(req, path) 78 | .maxage(options.maxAge || 0) 79 | .root(root) 80 | .hidden(options.hidden) 81 | .on('error', error) 82 | .on('directory', directory) 83 | .pipe(res); 84 | }; 85 | }; 86 | 87 | /** 88 | * Expose mime module. 89 | * 90 | * If you wish to extend the mime table use this 91 | * reference to the "mime" module in the npm registry. 92 | */ 93 | 94 | exports.mime = send.mime; 95 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/timeout.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - timeout 4 | * Ported from https://github.com/LearnBoost/connect-timeout 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var debug = require('debug')('connect:timeout'); 13 | 14 | /** 15 | * Timeout: 16 | * 17 | * Times out the request in `ms`, defaulting to `5000`. The 18 | * method `req.clearTimeout()` is added to revert this behaviour 19 | * programmatically within your application's middleware, routes, etc. 20 | * 21 | * The timeout error is passed to `next()` so that you may customize 22 | * the response behaviour. This error has the `.timeout` property as 23 | * well as `.status == 408`. 24 | * 25 | * @param {Number} ms 26 | * @return {Function} 27 | * @api public 28 | */ 29 | 30 | module.exports = function timeout(ms) { 31 | ms = ms || 5000; 32 | 33 | return function(req, res, next) { 34 | var id = setTimeout(function(){ 35 | req.emit('timeout', ms); 36 | }, ms); 37 | 38 | req.on('timeout', function(){ 39 | if (req.headerSent) return debug('response started, cannot timeout'); 40 | var err = new Error('Request timeout'); 41 | err.timeout = ms; 42 | err.status = 408; 43 | next(err); 44 | }); 45 | 46 | req.clearTimeout = function(){ 47 | clearTimeout(id); 48 | }; 49 | 50 | res.on('header', function(){ 51 | clearTimeout(id); 52 | }); 53 | 54 | next(); 55 | }; 56 | }; -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/urlencoded.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - urlencoded 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var utils = require('../utils') 14 | , _limit = require('./limit') 15 | , qs = require('qs'); 16 | 17 | /** 18 | * noop middleware. 19 | */ 20 | 21 | function noop(req, res, next) { 22 | next(); 23 | } 24 | 25 | /** 26 | * Urlencoded: 27 | * 28 | * Parse x-ww-form-urlencoded request bodies, 29 | * providing the parsed object as `req.body`. 30 | * 31 | * Options: 32 | * 33 | * - `limit` byte limit disabled by default 34 | * 35 | * @param {Object} options 36 | * @return {Function} 37 | * @api public 38 | */ 39 | 40 | exports = module.exports = function(options){ 41 | options = options || {}; 42 | 43 | var limit = options.limit 44 | ? _limit(options.limit) 45 | : noop; 46 | 47 | return function urlencoded(req, res, next) { 48 | if (req._body) return next(); 49 | req.body = req.body || {}; 50 | 51 | if (!utils.hasBody(req)) return next(); 52 | 53 | // check Content-Type 54 | if ('application/x-www-form-urlencoded' != utils.mime(req)) return next(); 55 | 56 | // flag as parsed 57 | req._body = true; 58 | 59 | // parse 60 | limit(req, res, function(err){ 61 | if (err) return next(err); 62 | var buf = ''; 63 | req.setEncoding('utf8'); 64 | req.on('data', function(chunk){ buf += chunk }); 65 | req.on('end', function(){ 66 | try { 67 | req.body = buf.length 68 | ? qs.parse(buf, options) 69 | : {}; 70 | next(); 71 | } catch (err){ 72 | err.body = buf; 73 | next(err); 74 | } 75 | }); 76 | }); 77 | } 78 | }; 79 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/middleware/vhost.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - vhost 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Vhost: 11 | * 12 | * Setup vhost for the given `hostname` and `server`. 13 | * 14 | * connect() 15 | * .use(connect.vhost('foo.com', fooApp)) 16 | * .use(connect.vhost('bar.com', barApp)) 17 | * .use(connect.vhost('*.com', mainApp)) 18 | * 19 | * The `server` may be a Connect server or 20 | * a regular Node `http.Server`. 21 | * 22 | * @param {String} hostname 23 | * @param {Server} server 24 | * @return {Function} 25 | * @api public 26 | */ 27 | 28 | module.exports = function vhost(hostname, server){ 29 | if (!hostname) throw new Error('vhost hostname required'); 30 | if (!server) throw new Error('vhost server required'); 31 | var regexp = new RegExp('^' + hostname.replace(/[*]/g, '(.*?)') + '$', 'i'); 32 | if (server.onvhost) server.onvhost(hostname); 33 | return function vhost(req, res, next){ 34 | if (!req.headers.host) return next(); 35 | var host = req.headers.host.split(':')[0]; 36 | if (!regexp.test(host)) return next(); 37 | if ('function' == typeof server) return server(req, res, next); 38 | server.emit('request', req, res); 39 | }; 40 | }; 41 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/patch.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect 4 | * Copyright(c) 2011 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var http = require('http') 13 | , res = http.ServerResponse.prototype 14 | , setHeader = res.setHeader 15 | , _renderHeaders = res._renderHeaders 16 | , writeHead = res.writeHead; 17 | 18 | // apply only once 19 | 20 | if (!res._hasConnectPatch) { 21 | 22 | /** 23 | * Provide a public "header sent" flag 24 | * until node does. 25 | * 26 | * @return {Boolean} 27 | * @api public 28 | */ 29 | 30 | res.__defineGetter__('headerSent', function(){ 31 | return this._header; 32 | }); 33 | 34 | /** 35 | * Set header `field` to `val`, special-casing 36 | * the `Set-Cookie` field for multiple support. 37 | * 38 | * @param {String} field 39 | * @param {String} val 40 | * @api public 41 | */ 42 | 43 | res.setHeader = function(field, val){ 44 | var key = field.toLowerCase() 45 | , prev; 46 | 47 | // special-case Set-Cookie 48 | if (this._headers && 'set-cookie' == key) { 49 | if (prev = this.getHeader(field)) { 50 | val = Array.isArray(prev) 51 | ? prev.concat(val) 52 | : [prev, val]; 53 | } 54 | // charset 55 | } else if ('content-type' == key && this.charset) { 56 | val += '; charset=' + this.charset; 57 | } 58 | 59 | return setHeader.call(this, field, val); 60 | }; 61 | 62 | /** 63 | * Proxy to emit "header" event. 64 | */ 65 | 66 | res._renderHeaders = function(){ 67 | if (!this._emittedHeader) this.emit('header'); 68 | this._emittedHeader = true; 69 | return _renderHeaders.call(this); 70 | }; 71 | 72 | res.writeHead = function(){ 73 | if (!this._emittedHeader) this.emit('header'); 74 | this._emittedHeader = true; 75 | return writeHead.apply(this, arguments); 76 | }; 77 | 78 | res._hasConnectPatch = true; 79 | } 80 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/directory.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | listing directory {directory} 4 | 5 | 67 | 68 | 69 | 70 |
    71 |

    {linked-path}

    72 | {files} 73 |
    74 | 75 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {error} 4 | 5 | 6 | 7 |
    8 |

    {title}

    9 |

    {statusCode} {error}

    10 |
      {stack}
    11 |
    12 | 13 | 14 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/favicon.ico -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_add.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_attach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_code.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_delete.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_edit.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_error.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_find.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_gear.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_go.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_green.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_key.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_link.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_red.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_save.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_add.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_c.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_camera.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_cd.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_compressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_compressed.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_cplusplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_cplusplus.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_csharp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_csharp.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_cup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_cup.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_database.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_delete.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_dvd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_dvd.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_error.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_flash.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_go.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_h.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_horizontal.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_lightning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_lightning.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_medal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_medal.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_paintbrush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_paintbrush.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_paste.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_php.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_php.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_put.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_put.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_text.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_text_width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_text_width.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_tux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_tux.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_vector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_vector.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_visualstudio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_visualstudio.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_word.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/lib/public/icons/page_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/lib/public/icons/page_world.png -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/bytes/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/bytes/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.1.0 / 2012-07-04 3 | ================== 4 | 5 | * add bytes to string conversion [yields] 6 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/bytes/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --reporter spec \ 5 | --require should 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/bytes/Readme.md: -------------------------------------------------------------------------------- 1 | # node-bytes 2 | 3 | Byte string parser / formatter. 4 | 5 | ## Example: 6 | 7 | ```js 8 | bytes('1kb') 9 | // => 1024 10 | 11 | bytes('2mb') 12 | // => 2097152 13 | 14 | bytes('1gb') 15 | // => 1073741824 16 | 17 | bytes(1073741824) 18 | // => 1gb 19 | ``` 20 | 21 | ## Installation 22 | 23 | ``` 24 | $ npm install bytes 25 | $ component install visionmedia/bytes.js 26 | ``` 27 | 28 | ## License 29 | 30 | (The MIT License) 31 | 32 | Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> 33 | 34 | Permission is hereby granted, free of charge, to any person obtaining 35 | a copy of this software and associated documentation files (the 36 | 'Software'), to deal in the Software without restriction, including 37 | without limitation the rights to use, copy, modify, merge, publish, 38 | distribute, sublicense, and/or sell copies of the Software, and to 39 | permit persons to whom the Software is furnished to do so, subject to 40 | the following conditions: 41 | 42 | The above copyright notice and this permission notice shall be 43 | included in all copies or substantial portions of the Software. 44 | 45 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 46 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 47 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 48 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 49 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 50 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 51 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 52 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/bytes/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "description": "byte size string parser / serializer", 4 | "keywords": ["bytes", "utility"], 5 | "version": "0.1.0", 6 | "scripts": ["index.js"] 7 | } 8 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/bytes/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Parse byte `size` string. 4 | * 5 | * @param {String} size 6 | * @return {Number} 7 | * @api public 8 | */ 9 | 10 | module.exports = function(size) { 11 | if ('number' == typeof size) return convert(size); 12 | var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb)$/) 13 | , n = parseFloat(parts[1]) 14 | , type = parts[2]; 15 | 16 | var map = { 17 | kb: 1 << 10 18 | , mb: 1 << 20 19 | , gb: 1 << 30 20 | }; 21 | 22 | return map[type] * n; 23 | }; 24 | 25 | /** 26 | * convert bytes into string. 27 | * 28 | * @param {Number} b - bytes to convert 29 | * @return {String}i 30 | * @api public 31 | */ 32 | 33 | function convert (b) { 34 | var gb = 1 << 30, mb = 1 << 20, kb = 1 << 10; 35 | if (b >= gb) return (Math.round(b / gb * 100) / 100) + 'gb'; 36 | if (b >= mb) return (Math.round(b / mb * 100) / 100) + 'mb'; 37 | if (b >= kb) return (Math.round(b / kb * 100) / 100) + 'kb'; 38 | return b; 39 | } -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/bytes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "author": { 4 | "name": "TJ Holowaychuk", 5 | "email": "tj@vision-media.ca", 6 | "url": "http://tjholowaychuk.com" 7 | }, 8 | "description": "byte size string parser / serializer", 9 | "version": "0.1.0", 10 | "main": "index.js", 11 | "dependencies": {}, 12 | "devDependencies": { 13 | "mocha": "*", 14 | "should": "*" 15 | }, 16 | "component": { 17 | "scripts": { 18 | "bytes": "index.js" 19 | } 20 | }, 21 | "readme": "# node-bytes\n\n Byte string parser / formatter.\n\n## Example:\n\n```js\nbytes('1kb')\n// => 1024\n\nbytes('2mb')\n// => 2097152\n\nbytes('1gb')\n// => 1073741824\n\nbytes(1073741824)\n// => 1gb\n```\n\n## Installation\n\n```\n$ npm install bytes\n$ component install visionmedia/bytes.js\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 22 | "readmeFilename": "Readme.md", 23 | "_id": "bytes@0.1.0", 24 | "dist": { 25 | "shasum": "c574812228126d6369d1576925a8579db3f8e5a2" 26 | }, 27 | "_from": "bytes@0.1.0" 28 | } 29 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/crc/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tests/nodeunit"] 2 | path = tests/nodeunit 3 | url = git://github.com/caolan/nodeunit.git 4 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/crc/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/crc/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --require should \ 5 | --reporter spec 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/crc/README.md: -------------------------------------------------------------------------------- 1 | # JavaScript CRC 8, 16 and 32. 2 | 3 | This is a basic port/copy of the JavaScript CRC implementation. The module works with any CommonJS system supporting `module.exports` notation as well as in the browser. When loaded in the browser, all functions end up under the `window.crc` "namespace". 4 | 5 | Original code is taken from http://www.digsys.se/JavaScript/CRC.aspx 6 | 7 | ## Functions 8 | 9 | The following functions are implemented: 10 | 11 | crc8(String) #=> Number 12 | crcArc(String) #=> Number 13 | crc16(String) #=> Number 14 | fcs16(String) #=> Number 15 | crc32(String) #=> Number 16 | hex8(Number) #=> String 17 | hex16(Number) #=> String 18 | hex32(Number) #=> String 19 | 20 | ## Installation 21 | 22 | git clone git://github.com/alexgorbatchev/node-crc.git 23 | 24 | or 25 | 26 | npm install crc 27 | 28 | ## Running tests 29 | 30 | $ npm install 31 | $ make test -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/crc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "crc", 3 | "version": "0.2.0", 4 | "description": "CRC JavaScript implementation", 5 | "author": { 6 | "name": "Alex Gorbatchev", 7 | "email": "alex.gorbatchev@gmail.com" 8 | }, 9 | "contributors": [], 10 | "main": "./lib/crc.js", 11 | "scripts": {}, 12 | "directories": {}, 13 | "devDependencies": { 14 | "mocha": "*", 15 | "should": "*" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/alexgorbatchev/node-crc.git" 20 | }, 21 | "readme": "# JavaScript CRC 8, 16 and 32.\n\nThis is a basic port/copy of the JavaScript CRC implementation. The module works with any CommonJS system supporting `module.exports` notation as well as in the browser. When loaded in the browser, all functions end up under the `window.crc` \"namespace\".\n\nOriginal code is taken from http://www.digsys.se/JavaScript/CRC.aspx \n\n## Functions\n\nThe following functions are implemented:\n\n crc8(String)\t#=> Number\n crcArc(String)\t#=> Number\n crc16(String)\t#=> Number\n fcs16(String)\t#=> Number\n crc32(String)\t#=> Number\n hex8(Number)\t#=> String\n hex16(Number)\t#=> String\n hex32(Number)\t#=> String\n\n## Installation\n\n\tgit clone git://github.com/alexgorbatchev/node-crc.git\n\nor\n\n npm install crc\n\n## Running tests\n\n $ npm install\n $ make test", 22 | "readmeFilename": "README.md", 23 | "_id": "crc@0.2.0", 24 | "dist": { 25 | "shasum": "98a197fcb0bf58e355eb769fca106ae9b4f3b827" 26 | }, 27 | "_from": "crc@0.2.0" 28 | } 29 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/crc/test/crc.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ./nodeunit/bin/nodeunit 2 | 3 | var crc = require('../lib/crc'); 4 | 5 | describe('crc8()', function(){ 6 | it('should work with strings', function(){ 7 | crc.crc8('hello world').should.equal(64); 8 | }) 9 | 10 | it('should work with Buffers', function(){ 11 | crc.buffer.crc8(new Buffer('hello world')).should.equal(64); 12 | }) 13 | }) 14 | 15 | describe('crc16()', function(){ 16 | it('should work with strings', function(){ 17 | crc.crc16('hello world').should.equal(15332); 18 | }) 19 | 20 | it('should work with Buffers', function(){ 21 | crc.buffer.crc16(new Buffer('hello world')).should.equal(15332); 22 | }) 23 | }) 24 | 25 | describe('crc32()', function(){ 26 | it('should work with strings', function(){ 27 | crc.crc32('hello world').should.equal(222957957); 28 | }) 29 | 30 | it('should work with Buffers', function(){ 31 | crc.buffer.crc32(new Buffer('hello world')).should.equal(222957957); 32 | }) 33 | }) 34 | 35 | describe('crcArc()', function(){ 36 | it('should work with strings', function(){ 37 | crc.crcArc('hello world').should.equal(14785); 38 | }) 39 | }) 40 | 41 | describe('fcs16()', function(){ 42 | it('should work with strings', function(){ 43 | crc.fcs16('hello world').should.equal(44550); 44 | }) 45 | }) 46 | 47 | describe('hex8()', function(){ 48 | it('should work with strings', function(){ 49 | crc.hex8(64).should.equal('40'); 50 | }) 51 | }) 52 | 53 | describe('hex16()', function(){ 54 | it('should work with strings', function(){ 55 | crc.hex16(15332).should.equal('3BE4'); 56 | }) 57 | }) 58 | 59 | describe('hex32()', function(){ 60 | it('should work with strings', function(){ 61 | crc.hex32(222957957).should.equal('0D4A1185'); 62 | }) 63 | }) 64 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/.npmignore: -------------------------------------------------------------------------------- 1 | /test/tmp/ 2 | *.upload 3 | *.un~ 4 | *.http 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | test: 4 | @./test/run.js 5 | 6 | build: npm test 7 | 8 | npm: 9 | npm install . 10 | 11 | clean: 12 | rm test/tmp/* 13 | 14 | .PHONY: test clean build 15 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/TODO: -------------------------------------------------------------------------------- 1 | - Better bufferMaxSize handling approach 2 | - Add tests for JSON parser pull request and merge it 3 | - Implement QuerystringParser the same way as MultipartParser 4 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js: -------------------------------------------------------------------------------- 1 | require('../test/common'); 2 | var multipartParser = require('../lib/multipart_parser'), 3 | MultipartParser = multipartParser.MultipartParser, 4 | parser = new MultipartParser(), 5 | Buffer = require('buffer').Buffer, 6 | boundary = '-----------------------------168072824752491622650073', 7 | mb = 100, 8 | buffer = createMultipartBuffer(boundary, mb * 1024 * 1024), 9 | callbacks = 10 | { partBegin: -1, 11 | partEnd: -1, 12 | headerField: -1, 13 | headerValue: -1, 14 | partData: -1, 15 | end: -1, 16 | }; 17 | 18 | 19 | parser.initWithBoundary(boundary); 20 | parser.onHeaderField = function() { 21 | callbacks.headerField++; 22 | }; 23 | 24 | parser.onHeaderValue = function() { 25 | callbacks.headerValue++; 26 | }; 27 | 28 | parser.onPartBegin = function() { 29 | callbacks.partBegin++; 30 | }; 31 | 32 | parser.onPartData = function() { 33 | callbacks.partData++; 34 | }; 35 | 36 | parser.onPartEnd = function() { 37 | callbacks.partEnd++; 38 | }; 39 | 40 | parser.onEnd = function() { 41 | callbacks.end++; 42 | }; 43 | 44 | var start = +new Date(), 45 | nparsed = parser.write(buffer), 46 | duration = +new Date - start, 47 | mbPerSec = (mb / (duration / 1000)).toFixed(2); 48 | 49 | console.log(mbPerSec+' mb/sec'); 50 | 51 | assert.equal(nparsed, buffer.length); 52 | 53 | function createMultipartBuffer(boundary, size) { 54 | var head = 55 | '--'+boundary+'\r\n' 56 | + 'content-disposition: form-data; name="field1"\r\n' 57 | + '\r\n' 58 | , tail = '\r\n--'+boundary+'--\r\n' 59 | , buffer = new Buffer(size); 60 | 61 | buffer.write(head, 'ascii', 0); 62 | buffer.write(tail, 'ascii', buffer.length - tail.length); 63 | return buffer; 64 | } 65 | 66 | process.on('exit', function() { 67 | for (var k in callbacks) { 68 | assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]); 69 | } 70 | }); 71 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/example/post.js: -------------------------------------------------------------------------------- 1 | require('../test/common'); 2 | var http = require('http'), 3 | util = require('util'), 4 | formidable = require('formidable'), 5 | server; 6 | 7 | server = http.createServer(function(req, res) { 8 | if (req.url == '/') { 9 | res.writeHead(200, {'content-type': 'text/html'}); 10 | res.end( 11 | '
    '+ 12 | '
    '+ 13 | '
    '+ 14 | ''+ 15 | '
    ' 16 | ); 17 | } else if (req.url == '/post') { 18 | var form = new formidable.IncomingForm(), 19 | fields = []; 20 | 21 | form 22 | .on('error', function(err) { 23 | res.writeHead(200, {'content-type': 'text/plain'}); 24 | res.end('error:\n\n'+util.inspect(err)); 25 | }) 26 | .on('field', function(field, value) { 27 | console.log(field, value); 28 | fields.push([field, value]); 29 | }) 30 | .on('end', function() { 31 | console.log('-> post done'); 32 | res.writeHead(200, {'content-type': 'text/plain'}); 33 | res.end('received fields:\n\n '+util.inspect(fields)); 34 | }); 35 | form.parse(req); 36 | } else { 37 | res.writeHead(404, {'content-type': 'text/plain'}); 38 | res.end('404'); 39 | } 40 | }); 41 | server.listen(TEST_PORT); 42 | 43 | console.log('listening on http://localhost:'+TEST_PORT+'/'); 44 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js: -------------------------------------------------------------------------------- 1 | require('../test/common'); 2 | var http = require('http'), 3 | util = require('util'), 4 | formidable = require('formidable'), 5 | server; 6 | 7 | server = http.createServer(function(req, res) { 8 | if (req.url == '/') { 9 | res.writeHead(200, {'content-type': 'text/html'}); 10 | res.end( 11 | '
    '+ 12 | '
    '+ 13 | '
    '+ 14 | ''+ 15 | '
    ' 16 | ); 17 | } else if (req.url == '/upload') { 18 | var form = new formidable.IncomingForm(), 19 | files = [], 20 | fields = []; 21 | 22 | form.uploadDir = TEST_TMP; 23 | 24 | form 25 | .on('field', function(field, value) { 26 | console.log(field, value); 27 | fields.push([field, value]); 28 | }) 29 | .on('file', function(field, file) { 30 | console.log(field, file); 31 | files.push([field, file]); 32 | }) 33 | .on('end', function() { 34 | console.log('-> upload done'); 35 | res.writeHead(200, {'content-type': 'text/plain'}); 36 | res.write('received fields:\n\n '+util.inspect(fields)); 37 | res.write('\n\n'); 38 | res.end('received files:\n\n '+util.inspect(files)); 39 | }); 40 | form.parse(req); 41 | } else { 42 | res.writeHead(404, {'content-type': 'text/plain'}); 43 | res.end('404'); 44 | } 45 | }); 46 | server.listen(TEST_PORT); 47 | 48 | console.log('listening on http://localhost:'+TEST_PORT+'/'); 49 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/formidable'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js: -------------------------------------------------------------------------------- 1 | if (global.GENTLY) require = GENTLY.hijack(require); 2 | 3 | var util = require('./util'), 4 | WriteStream = require('fs').WriteStream, 5 | EventEmitter = require('events').EventEmitter, 6 | crypto = require('crypto'); 7 | 8 | function File(properties) { 9 | EventEmitter.call(this); 10 | 11 | this.size = 0; 12 | this.path = null; 13 | this.name = null; 14 | this.type = null; 15 | this.hash = null; 16 | this.lastModifiedDate = null; 17 | 18 | this._writeStream = null; 19 | 20 | for (var key in properties) { 21 | this[key] = properties[key]; 22 | } 23 | 24 | if(typeof this.hash === 'string') { 25 | this.hash = crypto.createHash(properties.hash); 26 | } 27 | 28 | this._backwardsCompatibility(); 29 | } 30 | module.exports = File; 31 | util.inherits(File, EventEmitter); 32 | 33 | // @todo Next release: Show error messages when accessing these 34 | File.prototype._backwardsCompatibility = function() { 35 | var self = this; 36 | this.__defineGetter__('length', function() { 37 | return self.size; 38 | }); 39 | this.__defineGetter__('filename', function() { 40 | return self.name; 41 | }); 42 | this.__defineGetter__('mime', function() { 43 | return self.type; 44 | }); 45 | }; 46 | 47 | File.prototype.open = function() { 48 | this._writeStream = new WriteStream(this.path); 49 | }; 50 | 51 | File.prototype.write = function(buffer, cb) { 52 | var self = this; 53 | this._writeStream.write(buffer, function() { 54 | if(self.hash) { 55 | self.hash.update(buffer); 56 | } 57 | self.lastModifiedDate = new Date(); 58 | self.size += buffer.length; 59 | self.emit('progress', self.size); 60 | cb(); 61 | }); 62 | }; 63 | 64 | File.prototype.end = function(cb) { 65 | var self = this; 66 | this._writeStream.end(function() { 67 | if(self.hash) { 68 | self.hash = self.hash.digest('hex'); 69 | } 70 | self.emit('end'); 71 | cb(); 72 | }); 73 | }; 74 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js: -------------------------------------------------------------------------------- 1 | var IncomingForm = require('./incoming_form').IncomingForm; 2 | IncomingForm.IncomingForm = IncomingForm; 3 | module.exports = IncomingForm; 4 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js: -------------------------------------------------------------------------------- 1 | if (global.GENTLY) require = GENTLY.hijack(require); 2 | 3 | // This is a buffering parser, not quite as nice as the multipart one. 4 | // If I find time I'll rewrite this to be fully streaming as well 5 | var querystring = require('querystring'); 6 | 7 | function QuerystringParser() { 8 | this.buffer = ''; 9 | }; 10 | exports.QuerystringParser = QuerystringParser; 11 | 12 | QuerystringParser.prototype.write = function(buffer) { 13 | this.buffer += buffer.toString('ascii'); 14 | return buffer.length; 15 | }; 16 | 17 | QuerystringParser.prototype.end = function() { 18 | var fields = querystring.parse(this.buffer); 19 | for (var field in fields) { 20 | this.onField(field, fields[field]); 21 | } 22 | this.buffer = ''; 23 | 24 | this.onEnd(); 25 | }; -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js: -------------------------------------------------------------------------------- 1 | // Backwards compatibility ... 2 | try { 3 | module.exports = require('util'); 4 | } catch (e) { 5 | module.exports = require('sys'); 6 | } 7 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @find test/simple/test-*.js | xargs -n 1 -t node 3 | 4 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/dog.js: -------------------------------------------------------------------------------- 1 | require('../test/common'); 2 | function Dog() {} 3 | 4 | Dog.prototype.seeCat = function() { 5 | this.bark('whuf, whuf'); 6 | this.run(); 7 | } 8 | 9 | Dog.prototype.bark = function(bark) { 10 | require('sys').puts(bark); 11 | } 12 | 13 | var gently = new (require('gently')) 14 | , assert = require('assert') 15 | , dog = new Dog(); 16 | 17 | gently.expect(dog, 'bark', function(bark) { 18 | assert.equal(bark, 'whuf, whuf'); 19 | }); 20 | gently.expect(dog, 'run'); 21 | 22 | dog.seeCat(); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/event_emitter.js: -------------------------------------------------------------------------------- 1 | require('../test/common'); 2 | var gently = new (require('gently')) 3 | , stream = new (require('fs').WriteStream)('my_file.txt'); 4 | 5 | gently.expect(stream, 'emit', function(event) { 6 | assert.equal(event, 'open'); 7 | }); 8 | 9 | gently.expect(stream, 'emit', function(event) { 10 | assert.equal(event, 'drain'); 11 | }); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/node-gently/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/gently'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/node-gently/lib/gently/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./gently'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/node-gently/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gently", 3 | "version": "0.9.2", 4 | "directories": { 5 | "lib": "./lib/gently" 6 | }, 7 | "main": "./lib/gently/index", 8 | "dependencies": {}, 9 | "devDependencies": {}, 10 | "engines": { 11 | "node": "*" 12 | }, 13 | "optionalDependencies": {} 14 | } 15 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/common.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | , sys = require('sys'); 3 | 4 | require.paths.unshift(path.dirname(__dirname)+'/lib'); 5 | 6 | global.puts = sys.puts; 7 | global.p = function() {sys.error(sys.inspect.apply(null, arguments))};; 8 | global.assert = require('assert'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/common.js: -------------------------------------------------------------------------------- 1 | var mysql = require('..'); 2 | var path = require('path'); 3 | 4 | var root = path.join(__dirname, '../'); 5 | exports.dir = { 6 | root : root, 7 | lib : root + '/lib', 8 | fixture : root + '/test/fixture', 9 | tmp : root + '/test/tmp', 10 | }; 11 | 12 | exports.port = 13532; 13 | 14 | exports.formidable = require('..'); 15 | exports.assert = require('assert'); 16 | 17 | exports.require = function(lib) { 18 | return require(exports.dir.lib + '/' + lib); 19 | }; 20 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt: -------------------------------------------------------------------------------- 1 | I am a text file with a funky name! 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt: -------------------------------------------------------------------------------- 1 | I am a plain text file 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md: -------------------------------------------------------------------------------- 1 | * Opera does not allow submitting this file, it shows a warning to the 2 | user that the file could not be found instead. Tested in 9.8, 11.51 on OSX. 3 | Reported to Opera on 08.09.2011 (tracking email DSK-346009@bugs.opera.com). 4 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js: -------------------------------------------------------------------------------- 1 | module.exports['generic.http'] = [ 2 | {type: 'file', name: 'upload', filename: '', fixture: 'plain.txt'}, 3 | ]; 4 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js: -------------------------------------------------------------------------------- 1 | var properFilename = 'funkyfilename.txt'; 2 | 3 | function expect(filename) { 4 | return [ 5 | {type: 'field', name: 'title', value: 'Weird filename'}, 6 | {type: 'file', name: 'upload', filename: filename, fixture: properFilename}, 7 | ]; 8 | }; 9 | 10 | var webkit = " ? % * | \" < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; 11 | var ffOrIe = " ? % * | \" < > . ☃ ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; 12 | 13 | module.exports = { 14 | 'osx-chrome-13.http' : expect(webkit), 15 | 'osx-firefox-3.6.http' : expect(ffOrIe), 16 | 'osx-safari-5.http' : expect(webkit), 17 | 'xp-chrome-12.http' : expect(webkit), 18 | 'xp-ie-7.http' : expect(ffOrIe), 19 | 'xp-ie-8.http' : expect(ffOrIe), 20 | 'xp-safari-5.http' : expect(webkit), 21 | }; 22 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js: -------------------------------------------------------------------------------- 1 | exports['rfc1867'] = 2 | { boundary: 'AaB03x', 3 | raw: 4 | '--AaB03x\r\n'+ 5 | 'content-disposition: form-data; name="field1"\r\n'+ 6 | '\r\n'+ 7 | 'Joe Blow\r\nalmost tricked you!\r\n'+ 8 | '--AaB03x\r\n'+ 9 | 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ 10 | 'Content-Type: text/plain\r\n'+ 11 | '\r\n'+ 12 | '... contents of file1.txt ...\r\r\n'+ 13 | '--AaB03x--\r\n', 14 | parts: 15 | [ { headers: { 16 | 'content-disposition': 'form-data; name="field1"', 17 | }, 18 | data: 'Joe Blow\r\nalmost tricked you!', 19 | }, 20 | { headers: { 21 | 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', 22 | 'Content-Type': 'text/plain', 23 | }, 24 | data: '... contents of file1.txt ...\r', 25 | } 26 | ] 27 | }; 28 | 29 | exports['noTrailing\r\n'] = 30 | { boundary: 'AaB03x', 31 | raw: 32 | '--AaB03x\r\n'+ 33 | 'content-disposition: form-data; name="field1"\r\n'+ 34 | '\r\n'+ 35 | 'Joe Blow\r\nalmost tricked you!\r\n'+ 36 | '--AaB03x\r\n'+ 37 | 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ 38 | 'Content-Type: text/plain\r\n'+ 39 | '\r\n'+ 40 | '... contents of file1.txt ...\r\r\n'+ 41 | '--AaB03x--', 42 | parts: 43 | [ { headers: { 44 | 'content-disposition': 'form-data; name="field1"', 45 | }, 46 | data: 'Joe Blow\r\nalmost tricked you!', 47 | }, 48 | { headers: { 49 | 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', 50 | 'Content-Type': 'text/plain', 51 | }, 52 | data: '... contents of file1.txt ...\r', 53 | } 54 | ] 55 | }; 56 | 57 | exports['emptyHeader'] = 58 | { boundary: 'AaB03x', 59 | raw: 60 | '--AaB03x\r\n'+ 61 | 'content-disposition: form-data; name="field1"\r\n'+ 62 | ': foo\r\n'+ 63 | '\r\n'+ 64 | 'Joe Blow\r\nalmost tricked you!\r\n'+ 65 | '--AaB03x\r\n'+ 66 | 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ 67 | 'Content-Type: text/plain\r\n'+ 68 | '\r\n'+ 69 | '... contents of file1.txt ...\r\r\n'+ 70 | '--AaB03x--\r\n', 71 | expectError: true, 72 | }; 73 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js: -------------------------------------------------------------------------------- 1 | var hashish = require('hashish'); 2 | var fs = require('fs'); 3 | var findit = require('findit'); 4 | var path = require('path'); 5 | var http = require('http'); 6 | var net = require('net'); 7 | var assert = require('assert'); 8 | 9 | var common = require('../common'); 10 | var formidable = common.formidable; 11 | 12 | var server = http.createServer(); 13 | server.listen(common.port, findFixtures); 14 | 15 | function findFixtures() { 16 | var fixtures = []; 17 | findit 18 | .sync(common.dir.fixture + '/js') 19 | .forEach(function(jsPath) { 20 | if (!/\.js$/.test(jsPath)) return; 21 | 22 | var group = path.basename(jsPath, '.js'); 23 | hashish.forEach(require(jsPath), function(fixture, name) { 24 | fixtures.push({ 25 | name : group + '/' + name, 26 | fixture : fixture, 27 | }); 28 | }); 29 | }); 30 | 31 | testNext(fixtures); 32 | } 33 | 34 | function testNext(fixtures) { 35 | var fixture = fixtures.shift(); 36 | if (!fixture) return server.close(); 37 | 38 | var name = fixture.name; 39 | var fixture = fixture.fixture; 40 | 41 | uploadFixture(name, function(err, parts) { 42 | if (err) throw err; 43 | 44 | fixture.forEach(function(expectedPart, i) { 45 | var parsedPart = parts[i]; 46 | assert.equal(parsedPart.type, expectedPart.type); 47 | assert.equal(parsedPart.name, expectedPart.name); 48 | 49 | if (parsedPart.type === 'file') { 50 | var filename = parsedPart.value.name; 51 | assert.equal(filename, expectedPart.filename); 52 | } 53 | }); 54 | 55 | testNext(fixtures); 56 | }); 57 | }; 58 | 59 | function uploadFixture(name, cb) { 60 | server.once('request', function(req, res) { 61 | var form = new formidable.IncomingForm(); 62 | form.uploadDir = common.dir.tmp; 63 | form.parse(req); 64 | 65 | function callback() { 66 | var realCallback = cb; 67 | cb = function() {}; 68 | realCallback.apply(null, arguments); 69 | } 70 | 71 | var parts = []; 72 | form 73 | .on('error', callback) 74 | .on('fileBegin', function(name, value) { 75 | parts.push({type: 'file', name: name, value: value}); 76 | }) 77 | .on('field', function(name, value) { 78 | parts.push({type: 'field', name: name, value: value}); 79 | }) 80 | .on('end', function() { 81 | callback(null, parts); 82 | }); 83 | }); 84 | 85 | var socket = net.createConnection(common.port); 86 | var file = fs.createReadStream(common.dir.fixture + '/http/' + name); 87 | 88 | file.pipe(socket); 89 | } 90 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js: -------------------------------------------------------------------------------- 1 | var path = require('path'), 2 | fs = require('fs'); 3 | 4 | try { 5 | global.Gently = require('gently'); 6 | } catch (e) { 7 | throw new Error('this test suite requires node-gently'); 8 | } 9 | 10 | exports.lib = path.join(__dirname, '../../lib'); 11 | 12 | global.GENTLY = new Gently(); 13 | 14 | global.assert = require('assert'); 15 | global.TEST_PORT = 13532; 16 | global.TEST_FIXTURES = path.join(__dirname, '../fixture'); 17 | global.TEST_TMP = path.join(__dirname, '../tmp'); 18 | 19 | // Stupid new feature in node that complains about gently attaching too many 20 | // listeners to process 'exit'. This is a workaround until I can think of a 21 | // better way to deal with this. 22 | if (process.setMaxListeners) { 23 | process.setMaxListeners(10000); 24 | } 25 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js: -------------------------------------------------------------------------------- 1 | var common = require('../common'); 2 | var CHUNK_LENGTH = 10, 3 | multipartParser = require(common.lib + '/multipart_parser'), 4 | MultipartParser = multipartParser.MultipartParser, 5 | parser = new MultipartParser(), 6 | fixtures = require(TEST_FIXTURES + '/multipart'), 7 | Buffer = require('buffer').Buffer; 8 | 9 | Object.keys(fixtures).forEach(function(name) { 10 | var fixture = fixtures[name], 11 | buffer = new Buffer(Buffer.byteLength(fixture.raw, 'binary')), 12 | offset = 0, 13 | chunk, 14 | nparsed, 15 | 16 | parts = [], 17 | part = null, 18 | headerField, 19 | headerValue, 20 | endCalled = ''; 21 | 22 | parser.initWithBoundary(fixture.boundary); 23 | parser.onPartBegin = function() { 24 | part = {headers: {}, data: ''}; 25 | parts.push(part); 26 | headerField = ''; 27 | headerValue = ''; 28 | }; 29 | 30 | parser.onHeaderField = function(b, start, end) { 31 | headerField += b.toString('ascii', start, end); 32 | }; 33 | 34 | parser.onHeaderValue = function(b, start, end) { 35 | headerValue += b.toString('ascii', start, end); 36 | } 37 | 38 | parser.onHeaderEnd = function() { 39 | part.headers[headerField] = headerValue; 40 | headerField = ''; 41 | headerValue = ''; 42 | }; 43 | 44 | parser.onPartData = function(b, start, end) { 45 | var str = b.toString('ascii', start, end); 46 | part.data += b.slice(start, end); 47 | } 48 | 49 | parser.onEnd = function() { 50 | endCalled = true; 51 | } 52 | 53 | buffer.write(fixture.raw, 'binary', 0); 54 | 55 | while (offset < buffer.length) { 56 | if (offset + CHUNK_LENGTH < buffer.length) { 57 | chunk = buffer.slice(offset, offset+CHUNK_LENGTH); 58 | } else { 59 | chunk = buffer.slice(offset, buffer.length); 60 | } 61 | offset = offset + CHUNK_LENGTH; 62 | 63 | nparsed = parser.write(chunk); 64 | if (nparsed != chunk.length) { 65 | if (fixture.expectError) { 66 | return; 67 | } 68 | puts('-- ERROR --'); 69 | p(chunk.toString('ascii')); 70 | throw new Error(chunk.length+' bytes written, but only '+nparsed+' bytes parsed!'); 71 | } 72 | } 73 | 74 | if (fixture.expectError) { 75 | throw new Error('expected parse error did not happen'); 76 | } 77 | 78 | assert.ok(endCalled); 79 | assert.deepEqual(parts, fixture.parts); 80 | }); 81 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js: -------------------------------------------------------------------------------- 1 | var common = require('../common'); 2 | var multipartParser = require(common.lib + '/multipart_parser'), 3 | MultipartParser = multipartParser.MultipartParser, 4 | events = require('events'), 5 | Buffer = require('buffer').Buffer, 6 | parser; 7 | 8 | function test(test) { 9 | parser = new MultipartParser(); 10 | test(); 11 | } 12 | 13 | test(function constructor() { 14 | assert.equal(parser.boundary, null); 15 | assert.equal(parser.state, 0); 16 | assert.equal(parser.flags, 0); 17 | assert.equal(parser.boundaryChars, null); 18 | assert.equal(parser.index, null); 19 | assert.equal(parser.lookbehind, null); 20 | assert.equal(parser.constructor.name, 'MultipartParser'); 21 | }); 22 | 23 | test(function initWithBoundary() { 24 | var boundary = 'abc'; 25 | parser.initWithBoundary(boundary); 26 | assert.deepEqual(Array.prototype.slice.call(parser.boundary), [13, 10, 45, 45, 97, 98, 99]); 27 | assert.equal(parser.state, multipartParser.START); 28 | 29 | assert.deepEqual(parser.boundaryChars, {10: true, 13: true, 45: true, 97: true, 98: true, 99: true}); 30 | }); 31 | 32 | test(function parserError() { 33 | var boundary = 'abc', 34 | buffer = new Buffer(5); 35 | 36 | parser.initWithBoundary(boundary); 37 | buffer.write('--ad', 'ascii', 0); 38 | assert.equal(parser.write(buffer), 3); 39 | }); 40 | 41 | test(function end() { 42 | (function testError() { 43 | assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly: ' + parser.explain()); 44 | })(); 45 | 46 | (function testRegular() { 47 | parser.state = multipartParser.END; 48 | assert.strictEqual(parser.end(), undefined); 49 | })(); 50 | }); 51 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js: -------------------------------------------------------------------------------- 1 | var common = require('../common'); 2 | var QuerystringParser = require(common.lib + '/querystring_parser').QuerystringParser, 3 | Buffer = require('buffer').Buffer, 4 | gently, 5 | parser; 6 | 7 | function test(test) { 8 | gently = new Gently(); 9 | parser = new QuerystringParser(); 10 | test(); 11 | gently.verify(test.name); 12 | } 13 | 14 | test(function constructor() { 15 | assert.equal(parser.buffer, ''); 16 | assert.equal(parser.constructor.name, 'QuerystringParser'); 17 | }); 18 | 19 | test(function write() { 20 | var a = new Buffer('a=1'); 21 | assert.equal(parser.write(a), a.length); 22 | 23 | var b = new Buffer('&b=2'); 24 | parser.write(b); 25 | assert.equal(parser.buffer, a + b); 26 | }); 27 | 28 | test(function end() { 29 | var FIELDS = {a: ['b', {c: 'd'}], e: 'f'}; 30 | 31 | gently.expect(GENTLY.hijacked.querystring, 'parse', function(str) { 32 | assert.equal(str, parser.buffer); 33 | return FIELDS; 34 | }); 35 | 36 | gently.expect(parser, 'onField', Object.keys(FIELDS).length, function(key, val) { 37 | assert.deepEqual(FIELDS[key], val); 38 | }); 39 | 40 | gently.expect(parser, 'onEnd'); 41 | 42 | parser.buffer = 'my buffer'; 43 | parser.end(); 44 | assert.equal(parser.buffer, ''); 45 | }); 46 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/run.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('urun')(__dirname) 3 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js: -------------------------------------------------------------------------------- 1 | var common = require('../common'); 2 | var test = require('utest'); 3 | var assert = common.assert; 4 | var IncomingForm = common.require('incoming_form').IncomingForm; 5 | var path = require('path'); 6 | 7 | var form; 8 | test('IncomingForm', { 9 | before: function() { 10 | form = new IncomingForm(); 11 | }, 12 | 13 | '#_fileName with regular characters': function() { 14 | var filename = 'foo.txt'; 15 | assert.equal(form._fileName(makeHeader(filename)), 'foo.txt'); 16 | }, 17 | 18 | '#_fileName with unescaped quote': function() { 19 | var filename = 'my".txt'; 20 | assert.equal(form._fileName(makeHeader(filename)), 'my".txt'); 21 | }, 22 | 23 | '#_fileName with escaped quote': function() { 24 | var filename = 'my%22.txt'; 25 | assert.equal(form._fileName(makeHeader(filename)), 'my".txt'); 26 | }, 27 | 28 | '#_fileName with bad quote and additional sub-header': function() { 29 | var filename = 'my".txt'; 30 | var header = makeHeader(filename) + '; foo="bar"'; 31 | assert.equal(form._fileName(header), filename); 32 | }, 33 | 34 | '#_fileName with semicolon': function() { 35 | var filename = 'my;.txt'; 36 | assert.equal(form._fileName(makeHeader(filename)), 'my;.txt'); 37 | }, 38 | 39 | '#_fileName with utf8 character': function() { 40 | var filename = 'my☃.txt'; 41 | assert.equal(form._fileName(makeHeader(filename)), 'my☃.txt'); 42 | }, 43 | 44 | '#_uploadPath strips harmful characters from extension when keepExtensions': function() { 45 | form.keepExtensions = true; 46 | 47 | var ext = path.extname(form._uploadPath('fine.jpg?foo=bar')); 48 | assert.equal(ext, '.jpg'); 49 | 50 | var ext = path.extname(form._uploadPath('fine?foo=bar')); 51 | assert.equal(ext, ''); 52 | 53 | var ext = path.extname(form._uploadPath('super.cr2+dsad')); 54 | assert.equal(ext, '.cr2'); 55 | 56 | var ext = path.extname(form._uploadPath('super.bar')); 57 | assert.equal(ext, '.bar'); 58 | }, 59 | }); 60 | 61 | function makeHeader(filename) { 62 | return 'Content-Disposition: form-data; name="upload"; filename="' + filename + '"'; 63 | } 64 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var fs = require('fs'); 3 | var connections = 0; 4 | 5 | var server = http.createServer(function(req, res) { 6 | var socket = req.socket; 7 | console.log('Request: %s %s -> %s', req.method, req.url, socket.filename); 8 | 9 | req.on('end', function() { 10 | if (req.url !== '/') { 11 | res.end(JSON.stringify({ 12 | method: req.method, 13 | url: req.url, 14 | filename: socket.filename, 15 | })); 16 | return; 17 | } 18 | 19 | res.writeHead(200, {'content-type': 'text/html'}); 20 | res.end( 21 | '
    '+ 22 | '
    '+ 23 | '
    '+ 24 | ''+ 25 | '
    ' 26 | ); 27 | }); 28 | }); 29 | 30 | server.on('connection', function(socket) { 31 | connections++; 32 | 33 | socket.id = connections; 34 | socket.filename = 'connection-' + socket.id + '.http'; 35 | socket.file = fs.createWriteStream(socket.filename); 36 | socket.pipe(socket.file); 37 | 38 | console.log('--> %s', socket.filename); 39 | socket.on('close', function() { 40 | console.log('<-- %s', socket.filename); 41 | }); 42 | }); 43 | 44 | var port = process.env.PORT || 8080; 45 | server.listen(port, function() { 46 | console.log('Recording connections on port %s', port); 47 | }); 48 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/pause/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/pause/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.0.1 / 2010-01-03 3 | ================== 4 | 5 | * Initial release 6 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/pause/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --require should \ 5 | --reporter spec 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/pause/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # pause 3 | 4 | Pause streams... 5 | 6 | ## License 7 | 8 | (The MIT License) 9 | 10 | Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | 'Software'), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 26 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 27 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 28 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 29 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/pause/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function(obj){ 3 | var onData 4 | , onEnd 5 | , events = []; 6 | 7 | // buffer data 8 | obj.on('data', onData = function(data, encoding){ 9 | events.push(['data', data, encoding]); 10 | }); 11 | 12 | // buffer end 13 | obj.on('end', onEnd = function(data, encoding){ 14 | events.push(['end', data, encoding]); 15 | }); 16 | 17 | return { 18 | end: function(){ 19 | obj.removeListener('data', onData); 20 | obj.removeListener('end', onEnd); 21 | }, 22 | resume: function(){ 23 | this.end(); 24 | for (var i = 0, len = events.length; i < len; ++i) { 25 | obj.emit.apply(obj, events[i]); 26 | } 27 | } 28 | }; 29 | }; -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/pause/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pause", 3 | "version": "0.0.1", 4 | "description": "Pause streams...", 5 | "keywords": [], 6 | "author": { 7 | "name": "TJ Holowaychuk", 8 | "email": "tj@vision-media.ca" 9 | }, 10 | "dependencies": {}, 11 | "devDependencies": { 12 | "mocha": "*", 13 | "should": "*" 14 | }, 15 | "main": "index", 16 | "readme": "\n# pause\n\n Pause streams...\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 17 | "readmeFilename": "Readme.md", 18 | "_id": "pause@0.0.1", 19 | "dist": { 20 | "shasum": "1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d" 21 | }, 22 | "_from": "pause@0.0.1" 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "support/expresso"] 2 | path = support/expresso 3 | url = git://github.com/visionmedia/expresso.git 4 | [submodule "support/should"] 5 | path = support/should 6 | url = git://github.com/visionmedia/should.js.git 7 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.4 -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.5.1 / 2012-09-18 3 | ================== 4 | 5 | * fix encoded `=`. Closes #43 6 | 7 | 0.5.0 / 2012-05-04 8 | ================== 9 | 10 | * Added component support 11 | 12 | 0.4.2 / 2012-02-08 13 | ================== 14 | 15 | * Fixed: ensure objects are created when appropriate not arrays [aheckmann] 16 | 17 | 0.4.1 / 2012-01-26 18 | ================== 19 | 20 | * Fixed stringify()ing numbers. Closes #23 21 | 22 | 0.4.0 / 2011-11-21 23 | ================== 24 | 25 | * Allow parsing of an existing object (for `bodyParser()`) [jackyz] 26 | * Replaced expresso with mocha 27 | 28 | 0.3.2 / 2011-11-08 29 | ================== 30 | 31 | * Fixed global variable leak 32 | 33 | 0.3.1 / 2011-08-17 34 | ================== 35 | 36 | * Added `try/catch` around malformed uri components 37 | * Add test coverage for Array native method bleed-though 38 | 39 | 0.3.0 / 2011-07-19 40 | ================== 41 | 42 | * Allow `array[index]` and `object[property]` syntaxes [Aria Stewart] 43 | 44 | 0.2.0 / 2011-06-29 45 | ================== 46 | 47 | * Added `qs.stringify()` [Cory Forsyth] 48 | 49 | 0.1.0 / 2011-04-13 50 | ================== 51 | 52 | * Added jQuery-ish array support 53 | 54 | 0.0.7 / 2011-03-13 55 | ================== 56 | 57 | * Fixed; handle empty string and `== null` in `qs.parse()` [dmit] 58 | allows for convenient `qs.parse(url.parse(str).query)` 59 | 60 | 0.0.6 / 2011-02-14 61 | ================== 62 | 63 | * Fixed; support for implicit arrays 64 | 65 | 0.0.4 / 2011-02-09 66 | ================== 67 | 68 | * Fixed `+` as a space 69 | 70 | 0.0.3 / 2011-02-08 71 | ================== 72 | 73 | * Fixed case when right-hand value contains "]" 74 | 75 | 0.0.2 / 2011-02-07 76 | ================== 77 | 78 | * Fixed "=" presence in key 79 | 80 | 0.0.1 / 2011-02-07 81 | ================== 82 | 83 | * Initial release -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test/browser/qs.js: querystring.js 3 | component build package.json test/browser/qs 4 | 5 | querystring.js: lib/head.js lib/querystring.js lib/tail.js 6 | cat $^ > $@ 7 | 8 | test: 9 | @./node_modules/.bin/mocha \ 10 | --ui bdd 11 | 12 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/Readme.md: -------------------------------------------------------------------------------- 1 | # node-querystring 2 | 3 | query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. 4 | 5 | ## Installation 6 | 7 | $ npm install qs 8 | 9 | ## Examples 10 | 11 | ```js 12 | var qs = require('qs'); 13 | 14 | qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); 15 | // => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } 16 | 17 | qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) 18 | // => user[name]=Tobi&user[email]=tobi%40learnboost.com 19 | ``` 20 | 21 | ## Testing 22 | 23 | Install dev dependencies: 24 | 25 | $ npm install -d 26 | 27 | and execute: 28 | 29 | $ make test 30 | 31 | browser: 32 | 33 | $ open test/browser/index.html 34 | 35 | ## License 36 | 37 | (The MIT License) 38 | 39 | Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> 40 | 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of this software and associated documentation files (the 43 | 'Software'), to deal in the Software without restriction, including 44 | without limitation the rights to use, copy, modify, merge, publish, 45 | distribute, sublicense, and/or sell copies of the Software, and to 46 | permit persons to whom the Software is furnished to do so, subject to 47 | the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be 50 | included in all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 53 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 54 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 55 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 56 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 57 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 58 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/benchmark.js: -------------------------------------------------------------------------------- 1 | 2 | var qs = require('./'); 3 | 4 | var times = 100000 5 | , start = new Date 6 | , n = times; 7 | 8 | console.log('times: %d', times); 9 | 10 | while (n--) qs.parse('foo=bar'); 11 | console.log('simple: %dms', new Date - start); 12 | 13 | var start = new Date 14 | , n = times; 15 | 16 | while (n--) qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); 17 | console.log('nested: %dms', new Date - start); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "querystring", 3 | "description": "Querystring parser / stringifier with nesting support", 4 | "keywords": ["querystring", "query", "parser"], 5 | "main": "lib/querystring.js" 6 | } -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/examples.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var qs = require('./'); 7 | 8 | var obj = qs.parse('foo'); 9 | console.log(obj) 10 | 11 | var obj = qs.parse('foo=bar=baz'); 12 | console.log(obj) 13 | 14 | var obj = qs.parse('users[]'); 15 | console.log(obj) 16 | 17 | var obj = qs.parse('name=tj&email=tj@vision-media.ca'); 18 | console.log(obj) 19 | 20 | var obj = qs.parse('users[]=tj&users[]=tobi&users[]=jane'); 21 | console.log(obj) 22 | 23 | var obj = qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); 24 | console.log(obj) 25 | 26 | var obj = qs.parse('users[][name][first]=tj&users[][name][last]=holowaychuk'); 27 | console.log(obj) 28 | 29 | var obj = qs.parse('a=a&a=b&a=c'); 30 | console.log(obj) 31 | 32 | var obj = qs.parse('user[tj]=tj&user[tj]=TJ'); 33 | console.log(obj) 34 | 35 | var obj = qs.parse('user[names]=tj&user[names]=TJ&user[names]=Tyler'); 36 | console.log(obj) 37 | 38 | var obj = qs.parse('user[name][first]=tj&user[name][first]=TJ'); 39 | console.log(obj) 40 | 41 | var obj = qs.parse('user[0]=tj&user[1]=TJ'); 42 | console.log(obj) 43 | 44 | var obj = qs.parse('user[0]=tj&user[]=TJ'); 45 | console.log(obj) 46 | 47 | var obj = qs.parse('user[0]=tj&user[foo]=TJ'); 48 | console.log(obj) 49 | 50 | var str = qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}); 51 | console.log(str); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/querystring'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/lib/head.js: -------------------------------------------------------------------------------- 1 | ;(function(){ 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/lib/tail.js: -------------------------------------------------------------------------------- 1 | })(); -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/test/browser/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Mocha 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
    17 | 18 | 19 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/node_modules/qs/test/browser/qs.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datagraph/jquery-jsonrpc/5db1e62087665f5ee6a496fc30839cd69de1db63/node_modules/express/node_modules/connect/node_modules/qs/test/browser/qs.css -------------------------------------------------------------------------------- /node_modules/express/node_modules/connect/test.js: -------------------------------------------------------------------------------- 1 | 2 | var connect = require('./'); 3 | var app = connect(); 4 | 5 | app.use(connect.directory('.')); 6 | 7 | app.listen(3000) -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie-signature/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie-signature/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.0.1 / 2010-01-03 3 | ================== 4 | 5 | * Initial release 6 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie-signature/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --require should \ 5 | --reporter spec 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie-signature/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # cookie-signature 3 | 4 | Sign and unsign cookies. 5 | 6 | ## Example 7 | 8 | ```js 9 | var cookie = require('cookie-signature'); 10 | 11 | var val = cookie.sign('hello', 'tobiiscool'); 12 | val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI'); 13 | 14 | var val = cookie.sign('hello', 'tobiiscool'); 15 | cookie.unsign(val, 'tobiiscool').should.equal('hello'); 16 | cookie.unsign(val, 'luna').should.be.false; 17 | ``` 18 | 19 | ## License 20 | 21 | (The MIT License) 22 | 23 | Copyright (c) 2012 LearnBoost <tj@learnboost.com> 24 | 25 | Permission is hereby granted, free of charge, to any person obtaining 26 | a copy of this software and associated documentation files (the 27 | 'Software'), to deal in the Software without restriction, including 28 | without limitation the rights to use, copy, modify, merge, publish, 29 | distribute, sublicense, and/or sell copies of the Software, and to 30 | permit persons to whom the Software is furnished to do so, subject to 31 | the following conditions: 32 | 33 | The above copyright notice and this permission notice shall be 34 | included in all copies or substantial portions of the Software. 35 | 36 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 37 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 38 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 39 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 40 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 41 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 42 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie-signature/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var crypto = require('crypto'); 7 | 8 | /** 9 | * Sign the given `val` with `secret`. 10 | * 11 | * @param {String} val 12 | * @param {String} secret 13 | * @return {String} 14 | * @api private 15 | */ 16 | 17 | exports.sign = function(val, secret){ 18 | if ('string' != typeof val) throw new TypeError('cookie required'); 19 | if ('string' != typeof secret) throw new TypeError('secret required'); 20 | return val + '.' + crypto 21 | .createHmac('sha256', secret) 22 | .update(val) 23 | .digest('base64') 24 | .replace(/\=+$/, ''); 25 | }; 26 | 27 | /** 28 | * Unsign and decode the given `val` with `secret`, 29 | * returning `false` if the signature is invalid. 30 | * 31 | * @param {String} val 32 | * @param {String} secret 33 | * @return {String|Boolean} 34 | * @api private 35 | */ 36 | 37 | exports.unsign = function(val, secret){ 38 | if ('string' != typeof val) throw new TypeError('cookie required'); 39 | if ('string' != typeof secret) throw new TypeError('secret required'); 40 | var str = val.slice(0, val.lastIndexOf('.')); 41 | return exports.sign(str, secret) == val ? str : false; 42 | }; -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie-signature/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cookie-signature", 3 | "version": "0.0.1", 4 | "description": "Sign and unsign cookies", 5 | "keywords": [ 6 | "cookie", 7 | "sign", 8 | "unsign" 9 | ], 10 | "author": { 11 | "name": "TJ Holowaychuk", 12 | "email": "tj@learnboost.com" 13 | }, 14 | "dependencies": {}, 15 | "devDependencies": { 16 | "mocha": "*", 17 | "should": "*" 18 | }, 19 | "main": "index", 20 | "readme": "\n# cookie-signature\n\n Sign and unsign cookies.\n\n## Example\n\n```js\nvar cookie = require('cookie-signature');\n\nvar val = cookie.sign('hello', 'tobiiscool');\nval.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');\n\nvar val = cookie.sign('hello', 'tobiiscool');\ncookie.unsign(val, 'tobiiscool').should.equal('hello');\ncookie.unsign(val, 'luna').should.be.false;\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 LearnBoost <tj@learnboost.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 21 | "readmeFilename": "Readme.md", 22 | "_id": "cookie-signature@0.0.1", 23 | "dist": { 24 | "shasum": "13d3603b5cf63befbf85a8801e37aa900db46985" 25 | }, 26 | "_from": "cookie-signature@0.0.1" 27 | } 28 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie/README.md: -------------------------------------------------------------------------------- 1 | # cookie [![Build Status](https://secure.travis-ci.org/shtylman/node-cookie.png?branch=master)](http://travis-ci.org/shtylman/node-cookie) # 2 | 3 | cookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers. 4 | 5 | See [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies. 6 | 7 | ## how? 8 | 9 | ``` 10 | npm install cookie 11 | ``` 12 | 13 | ```javascript 14 | var cookie = require('cookie'); 15 | 16 | var hdr = cookie.serialize('foo', 'bar'); 17 | // hdr = 'foo=bar'; 18 | 19 | var cookies = cookie.parse('foo=bar; cat=meow; dog=ruff'); 20 | // cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' }; 21 | ``` 22 | 23 | ## more 24 | 25 | The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values. 26 | 27 | ### path 28 | > cookie path 29 | 30 | ### expires 31 | > absolute expiration date for the cookie (Date object) 32 | 33 | ### maxAge 34 | > relative max age of the cookie from when the client receives it (seconds) 35 | 36 | ### domain 37 | > domain for the cookie 38 | 39 | ### secure 40 | > true or false 41 | 42 | ### httpOnly 43 | > true or false 44 | 45 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie/index.js: -------------------------------------------------------------------------------- 1 | 2 | /// Serialize the a name value pair into a cookie string suitable for 3 | /// http headers. An optional options object specified cookie parameters 4 | /// 5 | /// serialize('foo', 'bar', { httpOnly: true }) 6 | /// => "foo=bar; httpOnly" 7 | /// 8 | /// @param {String} name 9 | /// @param {String} val 10 | /// @param {Object} options 11 | /// @return {String} 12 | var serialize = function(name, val, opt){ 13 | var pairs = [name + '=' + encode(val)]; 14 | opt = opt || {}; 15 | 16 | if (opt.maxAge) pairs.push('Max-Age=' + opt.maxAge); 17 | if (opt.domain) pairs.push('Domain=' + opt.domain); 18 | if (opt.path) pairs.push('Path=' + opt.path); 19 | if (opt.expires) pairs.push('Expires=' + opt.expires.toUTCString()); 20 | if (opt.httpOnly) pairs.push('HttpOnly'); 21 | if (opt.secure) pairs.push('Secure'); 22 | 23 | return pairs.join('; '); 24 | }; 25 | 26 | /// Parse the given cookie header string into an object 27 | /// The object has the various cookies as keys(names) => values 28 | /// @param {String} str 29 | /// @return {Object} 30 | var parse = function(str) { 31 | var obj = {} 32 | var pairs = str.split(/[;,] */); 33 | 34 | pairs.forEach(function(pair) { 35 | var eq_idx = pair.indexOf('=') 36 | var key = pair.substr(0, eq_idx).trim() 37 | var val = pair.substr(++eq_idx, pair.length).trim(); 38 | 39 | // quoted values 40 | if ('"' == val[0]) { 41 | val = val.slice(1, -1); 42 | } 43 | 44 | // only assign once 45 | if (undefined == obj[key]) { 46 | try { 47 | obj[key] = decode(val); 48 | } catch (e) { 49 | obj[key] = val; 50 | } 51 | } 52 | }); 53 | 54 | return obj; 55 | }; 56 | 57 | var encode = encodeURIComponent; 58 | var decode = decodeURIComponent; 59 | 60 | module.exports.serialize = serialize; 61 | module.exports.parse = parse; 62 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Roman Shtylman", 4 | "email": "shtylman@gmail.com" 5 | }, 6 | "name": "cookie", 7 | "description": "cookie parsing and serialization", 8 | "version": "0.0.5", 9 | "repository": { 10 | "type": "git", 11 | "url": "git://github.com/shtylman/node-cookie.git" 12 | }, 13 | "keywords": [ 14 | "cookie", 15 | "cookies" 16 | ], 17 | "main": "index.js", 18 | "scripts": { 19 | "test": "mocha" 20 | }, 21 | "dependencies": {}, 22 | "devDependencies": { 23 | "mocha": "1.x.x" 24 | }, 25 | "optionalDependencies": {}, 26 | "engines": { 27 | "node": "*" 28 | }, 29 | "readme": "# cookie [![Build Status](https://secure.travis-ci.org/shtylman/node-cookie.png?branch=master)](http://travis-ci.org/shtylman/node-cookie) #\n\ncookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers.\n\nSee [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies.\n\n## how?\n\n```\nnpm install cookie\n```\n\n```javascript\nvar cookie = require('cookie');\n\nvar hdr = cookie.serialize('foo', 'bar');\n// hdr = 'foo=bar';\n\nvar cookies = cookie.parse('foo=bar; cat=meow; dog=ruff');\n// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' };\n```\n\n## more\n\nThe serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values.\n\n### path\n> cookie path\n\n### expires\n> absolute expiration date for the cookie (Date object)\n\n### maxAge\n> relative max age of the cookie from when the client receives it (seconds)\n\n### domain\n> domain for the cookie\n\n### secure\n> true or false\n\n### httpOnly\n> true or false\n\n", 30 | "readmeFilename": "README.md", 31 | "_id": "cookie@0.0.5", 32 | "dist": { 33 | "shasum": "59c210f0e43888d4afcd7e3f030e501028a14f0b" 34 | }, 35 | "_from": "cookie@0.0.5" 36 | } 37 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --ui qunit 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie/test/parse.js: -------------------------------------------------------------------------------- 1 | 2 | var assert = require('assert'); 3 | 4 | var cookie = require('..'); 5 | 6 | suite('parse'); 7 | 8 | test('basic', function() { 9 | assert.deepEqual({ foo: 'bar' }, cookie.parse('foo=bar')); 10 | assert.deepEqual({ foo: '123' }, cookie.parse('foo=123')); 11 | }); 12 | 13 | test('ignore spaces', function() { 14 | assert.deepEqual({ FOO: 'bar', baz: 'raz' }, 15 | cookie.parse('FOO = bar; baz = raz')); 16 | }); 17 | 18 | test('escaping', function() { 19 | assert.deepEqual({ foo: 'bar=123456789&name=Magic+Mouse' }, 20 | cookie.parse('foo="bar=123456789&name=Magic+Mouse"')); 21 | 22 | assert.deepEqual({ email: ' ",;/' }, 23 | cookie.parse('email=%20%22%2c%3b%2f')); 24 | }); 25 | 26 | test('ignore escaping error and return original value', function() { 27 | assert.deepEqual({ foo: '%1', bar: 'bar' }, cookie.parse('foo=%1;bar=bar')); 28 | }); 29 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/cookie/test/serialize.js: -------------------------------------------------------------------------------- 1 | // builtin 2 | var assert = require('assert'); 3 | 4 | var cookie = require('..'); 5 | 6 | suite('serialize'); 7 | 8 | test('basic', function() { 9 | assert.equal('foo=bar', cookie.serialize('foo', 'bar')); 10 | assert.equal('foo=bar%20baz', cookie.serialize('foo', 'bar baz')); 11 | }); 12 | 13 | test('path', function() { 14 | assert.equal('foo=bar; Path=/', cookie.serialize('foo', 'bar', { 15 | path: '/' 16 | })); 17 | }); 18 | 19 | test('secure', function() { 20 | assert.equal('foo=bar; Secure', cookie.serialize('foo', 'bar', { 21 | secure: true 22 | })); 23 | 24 | assert.equal('foo=bar', cookie.serialize('foo', 'bar', { 25 | secure: false 26 | })); 27 | }); 28 | 29 | test('domain', function() { 30 | assert.equal('foo=bar; Domain=example.com', cookie.serialize('foo', 'bar', { 31 | domain: 'example.com' 32 | })); 33 | }); 34 | 35 | test('httpOnly', function() { 36 | assert.equal('foo=bar; HttpOnly', cookie.serialize('foo', 'bar', { 37 | httpOnly: true 38 | })); 39 | }); 40 | 41 | test('maxAge', function() { 42 | assert.equal('foo=bar; Max-Age=1000', cookie.serialize('foo', 'bar', { 43 | maxAge: 1000 44 | })); 45 | }); 46 | 47 | test('escaping', function() { 48 | assert.deepEqual('cat=%2B%20', cookie.serialize('cat', '+ ')); 49 | }); 50 | 51 | test('parse->serialize', function() { 52 | 53 | assert.deepEqual({ cat: 'foo=123&name=baz five' }, cookie.parse( 54 | cookie.serialize('cat', 'foo=123&name=baz five'))); 55 | 56 | assert.deepEqual({ cat: ' ";/' }, cookie.parse( 57 | cookie.serialize('cat', ' ";/'))); 58 | }); 59 | 60 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.7.0 / 2012-05-04 3 | ================== 4 | 5 | * Added .component to package.json 6 | * Added debug.component.js build 7 | 8 | 0.6.0 / 2012-03-16 9 | ================== 10 | 11 | * Added support for "-" prefix in DEBUG [Vinay Pulim] 12 | * Added `.enabled` flag to the node version [TooTallNate] 13 | 14 | 0.5.0 / 2012-02-02 15 | ================== 16 | 17 | * Added: humanize diffs. Closes #8 18 | * Added `debug.disable()` to the CS variant 19 | * Removed padding. Closes #10 20 | * Fixed: persist client-side variant again. Closes #9 21 | 22 | 0.4.0 / 2012-02-01 23 | ================== 24 | 25 | * Added browser variant support for older browsers [TooTallNate] 26 | * Added `debug.enable('project:*')` to browser variant [TooTallNate] 27 | * Added padding to diff (moved it to the right) 28 | 29 | 0.3.0 / 2012-01-26 30 | ================== 31 | 32 | * Added millisecond diff when isatty, otherwise UTC string 33 | 34 | 0.2.0 / 2012-01-22 35 | ================== 36 | 37 | * Added wildcard support 38 | 39 | 0.1.0 / 2011-12-02 40 | ================== 41 | 42 | * Added: remove colors unless stderr isatty [TooTallNate] 43 | 44 | 0.0.1 / 2010-01-03 45 | ================== 46 | 47 | * Initial release 48 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/Makefile: -------------------------------------------------------------------------------- 1 | 2 | debug.component.js: head.js debug.js tail.js 3 | cat $^ > $@ 4 | 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/debug.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Create a debugger with the given `name`. 4 | * 5 | * @param {String} name 6 | * @return {Type} 7 | * @api public 8 | */ 9 | 10 | function debug(name) { 11 | if (!debug.enabled(name)) return function(){}; 12 | 13 | return function(fmt){ 14 | var curr = new Date; 15 | var ms = curr - (debug[name] || curr); 16 | debug[name] = curr; 17 | 18 | fmt = name 19 | + ' ' 20 | + fmt 21 | + ' +' + debug.humanize(ms); 22 | 23 | // This hackery is required for IE8 24 | // where `console.log` doesn't have 'apply' 25 | window.console 26 | && console.log 27 | && Function.prototype.apply.call(console.log, console, arguments); 28 | } 29 | } 30 | 31 | /** 32 | * The currently active debug mode names. 33 | */ 34 | 35 | debug.names = []; 36 | debug.skips = []; 37 | 38 | /** 39 | * Enables a debug mode by name. This can include modes 40 | * separated by a colon and wildcards. 41 | * 42 | * @param {String} name 43 | * @api public 44 | */ 45 | 46 | debug.enable = function(name) { 47 | localStorage.debug = name; 48 | 49 | var split = (name || '').split(/[\s,]+/) 50 | , len = split.length; 51 | 52 | for (var i = 0; i < len; i++) { 53 | name = split[i].replace('*', '.*?'); 54 | if (name[0] === '-') { 55 | debug.skips.push(new RegExp('^' + name.substr(1) + '$')); 56 | } 57 | else { 58 | debug.names.push(new RegExp('^' + name + '$')); 59 | } 60 | } 61 | }; 62 | 63 | /** 64 | * Disable debug output. 65 | * 66 | * @api public 67 | */ 68 | 69 | debug.disable = function(){ 70 | debug.enable(''); 71 | }; 72 | 73 | /** 74 | * Humanize the given `ms`. 75 | * 76 | * @param {Number} m 77 | * @return {String} 78 | * @api private 79 | */ 80 | 81 | debug.humanize = function(ms) { 82 | var sec = 1000 83 | , min = 60 * 1000 84 | , hour = 60 * min; 85 | 86 | if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; 87 | if (ms >= min) return (ms / min).toFixed(1) + 'm'; 88 | if (ms >= sec) return (ms / sec | 0) + 's'; 89 | return ms + 'ms'; 90 | }; 91 | 92 | /** 93 | * Returns true if the given mode name is enabled, false otherwise. 94 | * 95 | * @param {String} name 96 | * @return {Boolean} 97 | * @api public 98 | */ 99 | 100 | debug.enabled = function(name) { 101 | for (var i = 0, len = debug.skips.length; i < len; i++) { 102 | if (debug.skips[i].test(name)) { 103 | return false; 104 | } 105 | } 106 | for (var i = 0, len = debug.names.length; i < len; i++) { 107 | if (debug.names[i].test(name)) { 108 | return true; 109 | } 110 | } 111 | return false; 112 | }; 113 | 114 | // persist 115 | 116 | if (window.localStorage) debug.enable(localStorage.debug); -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/example/app.js: -------------------------------------------------------------------------------- 1 | 2 | var debug = require('../')('http') 3 | , http = require('http') 4 | , name = 'My App'; 5 | 6 | // fake app 7 | 8 | debug('booting %s', name); 9 | 10 | http.createServer(function(req, res){ 11 | debug(req.method + ' ' + req.url); 12 | res.end('hello\n'); 13 | }).listen(3000, function(){ 14 | debug('listening'); 15 | }); 16 | 17 | // fake worker of some kind 18 | 19 | require('./worker'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/example/browser.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | debug() 4 | 5 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/example/wildcards.js: -------------------------------------------------------------------------------- 1 | 2 | var debug = { 3 | foo: require('../')('test:foo'), 4 | bar: require('../')('test:bar'), 5 | baz: require('../')('test:baz') 6 | }; 7 | 8 | debug.foo('foo') 9 | debug.bar('bar') 10 | debug.baz('baz') -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/example/worker.js: -------------------------------------------------------------------------------- 1 | 2 | // DEBUG=* node example/worker 3 | // DEBUG=worker:* node example/worker 4 | // DEBUG=worker:a node example/worker 5 | // DEBUG=worker:b node example/worker 6 | 7 | var a = require('../')('worker:a') 8 | , b = require('../')('worker:b'); 9 | 10 | function work() { 11 | a('doing lots of uninteresting work'); 12 | setTimeout(work, Math.random() * 1000); 13 | } 14 | 15 | work(); 16 | 17 | function workb() { 18 | b('doing some work'); 19 | setTimeout(workb, Math.random() * 2000); 20 | } 21 | 22 | workb(); -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/head.js: -------------------------------------------------------------------------------- 1 | ;(function(){ 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/debug'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/debug/tail.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = debug; 3 | 4 | })(); -------------------------------------------------------------------------------- /node_modules/express/node_modules/fresh/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/fresh/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --reporter spec \ 5 | --require should 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/fresh/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # node-fresh 3 | 4 | HTTP response freshness testing 5 | 6 | ## fresh(req, res) 7 | 8 | Check freshness of `req` and `res` headers. 9 | 10 | When the cache is "fresh" __true__ is returned, 11 | otherwise __false__ is returned to indicate that 12 | the cache is now stale. 13 | 14 | ## Example: 15 | 16 | ```js 17 | var req = { 'if-none-match': 'tobi' }; 18 | var res = { 'etag': 'luna' }; 19 | fresh(req, res); 20 | // => false 21 | 22 | var req = { 'if-none-match': 'tobi' }; 23 | var res = { 'etag': 'tobi' }; 24 | fresh(req, res); 25 | // => true 26 | ``` 27 | 28 | ## Installation 29 | 30 | ``` 31 | $ npm install fresh 32 | ``` -------------------------------------------------------------------------------- /node_modules/express/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 | 32 | // unconditional request 33 | if (!modifiedSince && !noneMatch) return false; 34 | 35 | // parse if-none-match 36 | if (noneMatch) noneMatch = noneMatch.split(/ *, */); 37 | 38 | // if-none-match 39 | if (noneMatch) etagMatches = ~noneMatch.indexOf(etag) || '*' == noneMatch[0]; 40 | 41 | // if-modified-since 42 | if (modifiedSince) { 43 | modifiedSince = new Date(modifiedSince); 44 | lastModified = new Date(lastModified); 45 | notModified = lastModified <= modifiedSince; 46 | } 47 | 48 | return !! (etagMatches && notModified); 49 | } -------------------------------------------------------------------------------- /node_modules/express/node_modules/fresh/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fresh", 3 | "author": { 4 | "name": "TJ Holowaychuk", 5 | "email": "tj@vision-media.ca", 6 | "url": "http://tjholowaychuk.com" 7 | }, 8 | "description": "HTTP response freshness testing", 9 | "version": "0.1.0", 10 | "main": "index.js", 11 | "dependencies": {}, 12 | "devDependencies": { 13 | "mocha": "*", 14 | "should": "*" 15 | }, 16 | "readme": "\n# node-fresh\n\n HTTP response freshness testing\n\n## fresh(req, res)\n\n Check freshness of `req` and `res` headers.\n\n When the cache is \"fresh\" __true__ is returned,\n otherwise __false__ is returned to indicate that\n the cache is now stale.\n\n## Example:\n\n```js\nvar req = { 'if-none-match': 'tobi' };\nvar res = { 'etag': 'luna' };\nfresh(req, res);\n// => false\n\nvar req = { 'if-none-match': 'tobi' };\nvar res = { 'etag': 'tobi' };\nfresh(req, res);\n// => true\n```\n\n## Installation\n\n```\n$ npm install fresh\n```", 17 | "readmeFilename": "Readme.md", 18 | "_id": "fresh@0.1.0", 19 | "dist": { 20 | "shasum": "03e4b0178424e4c2d5d19a54d8814cdc97934850" 21 | }, 22 | "_from": "fresh@0.1.0" 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/methods/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = [ 3 | 'get' 4 | , 'post' 5 | , 'put' 6 | , 'head' 7 | , 'delete' 8 | , 'options' 9 | , 'trace' 10 | , 'copy' 11 | , 'lock' 12 | , 'mkcol' 13 | , 'move' 14 | , 'propfind' 15 | , 'proppatch' 16 | , 'unlock' 17 | , 'report' 18 | , 'mkactivity' 19 | , 'checkout' 20 | , 'merge' 21 | , 'm-search' 22 | , 'notify' 23 | , 'subscribe' 24 | , 'unsubscribe' 25 | , 'patch' 26 | ]; -------------------------------------------------------------------------------- /node_modules/express/node_modules/methods/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "methods", 3 | "version": "0.0.1", 4 | "description": "HTTP methods that node supports", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "http", 11 | "methods" 12 | ], 13 | "author": { 14 | "name": "TJ Holowaychuk" 15 | }, 16 | "license": "MIT", 17 | "_id": "methods@0.0.1", 18 | "readme": "ERROR: No README.md file found!", 19 | "dist": { 20 | "shasum": "277c90f8bef39709645a8371c51c3b6c648e068c" 21 | }, 22 | "_from": "methods@0.0.1" 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/.gitignore.orig: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/.gitignore.rej: -------------------------------------------------------------------------------- 1 | --- /dev/null 2 | +++ .gitignore 3 | @@ -0,0 +1,2 @@ 4 | +node_modules/ 5 | +npm-debug.log -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 James Halliday (mail@substack.net) 2 | 3 | This project is free software released under the MIT/X11 license: 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/README.markdown: -------------------------------------------------------------------------------- 1 | mkdirp 2 | ====== 3 | 4 | Like `mkdir -p`, but in node.js! 5 | 6 | [![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) 7 | 8 | example 9 | ======= 10 | 11 | pow.js 12 | ------ 13 | var mkdirp = require('mkdirp'); 14 | 15 | mkdirp('/tmp/foo/bar/baz', function (err) { 16 | if (err) console.error(err) 17 | else console.log('pow!') 18 | }); 19 | 20 | Output 21 | pow! 22 | 23 | And now /tmp/foo/bar/baz exists, huzzah! 24 | 25 | methods 26 | ======= 27 | 28 | var mkdirp = require('mkdirp'); 29 | 30 | mkdirp(dir, mode, cb) 31 | --------------------- 32 | 33 | Create a new directory and any necessary subdirectories at `dir` with octal 34 | permission string `mode`. 35 | 36 | If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. 37 | 38 | `cb(err, made)` fires with the error or the first directory `made` 39 | that had to be created, if any. 40 | 41 | mkdirp.sync(dir, mode) 42 | ---------------------- 43 | 44 | Synchronously create a new directory and any necessary subdirectories at `dir` 45 | with octal permission string `mode`. 46 | 47 | If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. 48 | 49 | Returns the first directory that had to be created, if any. 50 | 51 | install 52 | ======= 53 | 54 | With [npm](http://npmjs.org) do: 55 | 56 | npm install mkdirp 57 | 58 | license 59 | ======= 60 | 61 | MIT/X11 62 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/examples/pow.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('mkdirp'); 2 | 3 | mkdirp('/tmp/foo/bar/baz', function (err) { 4 | if (err) console.error(err) 5 | else console.log('pow!') 6 | }); 7 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/examples/pow.js.orig: -------------------------------------------------------------------------------- 1 | var mkdirp = require('mkdirp'); 2 | 3 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) { 4 | if (err) console.error(err) 5 | else console.log('pow!') 6 | }); 7 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/examples/pow.js.rej: -------------------------------------------------------------------------------- 1 | --- examples/pow.js 2 | +++ examples/pow.js 3 | @@ -1,6 +1,15 @@ 4 | -var mkdirp = require('mkdirp').mkdirp; 5 | +var mkdirp = require('../').mkdirp, 6 | + mkdirpSync = require('../').mkdirpSync; 7 | 8 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) { 9 | if (err) console.error(err) 10 | else console.log('pow!') 11 | }); 12 | + 13 | +try { 14 | + mkdirpSync('/tmp/bar/foo/baz', 0755); 15 | + console.log('double pow!'); 16 | +} 17 | +catch (ex) { 18 | + console.log(ex); 19 | +} -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mkdirp", 3 | "description": "Recursively mkdir, like `mkdir -p`", 4 | "version": "0.3.3", 5 | "author": { 6 | "name": "James Halliday", 7 | "email": "mail@substack.net", 8 | "url": "http://substack.net" 9 | }, 10 | "main": "./index", 11 | "keywords": [ 12 | "mkdir", 13 | "directory" 14 | ], 15 | "repository": { 16 | "type": "git", 17 | "url": "http://github.com/substack/node-mkdirp.git" 18 | }, 19 | "scripts": { 20 | "test": "tap test/*.js" 21 | }, 22 | "devDependencies": { 23 | "tap": "~0.2.4" 24 | }, 25 | "license": "MIT/X11", 26 | "engines": { 27 | "node": "*" 28 | }, 29 | "readme": "mkdirp\n======\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\nexample\n=======\n\npow.js\n------\n var mkdirp = require('mkdirp');\n \n mkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n });\n\nOutput\n pow!\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\nmethods\n=======\n\nvar mkdirp = require('mkdirp');\n\nmkdirp(dir, mode, cb)\n---------------------\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nmkdirp.sync(dir, mode)\n----------------------\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n npm install mkdirp\n\nlicense\n=======\n\nMIT/X11\n", 30 | "readmeFilename": "README.markdown", 31 | "_id": "mkdirp@0.3.3", 32 | "dist": { 33 | "shasum": "55f3d469ed6dac2b15ba71a69ca9d2bdd166cb01" 34 | }, 35 | "_from": "mkdirp@0.3.3" 36 | } 37 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/chmod.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | var ps = [ '', 'tmp' ]; 7 | 8 | for (var i = 0; i < 25; i++) { 9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | ps.push(dir); 11 | } 12 | 13 | var file = ps.join('/'); 14 | 15 | test('chmod-pre', function (t) { 16 | var mode = 0744 17 | mkdirp(file, mode, function (er) { 18 | t.ifError(er, 'should not error'); 19 | fs.stat(file, function (er, stat) { 20 | t.ifError(er, 'should exist'); 21 | t.ok(stat && stat.isDirectory(), 'should be directory'); 22 | t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); 23 | t.end(); 24 | }); 25 | }); 26 | }); 27 | 28 | test('chmod', function (t) { 29 | var mode = 0755 30 | mkdirp(file, mode, function (er) { 31 | t.ifError(er, 'should not error'); 32 | fs.stat(file, function (er, stat) { 33 | t.ifError(er, 'should exist'); 34 | t.ok(stat && stat.isDirectory(), 'should be directory'); 35 | t.end(); 36 | }); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/clobber.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | var ps = [ '', 'tmp' ]; 7 | 8 | for (var i = 0; i < 25; i++) { 9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | ps.push(dir); 11 | } 12 | 13 | var file = ps.join('/'); 14 | 15 | // a file in the way 16 | var itw = ps.slice(0, 3).join('/'); 17 | 18 | 19 | test('clobber-pre', function (t) { 20 | console.error("about to write to "+itw) 21 | fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); 22 | 23 | fs.stat(itw, function (er, stat) { 24 | t.ifError(er) 25 | t.ok(stat && stat.isFile(), 'should be file') 26 | t.end() 27 | }) 28 | }) 29 | 30 | test('clobber', function (t) { 31 | t.plan(2); 32 | mkdirp(file, 0755, function (err) { 33 | t.ok(err); 34 | t.equal(err.code, 'ENOTDIR'); 35 | t.end(); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/mkdirp.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('woo', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | mkdirp(file, 0755, function (err) { 15 | if (err) t.fail(err); 16 | else path.exists(file, function (ex) { 17 | if (!ex) t.fail('file not created') 18 | else fs.stat(file, function (err, stat) { 19 | if (err) t.fail(err) 20 | else { 21 | t.equal(stat.mode & 0777, 0755); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | t.end(); 24 | } 25 | }) 26 | }) 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/perm.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('async perm', function (t) { 7 | t.plan(2); 8 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); 9 | 10 | mkdirp(file, 0755, function (err) { 11 | if (err) t.fail(err); 12 | else path.exists(file, function (ex) { 13 | if (!ex) t.fail('file not created') 14 | else fs.stat(file, function (err, stat) { 15 | if (err) t.fail(err) 16 | else { 17 | t.equal(stat.mode & 0777, 0755); 18 | t.ok(stat.isDirectory(), 'target not a directory'); 19 | t.end(); 20 | } 21 | }) 22 | }) 23 | }); 24 | }); 25 | 26 | test('async root perm', function (t) { 27 | mkdirp('/tmp', 0755, function (err) { 28 | if (err) t.fail(err); 29 | t.end(); 30 | }); 31 | t.end(); 32 | }); 33 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/perm_sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('sync perm', function (t) { 7 | t.plan(2); 8 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; 9 | 10 | mkdirp.sync(file, 0755); 11 | path.exists(file, function (ex) { 12 | if (!ex) t.fail('file not created') 13 | else fs.stat(file, function (err, stat) { 14 | if (err) t.fail(err) 15 | else { 16 | t.equal(stat.mode & 0777, 0755); 17 | t.ok(stat.isDirectory(), 'target not a directory'); 18 | t.end(); 19 | } 20 | }) 21 | }); 22 | }); 23 | 24 | test('sync root perm', function (t) { 25 | t.plan(1); 26 | 27 | var file = '/tmp'; 28 | mkdirp.sync(file, 0755); 29 | path.exists(file, function (ex) { 30 | if (!ex) t.fail('file not created') 31 | else fs.stat(file, function (err, stat) { 32 | if (err) t.fail(err) 33 | else { 34 | t.ok(stat.isDirectory(), 'target not a directory'); 35 | t.end(); 36 | } 37 | }) 38 | }); 39 | }); 40 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/race.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('race', function (t) { 7 | t.plan(4); 8 | var ps = [ '', 'tmp' ]; 9 | 10 | for (var i = 0; i < 25; i++) { 11 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | ps.push(dir); 13 | } 14 | var file = ps.join('/'); 15 | 16 | var res = 2; 17 | mk(file, function () { 18 | if (--res === 0) t.end(); 19 | }); 20 | 21 | mk(file, function () { 22 | if (--res === 0) t.end(); 23 | }); 24 | 25 | function mk (file, cb) { 26 | mkdirp(file, 0755, function (err) { 27 | if (err) t.fail(err); 28 | else path.exists(file, function (ex) { 29 | if (!ex) t.fail('file not created') 30 | else fs.stat(file, function (err, stat) { 31 | if (err) t.fail(err) 32 | else { 33 | t.equal(stat.mode & 0777, 0755); 34 | t.ok(stat.isDirectory(), 'target not a directory'); 35 | if (cb) cb(); 36 | } 37 | }) 38 | }) 39 | }); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/rel.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('rel', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var cwd = process.cwd(); 13 | process.chdir('/tmp'); 14 | 15 | var file = [x,y,z].join('/'); 16 | 17 | mkdirp(file, 0755, function (err) { 18 | if (err) t.fail(err); 19 | else path.exists(file, function (ex) { 20 | if (!ex) t.fail('file not created') 21 | else fs.stat(file, function (err, stat) { 22 | if (err) t.fail(err) 23 | else { 24 | process.chdir(cwd); 25 | t.equal(stat.mode & 0777, 0755); 26 | t.ok(stat.isDirectory(), 'target not a directory'); 27 | t.end(); 28 | } 29 | }) 30 | }) 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/return.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('return value', function (t) { 7 | t.plan(4); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | // should return the first dir created. 15 | // By this point, it would be profoundly surprising if /tmp didn't 16 | // already exist, since every other test makes things in there. 17 | mkdirp(file, function (err, made) { 18 | t.ifError(err); 19 | t.equal(made, '/tmp/' + x); 20 | mkdirp(file, function (err, made) { 21 | t.ifError(err); 22 | t.equal(made, null); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/return_sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('return value', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | // should return the first dir created. 15 | // By this point, it would be profoundly surprising if /tmp didn't 16 | // already exist, since every other test makes things in there. 17 | // Note that this will throw on failure, which will fail the test. 18 | var made = mkdirp.sync(file); 19 | t.equal(made, '/tmp/' + x); 20 | 21 | // making the same file again should have no effect. 22 | made = mkdirp.sync(file); 23 | t.equal(made, null); 24 | }); 25 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/root.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('root', function (t) { 7 | // '/' on unix, 'c:/' on windows. 8 | var file = path.resolve('/'); 9 | 10 | mkdirp(file, 0755, function (err) { 11 | if (err) throw err 12 | fs.stat(file, function (er, stat) { 13 | if (er) throw er 14 | t.ok(stat.isDirectory(), 'target is a directory'); 15 | t.end(); 16 | }) 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('sync', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | try { 15 | mkdirp.sync(file, 0755); 16 | } catch (err) { 17 | t.fail(err); 18 | return t.end(); 19 | } 20 | 21 | path.exists(file, function (ex) { 22 | if (!ex) t.fail('file not created') 23 | else fs.stat(file, function (err, stat) { 24 | if (err) t.fail(err) 25 | else { 26 | t.equal(stat.mode & 0777, 0755); 27 | t.ok(stat.isDirectory(), 'target not a directory'); 28 | t.end(); 29 | } 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/umask.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('implicit mode from umask', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | mkdirp(file, function (err) { 15 | if (err) t.fail(err); 16 | else path.exists(file, function (ex) { 17 | if (!ex) t.fail('file not created') 18 | else fs.stat(file, function (err, stat) { 19 | if (err) t.fail(err) 20 | else { 21 | t.equal(stat.mode & 0777, 0777 & (~process.umask())); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | t.end(); 24 | } 25 | }) 26 | }) 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/mkdirp/test/umask_sync.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('umask sync modes', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | try { 15 | mkdirp.sync(file); 16 | } catch (err) { 17 | t.fail(err); 18 | return t.end(); 19 | } 20 | 21 | path.exists(file, function (ex) { 22 | if (!ex) t.fail('file not created') 23 | else fs.stat(file, function (err, stat) { 24 | if (err) t.fail(err) 25 | else { 26 | t.equal(stat.mode & 0777, (0777 & (~process.umask()))); 27 | t.ok(stat.isDirectory(), 'target not a directory'); 28 | t.end(); 29 | } 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/range-parser/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/range-parser/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.0.4 / 2012-06-17 3 | ================== 4 | 5 | * changed: ret -1 for unsatisfiable and -2 when invalid 6 | 7 | 0.0.3 / 2012-06-17 8 | ================== 9 | 10 | * fix last-byte-pos default to len - 1 11 | 12 | 0.0.2 / 2012-06-14 13 | ================== 14 | 15 | * add `.type` 16 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/range-parser/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --reporter spec \ 5 | --require should 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/range-parser/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # node-range-parser 3 | 4 | Range header field parser. 5 | 6 | ## Example: 7 | 8 | ```js 9 | assert(-1 == parse(200, 'bytes=500-20')); 10 | assert(-2 == parse(200, 'bytes=malformed')); 11 | parse(200, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 199 }])); 12 | parse(1000, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 499 }])); 13 | parse(1000, 'bytes=40-80').should.eql(arr('bytes', [{ start: 40, end: 80 }])); 14 | parse(1000, 'bytes=-500').should.eql(arr('bytes', [{ start: 500, end: 999 }])); 15 | parse(1000, 'bytes=-400').should.eql(arr('bytes', [{ start: 600, end: 999 }])); 16 | parse(1000, 'bytes=500-').should.eql(arr('bytes', [{ start: 500, end: 999 }])); 17 | parse(1000, 'bytes=400-').should.eql(arr('bytes', [{ start: 400, end: 999 }])); 18 | parse(1000, 'bytes=0-0').should.eql(arr('bytes', [{ start: 0, end: 0 }])); 19 | parse(1000, 'bytes=-1').should.eql(arr('bytes', [{ start: 999, end: 999 }])); 20 | parse(1000, 'items=0-5').should.eql(arr('items', [{ start: 0, end: 5 }])); 21 | parse(1000, 'bytes=40-80,-1').should.eql(arr('bytes', [{ start: 40, end: 80 }, { start: 999, end: 999 }])); 22 | ``` 23 | 24 | ## Installation 25 | 26 | ``` 27 | $ npm install range-parser 28 | ``` -------------------------------------------------------------------------------- /node_modules/express/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 | }; -------------------------------------------------------------------------------- /node_modules/express/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": "0.0.4", 10 | "main": "index.js", 11 | "dependencies": {}, 12 | "devDependencies": { 13 | "mocha": "*", 14 | "should": "*" 15 | }, 16 | "readme": "\n# node-range-parser\n\n Range header field parser.\n\n## Example:\n\n```js\nassert(-1 == parse(200, 'bytes=500-20'));\nassert(-2 == parse(200, 'bytes=malformed'));\nparse(200, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 199 }]));\nparse(1000, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 499 }]));\nparse(1000, 'bytes=40-80').should.eql(arr('bytes', [{ start: 40, end: 80 }]));\nparse(1000, 'bytes=-500').should.eql(arr('bytes', [{ start: 500, end: 999 }]));\nparse(1000, 'bytes=-400').should.eql(arr('bytes', [{ start: 600, end: 999 }]));\nparse(1000, 'bytes=500-').should.eql(arr('bytes', [{ start: 500, end: 999 }]));\nparse(1000, 'bytes=400-').should.eql(arr('bytes', [{ start: 400, end: 999 }]));\nparse(1000, 'bytes=0-0').should.eql(arr('bytes', [{ start: 0, end: 0 }]));\nparse(1000, 'bytes=-1').should.eql(arr('bytes', [{ start: 999, end: 999 }]));\nparse(1000, 'items=0-5').should.eql(arr('items', [{ start: 0, end: 5 }]));\nparse(1000, 'bytes=40-80,-1').should.eql(arr('bytes', [{ start: 40, end: 80 }, { start: 999, end: 999 }]));\n```\n\n## Installation\n\n```\n$ npm install range-parser\n```", 17 | "readmeFilename": "Readme.md", 18 | "_id": "range-parser@0.0.4", 19 | "dist": { 20 | "shasum": "c0427ffef51c10acba0782a46c9602e744ff620b" 21 | }, 22 | "_from": "range-parser@0.0.4" 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/send/.npmignore: -------------------------------------------------------------------------------- 1 | support 2 | test 3 | examples 4 | *.sock 5 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/send/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.1.0 / 2012-08-25 3 | ================== 4 | 5 | * add options parameter to send() that is passed to fs.createReadStream() [kanongil] 6 | 7 | 0.0.4 / 2012-08-16 8 | ================== 9 | 10 | * allow custom "Accept-Ranges" definition 11 | 12 | 0.0.3 / 2012-07-16 13 | ================== 14 | 15 | * fix normalization of the root directory. Closes #3 16 | 17 | 0.0.2 / 2012-07-09 18 | ================== 19 | 20 | * add passing of req explicitly for now (YUCK) 21 | 22 | 0.0.1 / 2010-01-03 23 | ================== 24 | 25 | * Initial release 26 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/send/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --require should \ 5 | --reporter spec \ 6 | --bail 7 | 8 | .PHONY: test -------------------------------------------------------------------------------- /node_modules/express/node_modules/send/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/send'); -------------------------------------------------------------------------------- /node_modules/express/node_modules/send/lib/utils.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Return an ETag in the form of `"-"` 4 | * from the given `stat`. 5 | * 6 | * @param {Object} stat 7 | * @return {String} 8 | * @api private 9 | */ 10 | 11 | exports.etag = function(stat) { 12 | return '"' + stat.size + '-' + Number(stat.mtime) + '"'; 13 | }; 14 | 15 | /** 16 | * decodeURIComponent. 17 | * 18 | * Allows V8 to only deoptimize this fn instead of all 19 | * of send(). 20 | * 21 | * @param {String} path 22 | * @api private 23 | */ 24 | 25 | exports.decode = function(path){ 26 | try { 27 | return decodeURIComponent(path); 28 | } catch (err) { 29 | return -1; 30 | } 31 | }; 32 | 33 | /** 34 | * Escape the given string of `html`. 35 | * 36 | * @param {String} html 37 | * @return {String} 38 | * @api private 39 | */ 40 | 41 | exports.escape = function(html){ 42 | return String(html) 43 | .replace(/&(?!\w+;)/g, '&') 44 | .replace(//g, '>') 46 | .replace(/"/g, '"'); 47 | }; -------------------------------------------------------------------------------- /node_modules/express/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/express/node_modules/send/node_modules/mime/README.md: -------------------------------------------------------------------------------- 1 | # mime 2 | 3 | Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. 4 | 5 | ## Install 6 | 7 | Install with [npm](http://github.com/isaacs/npm): 8 | 9 | npm install mime 10 | 11 | ## API - Queries 12 | 13 | ### mime.lookup(path) 14 | Get the mime type associated with a file. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. 15 | 16 | var mime = require('mime'); 17 | 18 | mime.lookup('/path/to/file.txt'); // => 'text/plain' 19 | mime.lookup('file.txt'); // => 'text/plain' 20 | mime.lookup('.TXT'); // => 'text/plain' 21 | mime.lookup('htm'); // => 'text/html' 22 | 23 | ### mime.extension(type) 24 | Get the default extension for `type` 25 | 26 | mime.extension('text/html'); // => 'html' 27 | mime.extension('application/octet-stream'); // => 'bin' 28 | 29 | ### mime.charsets.lookup() 30 | 31 | Map mime-type to charset 32 | 33 | mime.charsets.lookup('text/plain'); // => 'UTF-8' 34 | 35 | (The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) 36 | 37 | ## API - Defining Custom Types 38 | 39 | The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/bentomas/node-mime/wiki/Requesting-New-Types). 40 | 41 | ### mime.define() 42 | 43 | Add custom mime/extension mappings 44 | 45 | mime.define({ 46 | 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], 47 | 'application/x-my-type': ['x-mt', 'x-mtt'], 48 | // etc ... 49 | }); 50 | 51 | mime.lookup('x-sft'); // => 'text/x-some-format' 52 | 53 | The first entry in the extensions array is returned by `mime.extension()`. E.g. 54 | 55 | mime.extension('text/x-some-format'); // => 'x-sf' 56 | 57 | ### mime.load(filepath) 58 | 59 | Load mappings from an Apache ".types" format file 60 | 61 | mime.load('./my_project.types'); 62 | 63 | The .types file format is simple - See the `types` dir for examples. 64 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/send/node_modules/mime/test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Usage: node test.js 3 | */ 4 | 5 | var mime = require('./mime'); 6 | var assert = require('assert'); 7 | 8 | function eq(a, b) { 9 | console.log('Test: ' + a + ' === ' + b); 10 | assert.strictEqual.apply(null, arguments); 11 | } 12 | 13 | console.log(Object.keys(mime.extensions).length + ' types'); 14 | console.log(Object.keys(mime.types).length + ' extensions\n'); 15 | 16 | // 17 | // Test mime lookups 18 | // 19 | 20 | eq('text/plain', mime.lookup('text.txt')); 21 | eq('text/plain', mime.lookup('.text.txt')); 22 | eq('text/plain', mime.lookup('.txt')); 23 | eq('text/plain', mime.lookup('txt')); 24 | eq('application/octet-stream', mime.lookup('text.nope')); 25 | eq('fallback', mime.lookup('text.fallback', 'fallback')); 26 | eq('application/octet-stream', mime.lookup('constructor')); 27 | eq('text/plain', mime.lookup('TEXT.TXT')); 28 | eq('text/event-stream', mime.lookup('text/event-stream')); 29 | eq('application/x-web-app-manifest+json', mime.lookup('text.webapp')); 30 | 31 | // 32 | // Test extensions 33 | // 34 | 35 | eq('txt', mime.extension(mime.types.text)); 36 | eq('html', mime.extension(mime.types.htm)); 37 | eq('bin', mime.extension('application/octet-stream')); 38 | eq(undefined, mime.extension('constructor')); 39 | 40 | // 41 | // Test node types 42 | // 43 | 44 | eq('application/octet-stream', mime.lookup('file.buffer')); 45 | eq('audio/mp4', mime.lookup('file.m4a')); 46 | 47 | // 48 | // Test charsets 49 | // 50 | 51 | eq('UTF-8', mime.charsets.lookup('text/plain')); 52 | eq(undefined, mime.charsets.lookup(mime.types.js)); 53 | eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); 54 | 55 | console.log('\nOK'); 56 | -------------------------------------------------------------------------------- /node_modules/express/node_modules/send/node_modules/mime/types/node.types: -------------------------------------------------------------------------------- 1 | # What: Google Chrome Extension 2 | # Why: To allow apps to (work) be served with the right content type header. 3 | # http://codereview.chromium.org/2830017 4 | # Added by: niftylettuce 5 | application/x-chrome-extension crx 6 | 7 | # What: OTF Message Silencer 8 | # Why: To silence the "Resource interpreted as font but transferred with MIME 9 | # type font/otf" message that occurs in Google Chrome 10 | # Added by: niftylettuce 11 | font/opentype otf 12 | 13 | # What: HTC support 14 | # Why: To properly render .htc files such as CSS3PIE 15 | # Added by: niftylettuce 16 | text/x-component htc 17 | 18 | # What: HTML5 application cache manifest 19 | # Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps 20 | # per https://developer.mozilla.org/en/offline_resources_in_firefox 21 | # Added by: louisremi 22 | text/cache-manifest appcache manifest 23 | 24 | # What: node binary buffer format 25 | # Why: semi-standard extension w/in the node community 26 | # Added by: tootallnate 27 | application/octet-stream buffer 28 | 29 | # What: The "protected" MP-4 formats used by iTunes. 30 | # Why: Required for streaming music to browsers (?) 31 | # Added by: broofa 32 | application/mp4 m4p 33 | audio/mp4 m4a 34 | 35 | # What: Music playlist format (http://en.wikipedia.org/wiki/M3U) 36 | # Why: See https://github.com/bentomas/node-mime/pull/6 37 | # Added by: mjrusso 38 | application/x-mpegURL m3u8 39 | 40 | # What: Video format, Part of RFC1890 41 | # Why: See https://github.com/bentomas/node-mime/pull/6 42 | # Added by: mjrusso 43 | video/MP2T ts 44 | 45 | # What: The FLAC lossless codec format 46 | # Why: Streaming and serving FLAC audio 47 | # Added by: jacobrask 48 | audio/flac flac 49 | 50 | # What: EventSource mime type 51 | # Why: mime type of Server-Sent Events stream 52 | # http://www.w3.org/TR/eventsource/#text-event-stream 53 | # Added by: francois2metz 54 | text/event-stream event-stream 55 | 56 | # What: Mozilla App manifest mime type 57 | # Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests 58 | # Added by: ednapiranha 59 | application/x-web-app-manifest+json webapp 60 | 61 | # What: Matroska Mime Types 62 | # Why: http://en.wikipedia.org/wiki/Matroska 63 | # Added by: aduncan88 64 | video/x-matroska mkv 65 | audio/x-matroska mka 66 | -------------------------------------------------------------------------------- /node_modules/express/test.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var express = require('./') 7 | , app = express() 8 | 9 | console.log(express.json()); 10 | app.use(express.favicon()); 11 | app.use(express.logger('dev')); 12 | app.use(express.cookieParser('foobar')); 13 | app.use(express.session()); 14 | 15 | app.get('/', function(req, res){ 16 | res.send('hello'); 17 | }); 18 | 19 | app.listen(3000); 20 | console.log('listening on 3000'); -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var express = require('express'), 2 | app = express(); 3 | 4 | app.use(express.static(__dirname)); 5 | 6 | app.post('/test/data/valid.js', function(req, res) { 7 | res.sendfile('test/data/valid.js') 8 | }); 9 | 10 | app.post('/test/data/valid_batch.js', function(req, res) { 11 | res.sendfile('test/data/valid_batch.js') 12 | }); 13 | 14 | app.post('/test/data/invalid.js', function(req, res) { 15 | res.sendfile('test/data/invalid.js') 16 | }); 17 | 18 | app.listen(3000); 19 | -------------------------------------------------------------------------------- /test/data/invalid.js: -------------------------------------------------------------------------------- 1 | {"jsonrpc": "1.0","result":[],"error":null} 2 | -------------------------------------------------------------------------------- /test/data/invalid_batch.js: -------------------------------------------------------------------------------- 1 | {"jsonrpc": "1.0","result":[],"error":null} 2 | -------------------------------------------------------------------------------- /test/data/valid.js: -------------------------------------------------------------------------------- 1 | {"jsonrpc": "2.0","result":[],"error":null} 2 | -------------------------------------------------------------------------------- /test/data/valid_batch.js: -------------------------------------------------------------------------------- 1 | {"jsonrpc": "2.0","result":[],"error":null} 2 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

    jQuery JSON RPC 2.0 plugin specs

    13 |

    14 |

    15 |
      16 |
      17 | 18 | 19 | --------------------------------------------------------------------------------