Browse Source

version 0.0.1 - HTTP & SocketIo services on server

frtk 4 years ago
parent
commit
edd511b402
100 changed files with 20715 additions and 0 deletions
  1. 21
    0
      LICENSE
  2. 58
    0
      nodePong.js
  3. 23
    0
      node_modules/colors/LICENSE
  4. 178
    0
      node_modules/colors/ReadMe.md
  5. 74
    0
      node_modules/colors/examples/normal-usage.js
  6. 76
    0
      node_modules/colors/examples/safe-string.js
  7. 187
    0
      node_modules/colors/lib/colors.js
  8. 45
    0
      node_modules/colors/lib/custom/trap.js
  9. 104
    0
      node_modules/colors/lib/custom/zalgo.js
  10. 113
    0
      node_modules/colors/lib/extendStringPrototype.js
  11. 12
    0
      node_modules/colors/lib/index.js
  12. 12
    0
      node_modules/colors/lib/maps/america.js
  13. 13
    0
      node_modules/colors/lib/maps/rainbow.js
  14. 8
    0
      node_modules/colors/lib/maps/random.js
  15. 5
    0
      node_modules/colors/lib/maps/zebra.js
  16. 77
    0
      node_modules/colors/lib/styles.js
  17. 61
    0
      node_modules/colors/lib/system/supports-colors.js
  18. 58
    0
      node_modules/colors/package.json
  19. 9
    0
      node_modules/colors/safe.js
  20. 12
    0
      node_modules/colors/themes/generic-logging.js
  21. 3062
    0
      node_modules/express/History.md
  22. 24
    0
      node_modules/express/LICENSE
  23. 138
    0
      node_modules/express/Readme.md
  24. 11
    0
      node_modules/express/index.js
  25. 643
    0
      node_modules/express/lib/application.js
  26. 103
    0
      node_modules/express/lib/express.js
  27. 36
    0
      node_modules/express/lib/middleware/init.js
  28. 51
    0
      node_modules/express/lib/middleware/query.js
  29. 489
    0
      node_modules/express/lib/request.js
  30. 1053
    0
      node_modules/express/lib/response.js
  31. 645
    0
      node_modules/express/lib/router/index.js
  32. 176
    0
      node_modules/express/lib/router/layer.js
  33. 210
    0
      node_modules/express/lib/router/route.js
  34. 300
    0
      node_modules/express/lib/utils.js
  35. 173
    0
      node_modules/express/lib/view.js
  36. 170
    0
      node_modules/express/node_modules/accepts/HISTORY.md
  37. 23
    0
      node_modules/express/node_modules/accepts/LICENSE
  38. 135
    0
      node_modules/express/node_modules/accepts/README.md
  39. 231
    0
      node_modules/express/node_modules/accepts/index.js
  40. 183
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/HISTORY.md
  41. 23
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/LICENSE
  42. 103
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/README.md
  43. 188
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/index.js
  44. 306
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/HISTORY.md
  45. 22
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/LICENSE
  46. 82
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/README.md
  47. 6552
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/db.json
  48. 11
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/index.js
  49. 93
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/package.json
  50. 83
    0
      node_modules/express/node_modules/accepts/node_modules/mime-types/package.json
  51. 76
    0
      node_modules/express/node_modules/accepts/node_modules/negotiator/HISTORY.md
  52. 24
    0
      node_modules/express/node_modules/accepts/node_modules/negotiator/LICENSE
  53. 203
    0
      node_modules/express/node_modules/accepts/node_modules/negotiator/README.md
  54. 62
    0
      node_modules/express/node_modules/accepts/node_modules/negotiator/index.js
  55. 102
    0
      node_modules/express/node_modules/accepts/node_modules/negotiator/lib/charset.js
  56. 118
    0
      node_modules/express/node_modules/accepts/node_modules/negotiator/lib/encoding.js
  57. 112
    0
      node_modules/express/node_modules/accepts/node_modules/negotiator/lib/language.js
  58. 179
    0
      node_modules/express/node_modules/accepts/node_modules/negotiator/lib/mediaType.js
  59. 85
    0
      node_modules/express/node_modules/accepts/node_modules/negotiator/package.json
  60. 97
    0
      node_modules/express/node_modules/accepts/package.json
  61. 21
    0
      node_modules/express/node_modules/array-flatten/LICENSE
  62. 43
    0
      node_modules/express/node_modules/array-flatten/README.md
  63. 64
    0
      node_modules/express/node_modules/array-flatten/array-flatten.js
  64. 61
    0
      node_modules/express/node_modules/array-flatten/package.json
  65. 45
    0
      node_modules/express/node_modules/content-disposition/HISTORY.md
  66. 22
    0
      node_modules/express/node_modules/content-disposition/LICENSE
  67. 141
    0
      node_modules/express/node_modules/content-disposition/README.md
  68. 445
    0
      node_modules/express/node_modules/content-disposition/index.js
  69. 65
    0
      node_modules/express/node_modules/content-disposition/package.json
  70. 9
    0
      node_modules/express/node_modules/content-type/HISTORY.md
  71. 22
    0
      node_modules/express/node_modules/content-type/LICENSE
  72. 92
    0
      node_modules/express/node_modules/content-type/README.md
  73. 214
    0
      node_modules/express/node_modules/content-type/index.js
  74. 64
    0
      node_modules/express/node_modules/content-type/package.json
  75. 4
    0
      node_modules/express/node_modules/cookie-signature/.npmignore
  76. 38
    0
      node_modules/express/node_modules/cookie-signature/History.md
  77. 42
    0
      node_modules/express/node_modules/cookie-signature/Readme.md
  78. 51
    0
      node_modules/express/node_modules/cookie-signature/index.js
  79. 58
    0
      node_modules/express/node_modules/cookie-signature/package.json
  80. 72
    0
      node_modules/express/node_modules/cookie/HISTORY.md
  81. 24
    0
      node_modules/express/node_modules/cookie/LICENSE
  82. 64
    0
      node_modules/express/node_modules/cookie/README.md
  83. 156
    0
      node_modules/express/node_modules/cookie/index.js
  84. 75
    0
      node_modules/express/node_modules/cookie/package.json
  85. 3
    0
      node_modules/express/node_modules/debug/.jshintrc
  86. 6
    0
      node_modules/express/node_modules/debug/.npmignore
  87. 195
    0
      node_modules/express/node_modules/debug/History.md
  88. 36
    0
      node_modules/express/node_modules/debug/Makefile
  89. 188
    0
      node_modules/express/node_modules/debug/Readme.md
  90. 28
    0
      node_modules/express/node_modules/debug/bower.json
  91. 168
    0
      node_modules/express/node_modules/debug/browser.js
  92. 19
    0
      node_modules/express/node_modules/debug/component.json
  93. 197
    0
      node_modules/express/node_modules/debug/debug.js
  94. 209
    0
      node_modules/express/node_modules/debug/node.js
  95. 5
    0
      node_modules/express/node_modules/debug/node_modules/ms/.npmignore
  96. 66
    0
      node_modules/express/node_modules/debug/node_modules/ms/History.md
  97. 20
    0
      node_modules/express/node_modules/debug/node_modules/ms/LICENSE
  98. 35
    0
      node_modules/express/node_modules/debug/node_modules/ms/README.md
  99. 125
    0
      node_modules/express/node_modules/debug/node_modules/ms/index.js
  100. 0
    0
      node_modules/express/node_modules/debug/node_modules/ms/package.json

+ 21
- 0
LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2015 Duco Winterwerp
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 all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
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 THE
21
+SOFTWARE.

+ 58
- 0
nodePong.js View File

@@ -0,0 +1,58 @@
1
+/**
2
+ * @file nodePong.js
3
+ * @author frtk
4
+ */
5
+
6
+
7
+/*
8
+ * nodejs modules
9
+ */
10
+//--- 
11
+var fs = require('fs');
12
+var colors = require('colors');
13
+var express = require('express');
14
+var http = require('http');
15
+var iosocket = require('socket.io');
16
+//--- server app libs & params
17
+var servU = require('./server/server_utils.js');
18
+var servP = require('./server/server_params.js');  
19
+
20
+
21
+/*
22
+ * starting HTTP and socket.io services
23
+ */
24
+//---
25
+serverMsg("$ ##### nodePong - v0.0.1 ");
26
+
27
+//--- HTTP server
28
+serverMsg("$ # starting http service on port " + servP.params.port);
29
+var app = express();
30
+var httpserv = http.createServer(app);
31
+httpserv.listen(servP.params.port);
32
+//--- allow access to static files from "/public" directory
33
+app.use(express.static(__dirname + '/public/'));
34
+
35
+//--- socket.io
36
+serverMsg('$ # registering socket.io service on port ' + servP.params.port);  
37
+var io = require('socket.io').listen(httpserv, {log: false});
38
+
39
+serverMsg('$ #####');
40
+
41
+
42
+
43
+
44
+/*
45
+ * running nodePong server
46
+ */
47
+//---
48
+
49
+
50
+
51
+
52
+
53
+/*                                                                                                      
54
+ * FUNCTIONS 
55
+ */
56
+function serverMsg(msg) {
57
+  return console.log((servU.datelib.newDateToString() + msg).yellow);
58
+} 

+ 23
- 0
node_modules/colors/LICENSE View File

@@ -0,0 +1,23 @@
1
+Original Library
2
+  - Copyright (c) Marak Squires
3
+
4
+Additional Functionality
5
+ - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
6
+
7
+Permission is hereby granted, free of charge, to any person obtaining a copy
8
+of this software and associated documentation files (the "Software"), to deal
9
+in the Software without restriction, including without limitation the rights
10
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+copies of the Software, and to permit persons to whom the Software is
12
+furnished to do so, subject to the following conditions:
13
+
14
+The above copyright notice and this permission notice shall be included in
15
+all copies or substantial portions of the Software.
16
+
17
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+THE SOFTWARE.

+ 178
- 0
node_modules/colors/ReadMe.md View File

@@ -0,0 +1,178 @@
1
+# colors.js [![Build Status](https://travis-ci.org/Marak/colors.js.svg?branch=master)](https://travis-ci.org/Marak/colors.js)
2
+
3
+## get color and style in your node.js console
4
+
5
+![Demo](https://raw.githubusercontent.com/Marak/colors.js/master/screenshots/colors.png)
6
+
7
+## Installation
8
+
9
+    npm install colors
10
+
11
+## colors and styles!
12
+
13
+### text colors
14
+
15
+  - black
16
+  - red
17
+  - green
18
+  - yellow
19
+  - blue
20
+  - magenta
21
+  - cyan
22
+  - white
23
+  - gray
24
+  - grey
25
+
26
+### background colors
27
+
28
+  - bgBlack
29
+  - bgRed
30
+  - bgGreen
31
+  - bgYellow
32
+  - bgBlue
33
+  - bgMagenta
34
+  - bgCyan
35
+  - bgWhite
36
+
37
+### styles
38
+
39
+  - reset
40
+  - bold
41
+  - dim
42
+  - italic
43
+  - underline
44
+  - inverse
45
+  - hidden
46
+  - strikethrough
47
+
48
+### extras
49
+
50
+  - rainbow
51
+  - zebra
52
+  - america
53
+  - trap
54
+  - random
55
+
56
+
57
+## Usage
58
+
59
+By popular demand, `colors` now ships with two types of usages!
60
+
61
+The super nifty way
62
+
63
+```js
64
+var colors = require('colors');
65
+
66
+console.log('hello'.green); // outputs green text
67
+console.log('i like cake and pies'.underline.red) // outputs red underlined text
68
+console.log('inverse the color'.inverse); // inverses the color
69
+console.log('OMG Rainbows!'.rainbow); // rainbow
70
+console.log('Run the trap'.trap); // Drops the bass
71
+
72
+```
73
+
74
+or a slightly less nifty way which doesn't extend `String.prototype`
75
+
76
+```js
77
+var colors = require('colors/safe');
78
+
79
+console.log(colors.green('hello')); // outputs green text
80
+console.log(colors.red.underline('i like cake and pies')) // outputs red underlined text
81
+console.log(colors.inverse('inverse the color')); // inverses the color
82
+console.log(colors.rainbow('OMG Rainbows!')); // rainbow
83
+console.log(colors.trap('Run the trap')); // Drops the bass
84
+
85
+```
86
+
87
+I prefer the first way. Some people seem to be afraid of extending `String.prototype` and prefer the second way. 
88
+
89
+If you are writing good code you will never have an issue with the first approach. If you really don't want to touch `String.prototype`, the second usage will not touch `String` native object.
90
+
91
+## Disabling Colors
92
+
93
+To disable colors you can pass the following arguments in the command line to your application:
94
+
95
+```bash
96
+node myapp.js --no-color
97
+```
98
+
99
+## Console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data)
100
+
101
+```js
102
+var name = 'Marak';
103
+console.log(colors.green('Hello %s'), name);
104
+// outputs -> 'Hello Marak'
105
+```
106
+
107
+## Custom themes
108
+
109
+### Using standard API
110
+
111
+```js
112
+
113
+var colors = require('colors');
114
+
115
+colors.setTheme({
116
+  silly: 'rainbow',
117
+  input: 'grey',
118
+  verbose: 'cyan',
119
+  prompt: 'grey',
120
+  info: 'green',
121
+  data: 'grey',
122
+  help: 'cyan',
123
+  warn: 'yellow',
124
+  debug: 'blue',
125
+  error: 'red'
126
+});
127
+
128
+// outputs red text
129
+console.log("this is an error".error);
130
+
131
+// outputs yellow text
132
+console.log("this is a warning".warn);
133
+```
134
+
135
+### Using string safe API
136
+
137
+```js
138
+var colors = require('colors/safe');
139
+
140
+// set single property
141
+var error = colors.red;
142
+error('this is red');
143
+
144
+// set theme
145
+colors.setTheme({
146
+  silly: 'rainbow',
147
+  input: 'grey',
148
+  verbose: 'cyan',
149
+  prompt: 'grey',
150
+  info: 'green',
151
+  data: 'grey',
152
+  help: 'cyan',
153
+  warn: 'yellow',
154
+  debug: 'blue',
155
+  error: 'red'
156
+});
157
+
158
+// outputs red text
159
+console.log(colors.error("this is an error"));
160
+
161
+// outputs yellow text
162
+console.log(colors.warn("this is a warning"));
163
+
164
+```
165
+
166
+You can also combine them:
167
+
168
+```javascript
169
+var colors = require('colors');
170
+
171
+colors.setTheme({
172
+  custom: ['red', 'underline']
173
+});
174
+
175
+console.log('test'.custom);
176
+```
177
+
178
+*Protip: There is a secret undocumented style in `colors`. If you find the style you can summon him.*

+ 74
- 0
node_modules/colors/examples/normal-usage.js View File

@@ -0,0 +1,74 @@
1
+var colors = require('../lib/index');
2
+
3
+console.log("First some yellow text".yellow);
4
+
5
+console.log("Underline that text".yellow.underline);
6
+
7
+console.log("Make it bold and red".red.bold);
8
+
9
+console.log(("Double Raindows All Day Long").rainbow)
10
+
11
+console.log("Drop the bass".trap)
12
+
13
+console.log("DROP THE RAINBOW BASS".trap.rainbow)
14
+
15
+
16
+console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
17
+
18
+console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse + ' styles! '.yellow.bold); // styles not widely supported
19
+console.log("Zebras are so fun!".zebra);
20
+
21
+//
22
+// Remark: .strikethrough may not work with Mac OS Terminal App
23
+//
24
+console.log("This is " + "not".strikethrough + " fun.");
25
+
26
+console.log('Background color attack!'.black.bgWhite)
27
+console.log('Use random styles on everything!'.random)
28
+console.log('America, Heck Yeah!'.america)
29
+
30
+
31
+console.log('Setting themes is useful')
32
+
33
+//
34
+// Custom themes
35
+//
36
+console.log('Generic logging theme as JSON'.green.bold.underline);
37
+// Load theme with JSON literal
38
+colors.setTheme({
39
+  silly: 'rainbow',
40
+  input: 'grey',
41
+  verbose: 'cyan',
42
+  prompt: 'grey',
43
+  info: 'green',
44
+  data: 'grey',
45
+  help: 'cyan',
46
+  warn: 'yellow',
47
+  debug: 'blue',
48
+  error: 'red'
49
+});
50
+
51
+// outputs red text
52
+console.log("this is an error".error);
53
+
54
+// outputs yellow text
55
+console.log("this is a warning".warn);
56
+
57
+// outputs grey text
58
+console.log("this is an input".input);
59
+
60
+console.log('Generic logging theme as file'.green.bold.underline);
61
+
62
+// Load a theme from file
63
+colors.setTheme(__dirname + '/../themes/generic-logging.js');
64
+
65
+// outputs red text
66
+console.log("this is an error".error);
67
+
68
+// outputs yellow text
69
+console.log("this is a warning".warn);
70
+
71
+// outputs grey text
72
+console.log("this is an input".input);
73
+
74
+//console.log("Don't summon".zalgo)

+ 76
- 0
node_modules/colors/examples/safe-string.js View File

@@ -0,0 +1,76 @@
1
+var colors = require('../safe');
2
+
3
+console.log(colors.yellow("First some yellow text"));
4
+
5
+console.log(colors.yellow.underline("Underline that text"));
6
+
7
+console.log(colors.red.bold("Make it bold and red"));
8
+
9
+console.log(colors.rainbow("Double Raindows All Day Long"))
10
+
11
+console.log(colors.trap("Drop the bass"))
12
+
13
+console.log(colors.rainbow(colors.trap("DROP THE RAINBOW BASS")));
14
+
15
+console.log(colors.bold.italic.underline.red('Chains are also cool.')); // styles not widely supported
16
+
17
+
18
+console.log(colors.green('So ') + colors.underline('are') + ' ' + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); // styles not widely supported
19
+
20
+console.log(colors.zebra("Zebras are so fun!"));
21
+
22
+console.log("This is " + colors.strikethrough("not") + " fun.");
23
+
24
+
25
+console.log(colors.black.bgWhite('Background color attack!'));
26
+console.log(colors.random('Use random styles on everything!'))
27
+console.log(colors.america('America, Heck Yeah!'));
28
+
29
+console.log('Setting themes is useful')
30
+
31
+//
32
+// Custom themes
33
+//
34
+//console.log('Generic logging theme as JSON'.green.bold.underline);
35
+// Load theme with JSON literal
36
+colors.setTheme({
37
+  silly: 'rainbow',
38
+  input: 'grey',
39
+  verbose: 'cyan',
40
+  prompt: 'grey',
41
+  info: 'green',
42
+  data: 'grey',
43
+  help: 'cyan',
44
+  warn: 'yellow',
45
+  debug: 'blue',
46
+  error: 'red'
47
+});
48
+
49
+// outputs red text
50
+console.log(colors.error("this is an error"));
51
+
52
+// outputs yellow text
53
+console.log(colors.warn("this is a warning"));
54
+
55
+// outputs grey text
56
+console.log(colors.input("this is an input"));
57
+
58
+
59
+// console.log('Generic logging theme as file'.green.bold.underline);
60
+
61
+// Load a theme from file
62
+colors.setTheme(__dirname + '/../themes/generic-logging.js');
63
+
64
+// outputs red text
65
+console.log(colors.error("this is an error"));
66
+
67
+// outputs yellow text
68
+console.log(colors.warn("this is a warning"));
69
+
70
+// outputs grey text
71
+console.log(colors.input("this is an input"));
72
+
73
+// console.log(colors.zalgo("Don't summon him"))
74
+
75
+
76
+

+ 187
- 0
node_modules/colors/lib/colors.js View File

@@ -0,0 +1,187 @@
1
+/*
2
+
3
+The MIT License (MIT)
4
+
5
+Original Library 
6
+  - Copyright (c) Marak Squires
7
+
8
+Additional functionality
9
+ - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
10
+
11
+Permission is hereby granted, free of charge, to any person obtaining a copy
12
+of this software and associated documentation files (the "Software"), to deal
13
+in the Software without restriction, including without limitation the rights
14
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+copies of the Software, and to permit persons to whom the Software is
16
+furnished to do so, subject to the following conditions:
17
+
18
+The above copyright notice and this permission notice shall be included in
19
+all copies or substantial portions of the Software.
20
+
21
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
+THE SOFTWARE.
28
+
29
+*/
30
+
31
+var colors = {};
32
+module['exports'] = colors;
33
+
34
+colors.themes = {};
35
+
36
+var ansiStyles = colors.styles = require('./styles');
37
+var defineProps = Object.defineProperties;
38
+
39
+colors.supportsColor = require('./system/supports-colors');
40
+
41
+if (typeof colors.enabled === "undefined") {
42
+  colors.enabled = colors.supportsColor;
43
+}
44
+
45
+colors.stripColors = colors.strip = function(str){
46
+  return ("" + str).replace(/\x1B\[\d+m/g, '');
47
+};
48
+
49
+
50
+var stylize = colors.stylize = function stylize (str, style) {
51
+  if (!colors.enabled) {
52
+    return str+'';
53
+  }
54
+
55
+  return ansiStyles[style].open + str + ansiStyles[style].close;
56
+}
57
+
58
+var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
59
+var escapeStringRegexp = function (str) {
60
+  if (typeof str !== 'string') {
61
+    throw new TypeError('Expected a string');
62
+  }
63
+  return str.replace(matchOperatorsRe,  '\\$&');
64
+}
65
+
66
+function build(_styles) {
67
+  var builder = function builder() {
68
+    return applyStyle.apply(builder, arguments);
69
+  };
70
+  builder._styles = _styles;
71
+  // __proto__ is used because we must return a function, but there is
72
+  // no way to create a function with a different prototype.
73
+  builder.__proto__ = proto;
74
+  return builder;
75
+}
76
+
77
+var styles = (function () {
78
+  var ret = {};
79
+  ansiStyles.grey = ansiStyles.gray;
80
+  Object.keys(ansiStyles).forEach(function (key) {
81
+    ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
82
+    ret[key] = {
83
+      get: function () {
84
+        return build(this._styles.concat(key));
85
+      }
86
+    };
87
+  });
88
+  return ret;
89
+})();
90
+
91
+var proto = defineProps(function colors() {}, styles);
92
+
93
+function applyStyle() {
94
+  var args = arguments;
95
+  var argsLen = args.length;
96
+  var str = argsLen !== 0 && String(arguments[0]);
97
+  if (argsLen > 1) {
98
+    for (var a = 1; a < argsLen; a++) {
99
+      str += ' ' + args[a];
100
+    }
101
+  }
102
+
103
+  if (!colors.enabled || !str) {
104
+    return str;
105
+  }
106
+
107
+  var nestedStyles = this._styles;
108
+
109
+  var i = nestedStyles.length;
110
+  while (i--) {
111
+    var code = ansiStyles[nestedStyles[i]];
112
+    str = code.open + str.replace(code.closeRe, code.open) + code.close;
113
+  }
114
+
115
+  return str;
116
+}
117
+
118
+function applyTheme (theme) {
119
+  for (var style in theme) {
120
+    (function(style){
121
+      colors[style] = function(str){
122
+        if (typeof theme[style] === 'object'){
123
+          var out = str;
124
+          for (var i in theme[style]){
125
+            out = colors[theme[style][i]](out);
126
+          }
127
+          return out;
128
+        }
129
+        return colors[theme[style]](str);
130
+      };
131
+    })(style)
132
+  }
133
+}
134
+
135
+colors.setTheme = function (theme) {
136
+  if (typeof theme === 'string') {
137
+    try {
138
+      colors.themes[theme] = require(theme);
139
+      applyTheme(colors.themes[theme]);
140
+      return colors.themes[theme];
141
+    } catch (err) {
142
+      console.log(err);
143
+      return err;
144
+    }
145
+  } else {
146
+    applyTheme(theme);
147
+  }
148
+};
149
+
150
+function init() {
151
+  var ret = {};
152
+  Object.keys(styles).forEach(function (name) {
153
+    ret[name] = {
154
+      get: function () {
155
+        return build([name]);
156
+      }
157
+    };
158
+  });
159
+  return ret;
160
+}
161
+
162
+var sequencer = function sequencer (map, str) {
163
+  var exploded = str.split(""), i = 0;
164
+  exploded = exploded.map(map);
165
+  return exploded.join("");
166
+};
167
+
168
+// custom formatter methods
169
+colors.trap = require('./custom/trap');
170
+colors.zalgo = require('./custom/zalgo');
171
+
172
+// maps
173
+colors.maps = {};
174
+colors.maps.america = require('./maps/america');
175
+colors.maps.zebra = require('./maps/zebra');
176
+colors.maps.rainbow = require('./maps/rainbow');
177
+colors.maps.random = require('./maps/random')
178
+
179
+for (var map in colors.maps) {
180
+  (function(map){
181
+    colors[map] = function (str) {
182
+      return sequencer(colors.maps[map], str);
183
+    }
184
+  })(map)
185
+}
186
+
187
+defineProps(colors, init());

+ 45
- 0
node_modules/colors/lib/custom/trap.js View File

@@ -0,0 +1,45 @@
1
+module['exports'] = function runTheTrap (text, options) {
2
+  var result = "";
3
+  text = text || "Run the trap, drop the bass";
4
+  text = text.split('');
5
+  var trap = {
6
+    a: ["\u0040", "\u0104", "\u023a", "\u0245", "\u0394", "\u039b", "\u0414"],
7
+    b: ["\u00df", "\u0181", "\u0243", "\u026e", "\u03b2", "\u0e3f"],
8
+    c: ["\u00a9", "\u023b", "\u03fe"],
9
+    d: ["\u00d0", "\u018a", "\u0500" , "\u0501" ,"\u0502", "\u0503"],
10
+    e: ["\u00cb", "\u0115", "\u018e", "\u0258", "\u03a3", "\u03be", "\u04bc", "\u0a6c"],
11
+    f: ["\u04fa"],
12
+    g: ["\u0262"],
13
+    h: ["\u0126", "\u0195", "\u04a2", "\u04ba", "\u04c7", "\u050a"],
14
+    i: ["\u0f0f"],
15
+    j: ["\u0134"],
16
+    k: ["\u0138", "\u04a0", "\u04c3", "\u051e"],
17
+    l: ["\u0139"],
18
+    m: ["\u028d", "\u04cd", "\u04ce", "\u0520", "\u0521", "\u0d69"],
19
+    n: ["\u00d1", "\u014b", "\u019d", "\u0376", "\u03a0", "\u048a"],
20
+    o: ["\u00d8", "\u00f5", "\u00f8", "\u01fe", "\u0298", "\u047a", "\u05dd", "\u06dd", "\u0e4f"],
21
+    p: ["\u01f7", "\u048e"],
22
+    q: ["\u09cd"],
23
+    r: ["\u00ae", "\u01a6", "\u0210", "\u024c", "\u0280", "\u042f"],
24
+    s: ["\u00a7", "\u03de", "\u03df", "\u03e8"],
25
+    t: ["\u0141", "\u0166", "\u0373"],
26
+    u: ["\u01b1", "\u054d"],
27
+    v: ["\u05d8"],
28
+    w: ["\u0428", "\u0460", "\u047c", "\u0d70"],
29
+    x: ["\u04b2", "\u04fe", "\u04fc", "\u04fd"],
30
+    y: ["\u00a5", "\u04b0", "\u04cb"],
31
+    z: ["\u01b5", "\u0240"]
32
+  }
33
+  text.forEach(function(c){
34
+    c = c.toLowerCase();
35
+    var chars = trap[c] || [" "];
36
+    var rand = Math.floor(Math.random() * chars.length);
37
+    if (typeof trap[c] !== "undefined") {
38
+      result += trap[c][rand];
39
+    } else {
40
+      result += c;
41
+    }
42
+  });
43
+  return result;
44
+
45
+}

+ 104
- 0
node_modules/colors/lib/custom/zalgo.js View File

@@ -0,0 +1,104 @@
1
+// please no
2
+module['exports'] = function zalgo(text, options) {
3
+  text = text || "   he is here   ";
4
+  var soul = {
5
+    "up" : [
6
+      '̍', '̎', '̄', '̅',
7
+      '̿', '̑', '̆', '̐',
8
+      '͒', '͗', '͑', '̇',
9
+      '̈', '̊', '͂', '̓',
10
+      '̈', '͊', '͋', '͌',
11
+      '̃', '̂', '̌', '͐',
12
+      '̀', '́', '̋', '̏',
13
+      '̒', '̓', '̔', '̽',
14
+      '̉', 'ͣ', 'ͤ', 'ͥ',
15
+      'ͦ', 'ͧ', 'ͨ', 'ͩ',
16
+      'ͪ', 'ͫ', 'ͬ', 'ͭ',
17
+      'ͮ', 'ͯ', '̾', '͛',
18
+      '͆', '̚'
19
+    ],
20
+    "down" : [
21
+      '̖', '̗', '̘', '̙',
22
+      '̜', '̝', '̞', '̟',
23
+      '̠', '̤', '̥', '̦',
24
+      '̩', '̪', '̫', '̬',
25
+      '̭', '̮', '̯', '̰',
26
+      '̱', '̲', '̳', '̹',
27
+      '̺', '̻', '̼', 'ͅ',
28
+      '͇', '͈', '͉', '͍',
29
+      '͎', '͓', '͔', '͕',
30
+      '͖', '͙', '͚', '̣'
31
+    ],
32
+    "mid" : [
33
+      '̕', '̛', '̀', '́',
34
+      '͘', '̡', '̢', '̧',
35
+      '̨', '̴', '̵', '̶',
36
+      '͜', '͝', '͞',
37
+      '͟', '͠', '͢', '̸',
38
+      '̷', '͡', ' ҉'
39
+    ]
40
+  },
41
+  all = [].concat(soul.up, soul.down, soul.mid),
42
+  zalgo = {};
43
+
44
+  function randomNumber(range) {
45
+    var r = Math.floor(Math.random() * range);
46
+    return r;
47
+  }
48
+
49
+  function is_char(character) {
50
+    var bool = false;
51
+    all.filter(function (i) {
52
+      bool = (i === character);
53
+    });
54
+    return bool;
55
+  }
56
+  
57
+
58
+  function heComes(text, options) {
59
+    var result = '', counts, l;
60
+    options = options || {};
61
+    options["up"] =   typeof options["up"]   !== 'undefined' ? options["up"]   : true;
62
+    options["mid"] =  typeof options["mid"]  !== 'undefined' ? options["mid"]  : true;
63
+    options["down"] = typeof options["down"] !== 'undefined' ? options["down"] : true;
64
+    options["size"] = typeof options["size"] !== 'undefined' ? options["size"] : "maxi";
65
+    text = text.split('');
66
+    for (l in text) {
67
+      if (is_char(l)) {
68
+        continue;
69
+      }
70
+      result = result + text[l];
71
+      counts = {"up" : 0, "down" : 0, "mid" : 0};
72
+      switch (options.size) {
73
+      case 'mini':
74
+        counts.up = randomNumber(8);
75
+        counts.mid = randomNumber(2);
76
+        counts.down = randomNumber(8);
77
+        break;
78
+      case 'maxi':
79
+        counts.up = randomNumber(16) + 3;
80
+        counts.mid = randomNumber(4) + 1;
81
+        counts.down = randomNumber(64) + 3;
82
+        break;
83
+      default:
84
+        counts.up = randomNumber(8) + 1;
85
+        counts.mid = randomNumber(6) / 2;
86
+        counts.down = randomNumber(8) + 1;
87
+        break;
88
+      }
89
+
90
+      var arr = ["up", "mid", "down"];
91
+      for (var d in arr) {
92
+        var index = arr[d];
93
+        for (var i = 0 ; i <= counts[index]; i++) {
94
+          if (options[index]) {
95
+            result = result + soul[index][randomNumber(soul[index].length)];
96
+          }
97
+        }
98
+      }
99
+    }
100
+    return result;
101
+  }
102
+  // don't summon him
103
+  return heComes(text, options);
104
+}

+ 113
- 0
node_modules/colors/lib/extendStringPrototype.js View File

@@ -0,0 +1,113 @@
1
+var colors = require('./colors');
2
+
3
+module['exports'] = function () {
4
+
5
+  //
6
+  // Extends prototype of native string object to allow for "foo".red syntax
7
+  //
8
+  var addProperty = function (color, func) {
9
+    String.prototype.__defineGetter__(color, func);
10
+  };
11
+
12
+  var sequencer = function sequencer (map, str) {
13
+      return function () {
14
+        var exploded = this.split(""), i = 0;
15
+        exploded = exploded.map(map);
16
+        return exploded.join("");
17
+      }
18
+  };
19
+
20
+  addProperty('strip', function () {
21
+    return colors.strip(this);
22
+  });
23
+
24
+  addProperty('stripColors', function () {
25
+    return colors.strip(this);
26
+  });
27
+
28
+  addProperty("trap", function(){
29
+    return colors.trap(this);
30
+  });
31
+
32
+  addProperty("zalgo", function(){
33
+    return colors.zalgo(this);
34
+  });
35
+
36
+  addProperty("zebra", function(){
37
+    return colors.zebra(this);
38
+  });
39
+
40
+  addProperty("rainbow", function(){
41
+    return colors.rainbow(this);
42
+  });
43
+
44
+  addProperty("random", function(){
45
+    return colors.random(this);
46
+  });
47
+
48
+  addProperty("america", function(){
49
+    return colors.america(this);
50
+  });
51
+
52
+  //
53
+  // Iterate through all default styles and colors
54
+  //
55
+  var x = Object.keys(colors.styles);
56
+  x.forEach(function (style) {
57
+    addProperty(style, function () {
58
+      return colors.stylize(this, style);
59
+    });
60
+  });
61
+
62
+  function applyTheme(theme) {
63
+    //
64
+    // Remark: This is a list of methods that exist
65
+    // on String that you should not overwrite.
66
+    //
67
+    var stringPrototypeBlacklist = [
68
+      '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor',
69
+      'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt',
70
+      'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring',
71
+      'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight'
72
+    ];
73
+
74
+    Object.keys(theme).forEach(function (prop) {
75
+      if (stringPrototypeBlacklist.indexOf(prop) !== -1) {
76
+        console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name');
77
+      }
78
+      else {
79
+        if (typeof(theme[prop]) === 'string') {
80
+          colors[prop] = colors[theme[prop]];
81
+          addProperty(prop, function () {
82
+            return colors[theme[prop]](this);
83
+          });
84
+        }
85
+        else {
86
+          addProperty(prop, function () {
87
+            var ret = this;
88
+            for (var t = 0; t < theme[prop].length; t++) {
89
+              ret = colors[theme[prop][t]](ret);
90
+            }
91
+            return ret;
92
+          });
93
+        }
94
+      }
95
+    });
96
+  }
97
+
98
+  colors.setTheme = function (theme) {
99
+    if (typeof theme === 'string') {
100
+      try {
101
+        colors.themes[theme] = require(theme);
102
+        applyTheme(colors.themes[theme]);
103
+        return colors.themes[theme];
104
+      } catch (err) {
105
+        console.log(err);
106
+        return err;
107
+      }
108
+    } else {
109
+      applyTheme(theme);
110
+    }
111
+  };
112
+
113
+};

+ 12
- 0
node_modules/colors/lib/index.js View File

@@ -0,0 +1,12 @@
1
+var colors = require('./colors');
2
+module['exports'] = colors;
3
+
4
+// Remark: By default, colors will add style properties to String.prototype
5
+//
6
+// If you don't wish to extend String.prototype you can do this instead and native String will not be touched
7
+//
8
+//   var colors = require('colors/safe);
9
+//   colors.red("foo")
10
+//
11
+//
12
+require('./extendStringPrototype')();

+ 12
- 0
node_modules/colors/lib/maps/america.js View File

@@ -0,0 +1,12 @@
1
+var colors = require('../colors');
2
+
3
+module['exports'] = (function() {
4
+  return function (letter, i, exploded) {
5
+    if(letter === " ") return letter;
6
+    switch(i%3) {
7
+      case 0: return colors.red(letter);
8
+      case 1: return colors.white(letter)
9
+      case 2: return colors.blue(letter)
10
+    }
11
+  }
12
+})();

+ 13
- 0
node_modules/colors/lib/maps/rainbow.js View File

@@ -0,0 +1,13 @@
1
+var colors = require('../colors');
2
+
3
+module['exports'] = (function () {
4
+  var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV
5
+  return function (letter, i, exploded) {
6
+    if (letter === " ") {
7
+      return letter;
8
+    } else {
9
+      return colors[rainbowColors[i++ % rainbowColors.length]](letter);
10
+    }
11
+  };
12
+})();
13
+

+ 8
- 0
node_modules/colors/lib/maps/random.js View File

@@ -0,0 +1,8 @@
1
+var colors = require('../colors');
2
+
3
+module['exports'] = (function () {
4
+  var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
5
+  return function(letter, i, exploded) {
6
+    return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter);
7
+  };
8
+})();

+ 5
- 0
node_modules/colors/lib/maps/zebra.js View File

@@ -0,0 +1,5 @@
1
+var colors = require('../colors');
2
+
3
+module['exports'] = function (letter, i, exploded) {
4
+  return i % 2 === 0 ? letter : colors.inverse(letter);
5
+};

+ 77
- 0
node_modules/colors/lib/styles.js View File

@@ -0,0 +1,77 @@
1
+/*
2
+The MIT License (MIT)
3
+
4
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
5
+
6
+Permission is hereby granted, free of charge, to any person obtaining a copy
7
+of this software and associated documentation files (the "Software"), to deal
8
+in the Software without restriction, including without limitation the rights
9
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+copies of the Software, and to permit persons to whom the Software is
11
+furnished to do so, subject to the following conditions:
12
+
13
+The above copyright notice and this permission notice shall be included in
14
+all copies or substantial portions of the Software.
15
+
16
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+THE SOFTWARE.
23
+
24
+*/
25
+
26
+var styles = {};
27
+module['exports'] = styles;
28
+
29
+var codes = {
30
+  reset: [0, 0],
31
+
32
+  bold: [1, 22],
33
+  dim: [2, 22],
34
+  italic: [3, 23],
35
+  underline: [4, 24],
36
+  inverse: [7, 27],
37
+  hidden: [8, 28],
38
+  strikethrough: [9, 29],
39
+
40
+  black: [30, 39],
41
+  red: [31, 39],
42
+  green: [32, 39],
43
+  yellow: [33, 39],
44
+  blue: [34, 39],
45
+  magenta: [35, 39],
46
+  cyan: [36, 39],
47
+  white: [37, 39],
48
+  gray: [90, 39],
49
+  grey: [90, 39],
50
+
51
+  bgBlack: [40, 49],
52
+  bgRed: [41, 49],
53
+  bgGreen: [42, 49],
54
+  bgYellow: [43, 49],
55
+  bgBlue: [44, 49],
56
+  bgMagenta: [45, 49],
57
+  bgCyan: [46, 49],
58
+  bgWhite: [47, 49],
59
+
60
+  // legacy styles for colors pre v1.0.0
61
+  blackBG: [40, 49],
62
+  redBG: [41, 49],
63
+  greenBG: [42, 49],
64
+  yellowBG: [43, 49],
65
+  blueBG: [44, 49],
66
+  magentaBG: [45, 49],
67
+  cyanBG: [46, 49],
68
+  whiteBG: [47, 49]
69
+
70
+};
71
+
72
+Object.keys(codes).forEach(function (key) {
73
+  var val = codes[key];
74
+  var style = styles[key] = [];
75
+  style.open = '\u001b[' + val[0] + 'm';
76
+  style.close = '\u001b[' + val[1] + 'm';
77
+});

+ 61
- 0
node_modules/colors/lib/system/supports-colors.js View File

@@ -0,0 +1,61 @@
1
+/*
2
+The MIT License (MIT)
3
+
4
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
5
+
6
+Permission is hereby granted, free of charge, to any person obtaining a copy
7
+of this software and associated documentation files (the "Software"), to deal
8
+in the Software without restriction, including without limitation the rights
9
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+copies of the Software, and to permit persons to whom the Software is
11
+furnished to do so, subject to the following conditions:
12
+
13
+The above copyright notice and this permission notice shall be included in
14
+all copies or substantial portions of the Software.
15
+
16
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+THE SOFTWARE.
23
+
24
+*/
25
+
26
+var argv = process.argv;
27
+
28
+module.exports = (function () {
29
+  if (argv.indexOf('--no-color') !== -1 ||
30
+    argv.indexOf('--color=false') !== -1) {
31
+    return false;
32
+  }
33
+
34
+  if (argv.indexOf('--color') !== -1 ||
35
+    argv.indexOf('--color=true') !== -1 ||
36
+    argv.indexOf('--color=always') !== -1) {
37
+    return true;
38
+  }
39
+
40
+  if (process.stdout && !process.stdout.isTTY) {
41
+    return false;
42
+  }
43
+
44
+  if (process.platform === 'win32') {
45
+    return true;
46
+  }
47
+
48
+  if ('COLORTERM' in process.env) {
49
+    return true;
50
+  }
51
+
52
+  if (process.env.TERM === 'dumb') {
53
+    return false;
54
+  }
55
+
56
+  if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
57
+    return true;
58
+  }
59
+
60
+  return false;
61
+})();

+ 58
- 0
node_modules/colors/package.json View File

@@ -0,0 +1,58 @@
1
+{
2
+  "name": "colors",
3
+  "description": "get colors in your node.js console",
4
+  "version": "1.1.2",
5
+  "author": {
6
+    "name": "Marak Squires"
7
+  },
8
+  "homepage": "https://github.com/Marak/colors.js",
9
+  "bugs": {
10
+    "url": "https://github.com/Marak/colors.js/issues"
11
+  },
12
+  "keywords": [
13
+    "ansi",
14
+    "terminal",
15
+    "colors"
16
+  ],
17
+  "repository": {
18
+    "type": "git",
19
+    "url": "http://github.com/Marak/colors.js.git"
20
+  },
21
+  "license": "MIT",
22
+  "scripts": {
23
+    "test": "node tests/basic-test.js && node tests/safe-test.js"
24
+  },
25
+  "engines": {
26
+    "node": ">=0.1.90"
27
+  },
28
+  "main": "lib",
29
+  "files": [
30
+    "examples",
31
+    "lib",
32
+    "LICENSE",
33
+    "safe.js",
34
+    "themes"
35
+  ],
36
+  "gitHead": "8bf2ad9fa695dcb30b7e9fd83691b139fd6655c4",
37
+  "_id": "colors@1.1.2",
38
+  "_shasum": "168a4701756b6a7f51a12ce0c97bfa28c084ed63",
39
+  "_from": "colors@",
40
+  "_npmVersion": "2.1.8",
41
+  "_nodeVersion": "0.11.13",
42
+  "_npmUser": {
43
+    "name": "marak",
44
+    "email": "marak.squires@gmail.com"
45
+  },
46
+  "maintainers": [
47
+    {
48
+      "name": "marak",
49
+      "email": "marak.squires@gmail.com"
50
+    }
51
+  ],
52
+  "dist": {
53
+    "shasum": "168a4701756b6a7f51a12ce0c97bfa28c084ed63",
54
+    "tarball": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz"
55
+  },
56
+  "directories": {},
57
+  "_resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz"
58
+}

+ 9
- 0
node_modules/colors/safe.js View File

@@ -0,0 +1,9 @@
1
+//
2
+// Remark: Requiring this file will use the "safe" colors API which will not touch String.prototype
3
+//
4
+//   var colors = require('colors/safe);
5
+//   colors.red("foo")
6
+//
7
+//
8
+var colors = require('./lib/colors');
9
+module['exports'] = colors;

+ 12
- 0
node_modules/colors/themes/generic-logging.js View File

@@ -0,0 +1,12 @@
1
+module['exports'] = {
2
+  silly: 'rainbow',
3
+  input: 'grey',
4
+  verbose: 'cyan',
5
+  prompt: 'grey',
6
+  info: 'green',
7
+  data: 'grey',
8
+  help: 'cyan',
9
+  warn: 'yellow',
10
+  debug: 'blue',
11
+  error: 'red'
12
+};

+ 3062
- 0
node_modules/express/History.md
File diff suppressed because it is too large
View File


+ 24
- 0
node_modules/express/LICENSE View File

@@ -0,0 +1,24 @@
1
+(The MIT License)
2
+
3
+Copyright (c) 2009-2014 TJ Holowaychuk <tj@vision-media.ca>
4
+Copyright (c) 2013-2014 Roman Shtylman <shtylman+expressjs@gmail.com>
5
+Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com>
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.

+ 138
- 0
node_modules/express/Readme.md View File

@@ -0,0 +1,138 @@
1
+[![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/)
2
+
3
+  Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).
4
+
5
+  [![NPM Version][npm-image]][npm-url]
6
+  [![NPM Downloads][downloads-image]][downloads-url]
7
+  [![Linux Build][travis-image]][travis-url]
8
+  [![Windows Build][appveyor-image]][appveyor-url]
9
+  [![Test Coverage][coveralls-image]][coveralls-url]
10
+
11
+```js
12
+var express = require('express')
13
+var app = express()
14
+
15
+app.get('/', function (req, res) {
16
+  res.send('Hello World')
17
+})
18
+
19
+app.listen(3000)
20
+```
21
+
22
+## Installation
23
+
24
+```bash
25
+$ npm install express
26
+```
27
+
28
+## Features
29
+
30
+  * Robust routing
31
+  * Focus on high performance
32
+  * Super-high test coverage
33
+  * HTTP helpers (redirection, caching, etc)
34
+  * View system supporting 14+ template engines
35
+  * Content negotiation
36
+  * Executable for generating applications quickly
37
+
38
+## Docs & Community
39
+
40
+  * [#express](https://webchat.freenode.net/?channels=express) on freenode IRC
41
+  * [Github Organization](https://github.com/expressjs) for Official Middleware & Modules
42
+  * [Google Group](https://groups.google.com/group/express-js) for discussion
43
+  * [Gitter](https://gitter.im/expressjs/express) for support and discussion
44
+  * [Русскоязычная документация](http://jsman.ru/express/)
45
+
46
+###Security Issues
47
+
48
+If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).
49
+
50
+## Quick Start
51
+
52
+  The quickest way to get started with express is to utilize the executable [`express(1)`](https://github.com/expressjs/generator) to generate an application as shown below:
53
+
54
+  Install the executable. The executable's major version will match Express's:
55
+
56
+```bash
57
+$ npm install -g express-generator@4
58
+```
59
+
60
+  Create the app:
61
+
62
+```bash
63
+$ express /tmp/foo && cd /tmp/foo
64
+```
65
+
66
+  Install dependencies:
67
+
68
+```bash
69
+$ npm install
70
+```
71
+
72
+  Start the server:
73
+
74
+```bash
75
+$ npm start
76
+```
77
+
78
+## Philosophy
79
+
80
+  The Express philosophy is to provide small, robust tooling for HTTP servers, making
81
+  it a great solution for single page applications, web sites, hybrids, or public
82
+  HTTP APIs.
83
+
84
+  Express does not force you to use any specific ORM or template engine. With support for over
85
+  14 template engines via [Consolidate.js](https://github.com/tj/consolidate.js),
86
+  you can quickly craft your perfect framework.
87
+
88
+## Examples
89
+
90
+  To view the examples, clone the Express repo and install the dependencies:
91
+
92
+```bash
93
+$ git clone git://github.com/expressjs/express.git --depth 1
94
+$ cd express
95
+$ npm install
96
+```
97
+
98
+  Then run whichever example you want:
99
+
100
+```bash
101
+$ node examples/content-negotiation
102
+```
103
+
104
+## Tests
105
+
106
+  To run the test suite, first install the dependencies, then run `npm test`:
107
+
108
+```bash
109
+$ npm install
110
+$ npm test
111
+```
112
+
113
+## People
114
+
115
+The original author of Express is [TJ Holowaychuk](https://github.com/tj) [![TJ's Gratipay][gratipay-image-visionmedia]][gratipay-url-visionmedia]
116
+
117
+The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson) [![Doug's Gratipay][gratipay-image-dougwilson]][gratipay-url-dougwilson]
118
+
119
+[List of all contributors](https://github.com/expressjs/express/graphs/contributors)
120
+
121
+## License
122
+
123
+  [MIT](LICENSE)
124
+
125
+[npm-image]: https://img.shields.io/npm/v/express.svg
126
+[npm-url]: https://npmjs.org/package/express
127
+[downloads-image]: https://img.shields.io/npm/dm/express.svg
128
+[downloads-url]: https://npmjs.org/package/express
129
+[travis-image]: https://img.shields.io/travis/expressjs/express/master.svg?label=linux
130
+[travis-url]: https://travis-ci.org/expressjs/express
131
+[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows
132
+[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
133
+[coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg
134
+[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master
135
+[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg
136
+[gratipay-url-visionmedia]: https://gratipay.com/visionmedia/
137
+[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg
138
+[gratipay-url-dougwilson]: https://gratipay.com/dougwilson/

+ 11
- 0
node_modules/express/index.js View File

@@ -0,0 +1,11 @@
1
+/*!
2
+ * express
3
+ * Copyright(c) 2009-2013 TJ Holowaychuk
4
+ * Copyright(c) 2013 Roman Shtylman
5
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
6
+ * MIT Licensed
7
+ */
8
+
9
+'use strict';
10
+
11
+module.exports = require('./lib/express');

+ 643
- 0
node_modules/express/lib/application.js View File

@@ -0,0 +1,643 @@
1
+/*!
2
+ * express
3
+ * Copyright(c) 2009-2013 TJ Holowaychuk
4
+ * Copyright(c) 2013 Roman Shtylman
5
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
6
+ * MIT Licensed
7
+ */
8
+
9
+'use strict';
10
+
11
+/**
12
+ * Module dependencies.
13
+ * @private
14
+ */
15
+
16
+var finalhandler = require('finalhandler');
17
+var Router = require('./router');
18
+var methods = require('methods');
19
+var middleware = require('./middleware/init');
20
+var query = require('./middleware/query');
21
+var debug = require('debug')('express:application');
22
+var View = require('./view');
23
+var http = require('http');
24
+var compileETag = require('./utils').compileETag;
25
+var compileQueryParser = require('./utils').compileQueryParser;
26
+var compileTrust = require('./utils').compileTrust;
27
+var deprecate = require('depd')('express');
28
+var flatten = require('array-flatten');
29
+var merge = require('utils-merge');
30
+var resolve = require('path').resolve;
31
+var slice = Array.prototype.slice;
32
+
33
+/**
34
+ * Application prototype.
35
+ */
36
+
37
+var app = exports = module.exports = {};
38
+
39
+/**
40
+ * Variable for trust proxy inheritance back-compat
41
+ * @private
42
+ */
43
+
44
+var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default';
45
+
46
+/**
47
+ * Initialize the server.
48
+ *
49
+ *   - setup default configuration
50
+ *   - setup default middleware
51
+ *   - setup route reflection methods
52
+ *
53
+ * @private
54
+ */
55
+
56
+app.init = function init() {
57
+  this.cache = {};
58
+  this.engines = {};
59
+  this.settings = {};
60
+
61
+  this.defaultConfiguration();
62
+};
63
+
64
+/**
65
+ * Initialize application configuration.
66
+ * @private
67
+ */
68
+
69
+app.defaultConfiguration = function defaultConfiguration() {
70
+  var env = process.env.NODE_ENV || 'development';
71
+
72
+  // default settings
73
+  this.enable('x-powered-by');
74
+  this.set('etag', 'weak');
75
+  this.set('env', env);
76
+  this.set('query parser', 'extended');
77
+  this.set('subdomain offset', 2);
78
+  this.set('trust proxy', false);
79
+
80
+  // trust proxy inherit back-compat
81
+  Object.defineProperty(this.settings, trustProxyDefaultSymbol, {
82
+    configurable: true,
83
+    value: true
84
+  });
85
+
86
+  debug('booting in %s mode', env);
87
+
88
+  this.on('mount', function onmount(parent) {
89
+    // inherit trust proxy
90
+    if (this.settings[trustProxyDefaultSymbol] === true
91
+      && typeof parent.settings['trust proxy fn'] === 'function') {
92
+      delete this.settings['trust proxy'];
93
+      delete this.settings['trust proxy fn'];
94
+    }
95
+
96
+    // inherit protos
97
+    this.request.__proto__ = parent.request;
98
+    this.response.__proto__ = parent.response;
99
+    this.engines.__proto__ = parent.engines;
100
+    this.settings.__proto__ = parent.settings;
101
+  });
102
+
103
+  // setup locals
104
+  this.locals = Object.create(null);
105
+
106
+  // top-most app is mounted at /
107
+  this.mountpath = '/';
108
+
109
+  // default locals
110
+  this.locals.settings = this.settings;
111
+
112
+  // default configuration
113
+  this.set('view', View);
114
+  this.set('views', resolve('views'));
115
+  this.set('jsonp callback name', 'callback');
116
+
117
+  if (env === 'production') {
118
+    this.enable('view cache');
119
+  }
120
+
121
+  Object.defineProperty(this, 'router', {
122
+    get: function() {
123
+      throw new Error('\'app.router\' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.');
124
+    }
125
+  });
126
+};
127
+
128
+/**
129
+ * lazily adds the base router if it has not yet been added.
130
+ *
131
+ * We cannot add the base router in the defaultConfiguration because
132
+ * it reads app settings which might be set after that has run.
133
+ *
134
+ * @private
135
+ */
136
+app.lazyrouter = function lazyrouter() {
137
+  if (!this._router) {
138
+    this._router = new Router({
139
+      caseSensitive: this.enabled('case sensitive routing'),
140
+      strict: this.enabled('strict routing')
141
+    });
142
+
143
+    this._router.use(query(this.get('query parser fn')));
144
+    this._router.use(middleware.init(this));
145
+  }
146
+};
147
+
148
+/**
149
+ * Dispatch a req, res pair into the application. Starts pipeline processing.
150
+ *
151
+ * If no callback is provided, then default error handlers will respond
152
+ * in the event of an error bubbling through the stack.
153
+ *
154
+ * @private
155
+ */
156
+
157
+app.handle = function handle(req, res, callback) {
158
+  var router = this._router;
159
+
160
+  // final handler
161
+  var done = callback || finalhandler(req, res, {
162
+    env: this.get('env'),
163
+    onerror: logerror.bind(this)
164
+  });
165
+
166
+  // no routes
167
+  if (!router) {
168
+    debug('no routes defined on app');
169
+    done();
170
+    return;
171
+  }
172
+
173
+  router.handle(req, res, done);
174
+};
175
+
176
+/**
177
+ * Proxy `Router#use()` to add middleware to the app router.
178
+ * See Router#use() documentation for details.
179
+ *
180
+ * If the _fn_ parameter is an express app, then it will be
181
+ * mounted at the _route_ specified.
182
+ *
183
+ * @public
184
+ */
185
+
186
+app.use = function use(fn) {
187
+  var offset = 0;
188
+  var path = '/';
189
+
190
+  // default path to '/'
191
+  // disambiguate app.use([fn])
192
+  if (typeof fn !== 'function') {
193
+    var arg = fn;
194
+
195
+    while (Array.isArray(arg) && arg.length !== 0) {
196
+      arg = arg[0];
197
+    }
198
+
199
+    // first arg is the path
200
+    if (typeof arg !== 'function') {
201
+      offset = 1;
202
+      path = fn;
203
+    }
204
+  }
205
+
206
+  var fns = flatten(slice.call(arguments, offset));
207
+
208
+  if (fns.length === 0) {
209
+    throw new TypeError('app.use() requires middleware functions');
210
+  }
211
+
212
+  // setup router
213
+  this.lazyrouter();
214
+  var router = this._router;
215
+
216
+  fns.forEach(function (fn) {
217
+    // non-express app
218
+    if (!fn || !fn.handle || !fn.set) {
219
+      return router.use(path, fn);
220
+    }
221
+
222
+    debug('.use app under %s', path);
223
+    fn.mountpath = path;
224
+    fn.parent = this;
225
+
226
+    // restore .app property on req and res
227
+    router.use(path, function mounted_app(req, res, next) {
228
+      var orig = req.app;
229
+      fn.handle(req, res, function (err) {
230
+        req.__proto__ = orig.request;
231
+        res.__proto__ = orig.response;
232
+        next(err);
233
+      });
234
+    });
235
+
236
+    // mounted an app
237
+    fn.emit('mount', this);
238
+  }, this);
239
+
240
+  return this;
241
+};
242
+
243
+/**
244
+ * Proxy to the app `Router#route()`
245
+ * Returns a new `Route` instance for the _path_.
246
+ *
247
+ * Routes are isolated middleware stacks for specific paths.
248
+ * See the Route api docs for details.
249
+ *
250
+ * @public
251
+ */
252
+
253
+app.route = function route(path) {
254
+  this.lazyrouter();
255
+  return this._router.route(path);
256
+};
257
+
258
+/**
259
+ * Register the given template engine callback `fn`
260
+ * as `ext`.
261
+ *
262
+ * By default will `require()` the engine based on the
263
+ * file extension. For example if you try to render
264
+ * a "foo.jade" file Express will invoke the following internally:
265
+ *
266
+ *     app.engine('jade', require('jade').__express);
267
+ *
268
+ * For engines that do not provide `.__express` out of the box,
269
+ * or if you wish to "map" a different extension to the template engine
270
+ * you may use this method. For example mapping the EJS template engine to
271
+ * ".html" files:
272
+ *
273
+ *     app.engine('html', require('ejs').renderFile);
274
+ *
275
+ * In this case EJS provides a `.renderFile()` method with
276
+ * the same signature that Express expects: `(path, options, callback)`,
277
+ * though note that it aliases this method as `ejs.__express` internally
278
+ * so if you're using ".ejs" extensions you dont need to do anything.
279
+ *
280
+ * Some template engines do not follow this convention, the
281
+ * [Consolidate.js](https://github.com/tj/consolidate.js)
282
+ * library was created to map all of node's popular template
283
+ * engines to follow this convention, thus allowing them to
284
+ * work seamlessly within Express.
285
+ *
286
+ * @param {String} ext
287
+ * @param {Function} fn
288
+ * @return {app} for chaining
289
+ * @public
290
+ */
291
+
292
+app.engine = function engine(ext, fn) {
293
+  if (typeof fn !== 'function') {
294
+    throw new Error('callback function required');
295
+  }
296
+
297
+  // get file extension
298
+  var extension = ext[0] !== '.'
299
+    ? '.' + ext
300
+    : ext;
301
+
302
+  // store engine
303
+  this.engines[extension] = fn;
304
+
305
+  return this;
306
+};
307
+
308
+/**
309
+ * Proxy to `Router#param()` with one added api feature. The _name_ parameter
310
+ * can be an array of names.
311
+ *
312
+ * See the Router#param() docs for more details.
313
+ *
314
+ * @param {String|Array} name
315
+ * @param {Function} fn
316
+ * @return {app} for chaining
317
+ * @public
318
+ */
319
+
320
+app.param = function param(name, fn) {
321
+  this.lazyrouter();
322
+
323
+  if (Array.isArray(name)) {
324
+    for (var i = 0; i < name.length; i++) {
325
+      this.param(name[i], fn);
326
+    }
327
+
328
+    return this;
329
+  }
330
+
331
+  this._router.param(name, fn);
332
+
333
+  return this;
334
+};
335
+
336
+/**
337
+ * Assign `setting` to `val`, or return `setting`'s value.
338
+ *
339
+ *    app.set('foo', 'bar');
340
+ *    app.get('foo');
341
+ *    // => "bar"
342
+ *
343
+ * Mounted servers inherit their parent server's settings.
344
+ *
345
+ * @param {String} setting
346
+ * @param {*} [val]
347
+ * @return {Server} for chaining
348
+ * @public
349
+ */
350
+
351
+app.set = function set(setting, val) {
352
+  if (arguments.length === 1) {
353
+    // app.get(setting)
354
+    return this.settings[setting];
355
+  }
356
+
357
+  debug('set "%s" to %o', setting, val);
358
+
359
+  // set value
360
+  this.settings[setting] = val;
361
+
362
+  // trigger matched settings
363
+  switch (setting) {
364
+    case 'etag':
365
+      this.set('etag fn', compileETag(val));
366
+      break;
367
+    case 'query parser':
368
+      this.set('query parser fn', compileQueryParser(val));
369
+      break;
370
+    case 'trust proxy':
371
+      this.set('trust proxy fn', compileTrust(val));
372
+
373
+      // trust proxy inherit back-compat
374
+      Object.defineProperty(this.settings, trustProxyDefaultSymbol, {
375
+        configurable: true,
376
+        value: false
377
+      });
378
+
379
+      break;
380
+  }
381
+
382
+  return this;
383
+};
384
+
385
+/**
386
+ * Return the app's absolute pathname
387
+ * based on the parent(s) that have
388
+ * mounted it.
389
+ *
390
+ * For example if the application was
391
+ * mounted as "/admin", which itself
392
+ * was mounted as "/blog" then the
393
+ * return value would be "/blog/admin".
394
+ *
395
+ * @return {String}
396
+ * @private
397
+ */
398
+
399
+app.path = function path() {
400
+  return this.parent
401
+    ? this.parent.path() + this.mountpath
402
+    : '';
403
+};
404
+
405
+/**
406
+ * Check if `setting` is enabled (truthy).
407
+ *
408
+ *    app.enabled('foo')
409
+ *    // => false
410
+ *
411
+ *    app.enable('foo')
412
+ *    app.enabled('foo')
413
+ *    // => true
414
+ *
415
+ * @param {String} setting
416
+ * @return {Boolean}
417
+ * @public
418
+ */
419
+
420
+app.enabled = function enabled(setting) {
421
+  return Boolean(this.set(setting));
422
+};
423
+
424
+/**
425
+ * Check if `setting` is disabled.
426
+ *
427
+ *    app.disabled('foo')
428
+ *    // => true
429
+ *
430
+ *    app.enable('foo')
431
+ *    app.disabled('foo')
432
+ *    // => false
433
+ *
434
+ * @param {String} setting
435
+ * @return {Boolean}
436
+ * @public
437
+ */
438
+
439
+app.disabled = function disabled(setting) {
440
+  return !this.set(setting);
441
+};
442
+
443
+/**
444
+ * Enable `setting`.
445
+ *
446
+ * @param {String} setting
447
+ * @return {app} for chaining
448
+ * @public
449
+ */
450
+
451
+app.enable = function enable(setting) {
452
+  return this.set(setting, true);
453
+};
454
+
455
+/**
456
+ * Disable `setting`.
457
+ *
458
+ * @param {String} setting
459
+ * @return {app} for chaining
460
+ * @public
461
+ */
462
+
463
+app.disable = function disable(setting) {
464
+  return this.set(setting, false);
465
+};
466
+
467
+/**
468
+ * Delegate `.VERB(...)` calls to `router.VERB(...)`.
469
+ */
470
+
471
+methods.forEach(function(method){
472
+  app[method] = function(path){
473
+    if (method === 'get' && arguments.length === 1) {
474
+      // app.get(setting)
475
+      return this.set(path);
476
+    }
477
+
478
+    this.lazyrouter();
479
+
480
+    var route = this._router.route(path);
481
+    route[method].apply(route, slice.call(arguments, 1));
482
+    return this;
483
+  };
484
+});
485
+
486
+/**
487
+ * Special-cased "all" method, applying the given route `path`,
488
+ * middleware, and callback to _every_ HTTP method.
489
+ *
490
+ * @param {String} path
491
+ * @param {Function} ...
492
+ * @return {app} for chaining
493
+ * @public
494
+ */
495
+
496
+app.all = function all(path) {
497
+  this.lazyrouter();
498
+
499
+  var route = this._router.route(path);
500
+  var args = slice.call(arguments, 1);
501
+
502
+  for (var i = 0; i < methods.length; i++) {
503
+    route[methods[i]].apply(route, args);
504
+  }
505
+
506
+  return this;
507
+};
508
+
509
+// del -> delete alias
510
+
511
+app.del = deprecate.function(app.delete, 'app.del: Use app.delete instead');
512
+
513
+/**
514
+ * Render the given view `name` name with `options`
515
+ * and a callback accepting an error and the
516
+ * rendered template string.
517
+ *
518
+ * Example:
519
+ *
520
+ *    app.render('email', { name: 'Tobi' }, function(err, html){
521
+ *      // ...
522
+ *    })
523
+ *
524
+ * @param {String} name
525
+ * @param {Object|Function} options or fn
526
+ * @param {Function} callback
527
+ * @public
528
+ */
529
+
530
+app.render = function render(name, options, callback) {
531
+  var cache = this.cache;
532
+  var done = callback;
533
+  var engines = this.engines;
534
+  var opts = options;
535
+  var renderOptions = {};
536
+  var view;
537
+
538
+  // support callback function as second arg
539
+  if (typeof options === 'function') {
540
+    done = options;
541
+    opts = {};
542
+  }
543
+
544
+  // merge app.locals
545
+  merge(renderOptions, this.locals);
546
+
547
+  // merge options._locals
548
+  if (opts._locals) {
549
+    merge(renderOptions, opts._locals);
550
+  }
551
+
552
+  // merge options
553
+  merge(renderOptions, opts);
554
+
555
+  // set .cache unless explicitly provided
556
+  if (renderOptions.cache == null) {
557
+    renderOptions.cache = this.enabled('view cache');
558
+  }
559
+
560
+  // primed cache
561
+  if (renderOptions.cache) {
562
+    view = cache[name];
563
+  }
564
+
565
+  // view
566
+  if (!view) {
567
+    var View = this.get('view');
568
+
569
+    view = new View(name, {
570
+      defaultEngine: this.get('view engine'),
571
+      root: this.get('views'),
572
+      engines: engines
573
+    });
574
+
575
+    if (!view.path) {
576
+      var dirs = Array.isArray(view.root) && view.root.length > 1
577
+        ? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"'
578
+        : 'directory "' + view.root + '"'
579
+      var err = new Error('Failed to lookup view "' + name + '" in views ' + dirs);
580
+      err.view = view;
581
+      return done(err);
582
+    }
583
+
584
+    // prime the cache
585
+    if (renderOptions.cache) {
586
+      cache[name] = view;
587
+    }
588
+  }
589
+
590
+  // render
591
+  tryRender(view, renderOptions, done);
592
+};
593
+
594
+/**
595
+ * Listen for connections.
596
+ *
597
+ * A node `http.Server` is returned, with this
598
+ * application (which is a `Function`) as its
599
+ * callback. If you wish to create both an HTTP
600
+ * and HTTPS server you may do so with the "http"
601
+ * and "https" modules as shown here:
602
+ *
603
+ *    var http = require('http')
604
+ *      , https = require('https')
605
+ *      , express = require('express')
606
+ *      , app = express();
607
+ *
608
+ *    http.createServer(app).listen(80);
609
+ *    https.createServer({ ... }, app).listen(443);
610
+ *
611
+ * @return {http.Server}
612
+ * @public
613
+ */
614
+
615
+app.listen = function listen() {
616
+  var server = http.createServer(this);
617
+  return server.listen.apply(server, arguments);
618
+};
619
+
620
+/**
621
+ * Log error using console.error.
622
+ *
623
+ * @param {Error} err
624
+ * @private
625
+ */
626
+
627
+function logerror(err) {
628
+  /* istanbul ignore next */
629
+  if (this.get('env') !== 'test') console.error(err.stack || err.toString());
630
+}
631
+
632
+/**
633
+ * Try rendering a view.
634
+ * @private
635
+ */
636
+
637
+function tryRender(view, options, callback) {
638
+  try {
639
+    view.render(options, callback);
640
+  } catch (err) {
641
+    callback(err);
642
+  }
643
+}

+ 103
- 0
node_modules/express/lib/express.js View File

@@ -0,0 +1,103 @@
1
+/*!
2
+ * express
3
+ * Copyright(c) 2009-2013 TJ Holowaychuk
4
+ * Copyright(c) 2013 Roman Shtylman
5
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
6
+ * MIT Licensed
7
+ */
8
+
9
+'use strict';
10
+
11
+/**
12
+ * Module dependencies.
13
+ */
14
+
15
+var EventEmitter = require('events').EventEmitter;
16
+var mixin = require('merge-descriptors');
17
+var proto = require('./application');
18
+var Route = require('./router/route');
19
+var Router = require('./router');
20
+var req = require('./request');
21
+var res = require('./response');
22
+
23
+/**
24
+ * Expose `createApplication()`.
25
+ */
26
+
27
+exports = module.exports = createApplication;
28
+
29
+/**
30
+ * Create an express application.
31
+ *
32
+ * @return {Function}
33
+ * @api public
34
+ */
35
+
36
+function createApplication() {
37
+  var app = function(req, res, next) {
38
+    app.handle(req, res, next);
39
+  };
40
+
41
+  mixin(app, EventEmitter.prototype, false);
42
+  mixin(app, proto, false);
43
+
44
+  app.request = { __proto__: req, app: app };
45
+  app.response = { __proto__: res, app: app };
46
+  app.init();
47
+  return app;
48
+}
49
+
50
+/**
51
+ * Expose the prototypes.
52
+ */
53
+
54
+exports.application = proto;
55
+exports.request = req;
56
+exports.response = res;
57
+
58
+/**
59
+ * Expose constructors.
60
+ */
61
+
62
+exports.Route = Route;
63
+exports.Router = Router;
64
+
65
+/**
66
+ * Expose middleware
67
+ */
68
+
69
+exports.query = require('./middleware/query');
70
+exports.static = require('serve-static');
71
+
72
+/**
73
+ * Replace removed middleware with an appropriate error message.
74
+ */
75
+
76
+[
77
+  'json',
78
+  'urlencoded',
79
+  'bodyParser',
80
+  'compress',
81
+  'cookieSession',
82
+  'session',
83
+  'logger',
84
+  'cookieParser',
85
+  'favicon',
86
+  'responseTime',
87
+  'errorHandler',
88
+  'timeout',
89
+  'methodOverride',
90
+  'vhost',
91
+  'csrf',
92
+  'directory',
93
+  'limit',
94
+  'multipart',
95
+  'staticCache',
96
+].forEach(function (name) {
97
+  Object.defineProperty(exports, name, {
98
+    get: function () {
99
+      throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');
100
+    },
101
+    configurable: true
102
+  });
103
+});

+ 36
- 0
node_modules/express/lib/middleware/init.js View File

@@ -0,0 +1,36 @@
1
+/*!
2
+ * express
3
+ * Copyright(c) 2009-2013 TJ Holowaychuk
4
+ * Copyright(c) 2013 Roman Shtylman
5
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
6
+ * MIT Licensed
7
+ */
8
+
9
+'use strict';
10
+
11
+/**
12
+ * Initialization middleware, exposing the
13
+ * request and response to each other, as well
14
+ * as defaulting the X-Powered-By header field.
15
+ *
16
+ * @param {Function} app
17
+ * @return {Function}
18
+ * @api private
19
+ */
20
+
21
+exports.init = function(app){
22
+  return function expressInit(req, res, next){
23
+    if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');
24
+    req.res = res;
25
+    res.req = req;
26
+    req.next = next;
27
+
28
+    req.__proto__ = app.request;
29
+    res.__proto__ = app.response;
30
+
31
+    res.locals = res.locals || Object.create(null);
32
+
33
+    next();
34
+  };
35
+};
36
+

+ 51
- 0
node_modules/express/lib/middleware/query.js View File

@@ -0,0 +1,51 @@
1
+/*!
2
+ * express
3
+ * Copyright(c) 2009-2013 TJ Holowaychuk
4
+ * Copyright(c) 2013 Roman Shtylman
5
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
6
+ * MIT Licensed
7
+ */
8
+
9
+'use strict';
10
+
11
+/**
12
+ * Module dependencies.
13
+ */
14
+
15
+var parseUrl = require('parseurl');
16
+var qs = require('qs');
17
+
18
+/**
19
+ * @param {Object} options
20
+ * @return {Function}
21
+ * @api public
22
+ */
23
+
24
+module.exports = function query(options) {
25
+  var opts = Object.create(options || null);
26
+  var queryparse = qs.parse;
27
+
28
+  if (typeof options === 'function') {
29
+    queryparse = options;
30
+    opts = undefined;
31
+  }
32
+
33
+  if (opts !== undefined) {
34
+    if (opts.allowDots === undefined) {
35
+      opts.allowDots = false;
36
+    }
37
+
38
+    if (opts.allowPrototypes === undefined) {
39
+      opts.allowPrototypes = true;
40
+    }
41
+  }
42
+
43
+  return function query(req, res, next){
44
+    if (!req.query) {
45
+      var val = parseUrl(req).query;
46
+      req.query = queryparse(val, opts);
47
+    }
48
+
49
+    next();
50
+  };
51
+};

+ 489
- 0
node_modules/express/lib/request.js View File

@@ -0,0 +1,489 @@
1
+/*!
2
+ * express
3
+ * Copyright(c) 2009-2013 TJ Holowaychuk
4
+ * Copyright(c) 2013 Roman Shtylman
5
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
6
+ * MIT Licensed
7
+ */
8
+
9
+'use strict';
10
+
11
+/**
12
+ * Module dependencies.
13
+ * @private
14
+ */
15
+
16
+var accepts = require('accepts');
17
+var deprecate = require('depd')('express');
18
+var isIP = require('net').isIP;
19
+var typeis = require('type-is');
20
+var http = require('http');
21
+var fresh = require('fresh');
22
+var parseRange = require('range-parser');
23
+var parse = require('parseurl');
24
+var proxyaddr = require('proxy-addr');
25
+
26
+/**
27
+ * Request prototype.
28
+ */
29
+
30
+var req = exports = module.exports = {
31
+  __proto__: http.IncomingMessage.prototype
32
+};
33
+
34
+/**
35
+ * Return request header.
36
+ *
37
+ * The `Referrer` header field is special-cased,
38
+ * both `Referrer` and `Referer` are interchangeable.
39
+ *
40
+ * Examples:
41
+ *
42
+ *     req.get('Content-Type');
43
+ *     // => "text/plain"
44
+ *
45
+ *     req.get('content-type');
46
+ *     // => "text/plain"
47
+ *
48
+ *     req.get('Something');
49
+ *     // => undefined
50
+ *
51
+ * Aliased as `req.header()`.
52
+ *
53
+ * @param {String} name
54
+ * @return {String}
55
+ * @public
56
+ */
57
+
58
+req.get =
59
+req.header = function header(name) {
60
+  var lc = name.toLowerCase();
61
+
62
+  switch (lc) {
63
+    case 'referer':
64
+    case 'referrer':
65
+      return this.headers.referrer
66
+        || this.headers.referer;
67
+    default:
68
+      return this.headers[lc];
69
+  }
70
+};
71
+
72
+/**
73
+ * To do: update docs.
74
+ *
75
+ * Check if the given `type(s)` is acceptable, returning
76
+ * the best match when true, otherwise `undefined`, in which
77
+ * case you should respond with 406 "Not Acceptable".
78
+ *
79
+ * The `type` value may be a single MIME type string
80
+ * such as "application/json", an extension name
81
+ * such as "json", a comma-delimited list such as "json, html, text/plain",
82
+ * an argument list such as `"json", "html", "text/plain"`,
83
+ * or an array `["json", "html", "text/plain"]`. When a list
84
+ * or array is given, the _best_ match, if any is returned.
85
+ *
86
+ * Examples:
87
+ *
88
+ *     // Accept: text/html
89
+ *     req.accepts('html');
90
+ *     // => "html"
91
+ *
92
+ *     // Accept: text/*, application/json
93
+ *     req.accepts('html');
94
+ *     // => "html"
95
+ *     req.accepts('text/html');
96
+ *     // => "text/html"
97
+ *     req.accepts('json, text');
98
+ *     // => "json"
99
+ *     req.accepts('application/json');
100
+ *     // => "application/json"
101
+ *
102
+ *     // Accept: text/*, application/json
103
+ *     req.accepts('image/png');
104
+ *     req.accepts('png');
105
+ *     // => undefined
106
+ *
107
+ *     // Accept: text/*;q=.5, application/json
108
+ *     req.accepts(['html', 'json']);
109
+ *     req.accepts('html', 'json');
110
+ *     req.accepts('html, json');
111
+ *     // => "json"
112
+ *
113
+ * @param {String|Array} type(s)
114
+ * @return {String|Array|Boolean}
115
+ * @public
116
+ */
117
+
118
+req.accepts = function(){
119
+  var accept = accepts(this);
120
+  return accept.types.apply(accept, arguments);
121
+};
122
+
123
+/**
124
+ * Check if the given `encoding`s are accepted.
125
+ *
126
+ * @param {String} ...encoding
127
+ * @return {String|Array}
128
+ * @public
129
+ */
130
+
131
+req.acceptsEncodings = function(){
132
+  var accept = accepts(this);
133
+  return accept.encodings.apply(accept, arguments);
134
+};
135
+
136
+req.acceptsEncoding = deprecate.function(req.acceptsEncodings,
137
+  'req.acceptsEncoding: Use acceptsEncodings instead');
138
+
139
+/**
140
+ * Check if the given `charset`s are acceptable,
141
+ * otherwise you should respond with 406 "Not Acceptable".
142
+ *
143
+ * @param {String} ...charset
144
+ * @return {String|Array}
145
+ * @public
146
+ */
147
+
148
+req.acceptsCharsets = function(){
149
+  var accept = accepts(this);
150
+  return accept.charsets.apply(accept, arguments);
151
+};
152
+
153
+req.acceptsCharset = deprecate.function(req.acceptsCharsets,
154
+  'req.acceptsCharset: Use acceptsCharsets instead');
155
+
156
+/**
157
+ * Check if the given `lang`s are acceptable,
158
+ * otherwise you should respond with 406 "Not Acceptable".
159
+ *
160
+ * @param {String} ...lang
161
+ * @return {String|Array}
162
+ * @public
163
+ */
164
+
165
+req.acceptsLanguages = function(){
166
+  var accept = accepts(this);
167
+  return accept.languages.apply(accept, arguments);
168
+};
169
+
170
+req.acceptsLanguage = deprecate.function(req.acceptsLanguages,
171
+  'req.acceptsLanguage: Use acceptsLanguages instead');
172
+
173
+/**
174
+ * Parse Range header field,
175
+ * capping to the given `size`.
176
+ *
177
+ * Unspecified ranges such as "0-" require
178
+ * knowledge of your resource length. In
179
+ * the case of a byte range this is of course
180
+ * the total number of bytes. If the Range
181
+ * header field is not given `null` is returned,
182
+ * `-1` when unsatisfiable, `-2` when syntactically invalid.
183
+ *
184
+ * NOTE: remember that ranges are inclusive, so
185
+ * for example "Range: users=0-3" should respond
186
+ * with 4 users when available, not 3.
187
+ *
188
+ * @param {Number} size
189
+ * @return {Array}
190
+ * @public
191
+ */
192
+
193
+req.range = function(size){
194
+  var range = this.get('Range');
195
+  if (!range) return;
196
+  return parseRange(size, range);
197
+};
198
+
199
+/**
200
+ * Return the value of param `name` when present or `defaultValue`.
201
+ *
202
+ *  - Checks route placeholders, ex: _/user/:id_
203
+ *  - Checks body params, ex: id=12, {"id":12}
204
+ *  - Checks query string params, ex: ?id=12
205
+ *
206
+ * To utilize request bodies, `req.body`
207
+ * should be an object. This can be done by using
208
+ * the `bodyParser()` middleware.
209
+ *
210
+ * @param {String} name
211
+ * @param {Mixed} [defaultValue]
212
+ * @return {String}
213
+ * @public
214
+ */
215
+
216
+req.param = function param(name, defaultValue) {
217
+  var params = this.params || {};
218
+  var body = this.body || {};
219
+  var query = this.query || {};
220
+
221
+  var args = arguments.length === 1
222
+    ? 'name'
223
+    : 'name, default';
224
+  deprecate('req.param(' + args + '): Use req.params, req.body, or req.query instead');
225
+
226
+  if (null != params[name] && params.hasOwnProperty(name)) return params[name];
227
+  if (null != body[name]) return body[name];
228
+  if (null != query[name]) return query[name];
229
+
230
+  return defaultValue;
231
+};
232
+
233
+/**
234
+ * Check if the incoming request contains the "Content-Type"
235
+ * header field, and it contains the give mime `type`.
236
+ *
237
+ * Examples:
238
+ *
239
+ *      // With Content-Type: text/html; charset=utf-8
240
+ *      req.is('html');
241
+ *      req.is('text/html');
242
+ *      req.is('text/*');
243
+ *      // => true
244
+ *
245
+ *      // When Content-Type is application/json
246
+ *      req.is('json');
247
+ *      req.is('application/json');
248
+ *      req.is('application/*');
249
+ *      // => true
250
+ *
251
+ *      req.is('html');
252
+ *      // => false
253
+ *
254
+ * @param {String|Array} types...
255
+ * @return {String|false|null}
256
+ * @public
257
+ */
258
+
259
+req.is = function is(types) {
260
+  var arr = types;
261
+
262
+  // support flattened arguments
263
+  if (!Array.isArray(types)) {
264
+    arr = new Array(arguments.length);
265
+    for (var i = 0; i < arr.length; i++) {
266
+      arr[i] = arguments[i];
267
+    }
268
+  }
269
+
270
+  return typeis(this, arr);
271
+};
272
+
273
+/**
274
+ * Return the protocol string "http" or "https"
275
+ * when requested with TLS. When the "trust proxy"
276
+ * setting trusts the socket address, the
277
+ * "X-Forwarded-Proto" header field will be trusted
278
+ * and used if present.
279
+ *
280
+ * If you're running behind a reverse proxy that
281
+ * supplies https for you this may be enabled.
282
+ *
283
+ * @return {String}
284
+ * @public
285
+ */
286
+
287
+defineGetter(req, 'protocol', function protocol(){
288
+  var proto = this.connection.encrypted
289
+    ? 'https'
290
+    : 'http';
291
+  var trust = this.app.get('trust proxy fn');
292
+
293
+  if (!trust(this.connection.remoteAddress, 0)) {
294
+    return proto;
295
+  }
296
+
297
+  // Note: X-Forwarded-Proto is normally only ever a
298
+  //       single value, but this is to be safe.
299
+  proto = this.get('X-Forwarded-Proto') || proto;
300
+  return proto.split(/\s*,\s*/)[0];
301
+});
302
+
303
+/**
304
+ * Short-hand for:
305
+ *
306
+ *    req.protocol == 'https'
307
+ *
308
+ * @return {Boolean}
309
+ * @public
310
+ */
311
+
312
+defineGetter(req, 'secure', function secure(){
313
+  return this.protocol === 'https';
314
+});
315
+
316
+/**
317
+ * Return the remote address from the trusted proxy.
318
+ *
319
+ * The is the remote address on the socket unless
320
+ * "trust proxy" is set.
321
+ *
322
+ * @return {String}
323
+ * @public
324
+ */
325
+
326
+defineGetter(req, 'ip', function ip(){
327
+  var trust = this.app.get('trust proxy fn');
328
+  return proxyaddr(this, trust);
329
+});
330
+
331
+/**
332
+ * When "trust proxy" is set, trusted proxy addresses + client.
333
+ *
334
+ * For example if the value were "client, proxy1, proxy2"
335
+ * you would receive the array `["client", "proxy1", "proxy2"]`
336
+ * where "proxy2" is the furthest down-stream and "proxy1" and
337
+ * "proxy2" were trusted.
338
+ *
339
+ * @return {Array}
340
+ * @public
341
+ */
342