diff --git a/lime/tools/helpers/NodeJSHelper.hx b/lime/tools/helpers/NodeJSHelper.hx index 2267064303..604569de40 100644 --- a/lime/tools/helpers/NodeJSHelper.hx +++ b/lime/tools/helpers/NodeJSHelper.hx @@ -12,39 +12,7 @@ class NodeJSHelper { public static function run (project:HXProject, modulePath:String, args:Array = null):Void { - - var suffix = switch (PlatformHelper.hostPlatform) { - - case Platform.WINDOWS: "-windows.exe"; - case Platform.MAC: "-mac"; - case Platform.LINUX: "-linux"; - default: return; - - } - - if (suffix == "-linux") { - - if (PlatformHelper.hostArchitecture == Architecture.X86) { - - suffix += "32"; - - } else { - - suffix += "64"; - - } - - } - - var templatePaths = [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "templates") ].concat (project.templatePaths); - var node = PathHelper.findTemplate (templatePaths, "bin/node/node" + suffix); - - if (PlatformHelper.hostPlatform != Platform.WINDOWS) { - - Sys.command ("chmod", [ "+x", node ]); - - } - + if (args == null) { args = []; @@ -53,7 +21,7 @@ class NodeJSHelper { args.unshift (Path.withoutDirectory (modulePath)); - ProcessHelper.runCommand (Path.directory (modulePath), node, args); + ProcessHelper.runCommand (Path.directory (modulePath), "iojs", args); } diff --git a/templates/bin/node/http-server/LICENSE b/templates/bin/node/http-server/LICENSE deleted file mode 100755 index c9ebaf403f..0000000000 --- a/templates/bin/node/http-server/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2011 Nodejitsu http://github.com/nodejitsu/http-server/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/templates/bin/node/http-server/http-server b/templates/bin/node/http-server/http-server deleted file mode 100755 index 2c073630cd..0000000000 --- a/templates/bin/node/http-server/http-server +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env node - -var colors = require('colors'), - httpServer = require('./http-server.js'), - portfinder = require('portfinder'), - opener = require('opener'), - argv = require('optimist') - .boolean('cors') - .argv; - -if (argv.h || argv.help) { - console.log([ - "usage: http-server [path] [options]", - "", - "options:", - " -p Port to use [8080]", - " -a Address to use [0.0.0.0]", - " -d Show directory listings [true]", - " -i Display autoIndex [true]", - " -e --ext Default file extension if none supplied [none]", - " -s --silent Suppress log messages from output", - " --cors Enable CORS via the 'Access-Control-Allow-Origin' header", - " -o Open browser window after staring the server", - " -c Cache time (max-age) in seconds [3600], e.g. -c10 for 10 seconds.", - " To disable caching, use -c-1.", - "", - " -S --ssl Enable https.", - " -C --cert Path to ssl cert file (default: cert.pem).", - " -K --key Path to ssl key file (default: key.pem).", - "", - " -h --help Print this list and exit." - ].join('\n')); - process.exit(); -} - -var port = argv.p || parseInt(process.env.PORT, 10), - host = argv.a || '0.0.0.0', - log = (argv.s || argv.silent) ? (function () {}) : console.log, - ssl = !!argv.S || !!argv.ssl, - requestLogger; - -if (!argv.s && !argv.silent) { - requestLogger = function(req) { - log('[%s] "%s %s" "%s"', (new Date).toUTCString(), req.method.cyan, req.url.cyan, req.headers['user-agent']); - } -} - -if (!port) { - portfinder.basePort = 8080; - portfinder.getPort(function (err, port) { - if (err) throw err; - listen(port); - }); -} else { - listen(port); -} - -function listen(port) { - var options = { - root: argv._[0], - cache: argv.c, - showDir: argv.d, - autoIndex: argv.i, - ext: argv.e || argv.ext, - logFn: requestLogger - }; - - if (argv.cors) { - options.headers = { - 'Access-Control-Allow-Origin': '*', - 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept' - }; - } - - if (ssl) { - options.https = { - cert: argv.C || argv.cert || 'cert.pem', - key: argv.K || argv.key || 'key.pem' - }; - } - - var server = httpServer.createServer(options); - server.listen(port, host, function() { - var uri = [ssl ? 'https' : 'http', '://', host, ':', port].join(''); - log('Starting up http-server, serving '.yellow - + server.root.cyan - + ((ssl) ? ' through'.yellow + ' https'.cyan : '') - + ' on: '.yellow - + uri.cyan); - - log('Hit CTRL-C to stop the server'); - if (argv.o) { - opener(uri); - } - }); -} - -if (process.platform !== 'win32') { - // - // Signal handlers don't work on Windows. - // - process.on('SIGINT', function () { - log('http-server stopped.'.red); - process.exit(); - }); -} \ No newline at end of file diff --git a/templates/bin/node/http-server/http-server.js b/templates/bin/node/http-server/http-server.js deleted file mode 100755 index 213aa63f15..0000000000 --- a/templates/bin/node/http-server/http-server.js +++ /dev/null @@ -1,64 +0,0 @@ -var fs = require('fs'), - util = require('util'), - union = require('union'), - ecstatic = require('ecstatic'); - -var HTTPServer = exports.HTTPServer = function (options) { - options = options || {}; - - if (options.root) { - this.root = options.root; - } - else { - try { - fs.lstatSync('./public'); - this.root = './public'; - } - catch (err) { - this.root = './'; - } - } - - if (options.headers) { - this.headers = options.headers; - } - - this.cache = options.cache || 3600; // in seconds. - this.showDir = options.showDir !== 'false'; - this.autoIndex = options.autoIndex !== 'false'; - - if (options.ext) { - this.ext = options.ext === true - ? 'html' - : options.ext; - } - - this.server = union.createServer({ - before: (options.before || []).concat([ - function (req, res) { - options.logFn && options.logFn(req, res); - res.emit('next'); - }, - ecstatic({ - root: this.root, - cache: this.cache, - showDir : this.showDir, - autoIndex: this.autoIndex, - defaultExt: this.ext - }) - ]), - headers: this.headers || {} - }); -}; - -HTTPServer.prototype.listen = function () { - this.server.listen.apply(this.server, arguments); -}; - -HTTPServer.prototype.close = function () { - return this.server.close(); -}; - -exports.createServer = function (options) { - return new HTTPServer(options); -}; diff --git a/templates/bin/node/http-server/node_modules/.bin/ecstatic b/templates/bin/node/http-server/node_modules/.bin/ecstatic deleted file mode 120000 index 5a8a58af41..0000000000 --- a/templates/bin/node/http-server/node_modules/.bin/ecstatic +++ /dev/null @@ -1 +0,0 @@ -../ecstatic/lib/ecstatic.js \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/.bin/opener b/templates/bin/node/http-server/node_modules/.bin/opener deleted file mode 120000 index 120b591ba9..0000000000 --- a/templates/bin/node/http-server/node_modules/.bin/opener +++ /dev/null @@ -1 +0,0 @@ -../opener/opener.js \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/colors/MIT-LICENSE.txt b/templates/bin/node/http-server/node_modules/colors/MIT-LICENSE.txt deleted file mode 100644 index 7dca10706f..0000000000 --- a/templates/bin/node/http-server/node_modules/colors/MIT-LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2010 - -Marak Squires -Alexis Sellier (cloudhead) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/colors/colors.js b/templates/bin/node/http-server/node_modules/colors/colors.js deleted file mode 100644 index 7a537d8de2..0000000000 --- a/templates/bin/node/http-server/node_modules/colors/colors.js +++ /dev/null @@ -1,342 +0,0 @@ -/* -colors.js - -Copyright (c) 2010 - -Marak Squires -Alexis Sellier (cloudhead) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -var isHeadless = false; - -if (typeof module !== 'undefined') { - isHeadless = true; -} - -if (!isHeadless) { - var exports = {}; - var module = {}; - var colors = exports; - exports.mode = "browser"; -} else { - exports.mode = "console"; -} - -// -// Prototypes the string object to have additional method calls that add terminal colors -// -var addProperty = function (color, func) { - exports[color] = function (str) { - return func.apply(str); - }; - String.prototype.__defineGetter__(color, func); -}; - -function stylize(str, style) { - - var styles; - - if (exports.mode === 'console') { - styles = { - //styles - 'bold' : ['\x1B[1m', '\x1B[22m'], - 'italic' : ['\x1B[3m', '\x1B[23m'], - 'underline' : ['\x1B[4m', '\x1B[24m'], - 'inverse' : ['\x1B[7m', '\x1B[27m'], - 'strikethrough' : ['\x1B[9m', '\x1B[29m'], - //text colors - //grayscale - 'white' : ['\x1B[37m', '\x1B[39m'], - 'grey' : ['\x1B[90m', '\x1B[39m'], - 'black' : ['\x1B[30m', '\x1B[39m'], - //colors - 'blue' : ['\x1B[34m', '\x1B[39m'], - 'cyan' : ['\x1B[36m', '\x1B[39m'], - 'green' : ['\x1B[32m', '\x1B[39m'], - 'magenta' : ['\x1B[35m', '\x1B[39m'], - 'red' : ['\x1B[31m', '\x1B[39m'], - 'yellow' : ['\x1B[33m', '\x1B[39m'], - //background colors - //grayscale - 'whiteBG' : ['\x1B[47m', '\x1B[49m'], - 'greyBG' : ['\x1B[49;5;8m', '\x1B[49m'], - 'blackBG' : ['\x1B[40m', '\x1B[49m'], - //colors - 'blueBG' : ['\x1B[44m', '\x1B[49m'], - 'cyanBG' : ['\x1B[46m', '\x1B[49m'], - 'greenBG' : ['\x1B[42m', '\x1B[49m'], - 'magentaBG' : ['\x1B[45m', '\x1B[49m'], - 'redBG' : ['\x1B[41m', '\x1B[49m'], - 'yellowBG' : ['\x1B[43m', '\x1B[49m'] - }; - } else if (exports.mode === 'browser') { - styles = { - //styles - 'bold' : ['', ''], - 'italic' : ['', ''], - 'underline' : ['', ''], - 'inverse' : ['', ''], - 'strikethrough' : ['', ''], - //text colors - //grayscale - 'white' : ['', ''], - 'grey' : ['', ''], - 'black' : ['', ''], - //colors - 'blue' : ['', ''], - 'cyan' : ['', ''], - 'green' : ['', ''], - 'magenta' : ['', ''], - 'red' : ['', ''], - 'yellow' : ['', ''], - //background colors - //grayscale - 'whiteBG' : ['', ''], - 'greyBG' : ['', ''], - 'blackBG' : ['', ''], - //colors - 'blueBG' : ['', ''], - 'cyanBG' : ['', ''], - 'greenBG' : ['', ''], - 'magentaBG' : ['', ''], - 'redBG' : ['', ''], - 'yellowBG' : ['', ''] - }; - } else if (exports.mode === 'none') { - return str + ''; - } else { - console.log('unsupported mode, try "browser", "console" or "none"'); - } - return styles[style][0] + str + styles[style][1]; -} - -function applyTheme(theme) { - - // - // Remark: This is a list of methods that exist - // on String that you should not overwrite. - // - var stringPrototypeBlacklist = [ - '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', - 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', - 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', - 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight' - ]; - - Object.keys(theme).forEach(function (prop) { - if (stringPrototypeBlacklist.indexOf(prop) !== -1) { - console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name'); - } - else { - if (typeof(theme[prop]) === 'string') { - addProperty(prop, function () { - return exports[theme[prop]](this); - }); - } - else { - addProperty(prop, function () { - var ret = this; - for (var t = 0; t < theme[prop].length; t++) { - ret = exports[theme[prop][t]](ret); - } - return ret; - }); - } - } - }); -} - - -// -// Iterate through all default styles and colors -// -var x = ['bold', 'underline', 'strikethrough', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta', 'greyBG', 'blackBG', 'yellowBG', 'redBG', 'greenBG', 'blueBG', 'whiteBG', 'cyanBG', 'magentaBG']; -x.forEach(function (style) { - - // __defineGetter__ at the least works in more browsers - // http://robertnyman.com/javascript/javascript-getters-setters.html - // Object.defineProperty only works in Chrome - addProperty(style, function () { - return stylize(this, style); - }); -}); - -function sequencer(map) { - return function () { - if (!isHeadless) { - return this.replace(/( )/, '$1'); - } - var exploded = this.split(""), i = 0; - exploded = exploded.map(map); - return exploded.join(""); - }; -} - -var rainbowMap = (function () { - var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV - return function (letter, i, exploded) { - if (letter === " ") { - return letter; - } else { - return stylize(letter, rainbowColors[i++ % rainbowColors.length]); - } - }; -})(); - -exports.themes = {}; - -exports.addSequencer = function (name, map) { - addProperty(name, sequencer(map)); -}; - -exports.addSequencer('rainbow', rainbowMap); -exports.addSequencer('zebra', function (letter, i, exploded) { - return i % 2 === 0 ? letter : letter.inverse; -}); - -exports.setTheme = function (theme) { - if (typeof theme === 'string') { - try { - exports.themes[theme] = require(theme); - applyTheme(exports.themes[theme]); - return exports.themes[theme]; - } catch (err) { - console.log(err); - return err; - } - } else { - applyTheme(theme); - } -}; - - -addProperty('stripColors', function () { - return ("" + this).replace(/\x1B\[\d+m/g, ''); -}); - -// please no -function zalgo(text, options) { - var soul = { - "up" : [ - '̍', '̎', '̄', '̅', - '̿', '̑', '̆', '̐', - '͒', '͗', '͑', '̇', - '̈', '̊', '͂', '̓', - '̈', '͊', '͋', '͌', - '̃', '̂', '̌', '͐', - '̀', '́', '̋', '̏', - '̒', '̓', '̔', '̽', - '̉', 'ͣ', 'ͤ', 'ͥ', - 'ͦ', 'ͧ', 'ͨ', 'ͩ', - 'ͪ', 'ͫ', 'ͬ', 'ͭ', - 'ͮ', 'ͯ', '̾', '͛', - '͆', '̚' - ], - "down" : [ - '̖', '̗', '̘', '̙', - '̜', '̝', '̞', '̟', - '̠', '̤', '̥', '̦', - '̩', '̪', '̫', '̬', - '̭', '̮', '̯', '̰', - '̱', '̲', '̳', '̹', - '̺', '̻', '̼', 'ͅ', - '͇', '͈', '͉', '͍', - '͎', '͓', '͔', '͕', - '͖', '͙', '͚', '̣' - ], - "mid" : [ - '̕', '̛', '̀', '́', - '͘', '̡', '̢', '̧', - '̨', '̴', '̵', '̶', - '͜', '͝', '͞', - '͟', '͠', '͢', '̸', - '̷', '͡', ' ҉' - ] - }, - all = [].concat(soul.up, soul.down, soul.mid), - zalgo = {}; - - function randomNumber(range) { - var r = Math.floor(Math.random() * range); - return r; - } - - function is_char(character) { - var bool = false; - all.filter(function (i) { - bool = (i === character); - }); - return bool; - } - - function heComes(text, options) { - var result = '', counts, l; - options = options || {}; - options["up"] = options["up"] || true; - options["mid"] = options["mid"] || true; - options["down"] = options["down"] || true; - options["size"] = options["size"] || "maxi"; - text = text.split(''); - for (l in text) { - if (is_char(l)) { - continue; - } - result = result + text[l]; - counts = {"up" : 0, "down" : 0, "mid" : 0}; - switch (options.size) { - case 'mini': - counts.up = randomNumber(8); - counts.min = randomNumber(2); - counts.down = randomNumber(8); - break; - case 'maxi': - counts.up = randomNumber(16) + 3; - counts.min = randomNumber(4) + 1; - counts.down = randomNumber(64) + 3; - break; - default: - counts.up = randomNumber(8) + 1; - counts.mid = randomNumber(6) / 2; - counts.down = randomNumber(8) + 1; - break; - } - - var arr = ["up", "mid", "down"]; - for (var d in arr) { - var index = arr[d]; - for (var i = 0 ; i <= counts[index]; i++) { - if (options[index]) { - result = result + soul[index][randomNumber(soul[index].length)]; - } - } - } - } - return result; - } - return heComes(text); -} - - -// don't summon zalgo -addProperty('zalgo', function () { - return zalgo(this); -}); diff --git a/templates/bin/node/http-server/node_modules/colors/example.html b/templates/bin/node/http-server/node_modules/colors/example.html deleted file mode 100644 index 7a2ae605f1..0000000000 --- a/templates/bin/node/http-server/node_modules/colors/example.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Colors Example - - - - - - \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/colors/example.js b/templates/bin/node/http-server/node_modules/colors/example.js deleted file mode 100644 index b1e03a4fae..0000000000 --- a/templates/bin/node/http-server/node_modules/colors/example.js +++ /dev/null @@ -1,77 +0,0 @@ -var colors = require('./colors'); - -//colors.mode = "browser"; - -var test = colors.red("hopefully colorless output"); -console.log('Rainbows are fun!'.rainbow); -console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported -console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported -//console.log('zalgo time!'.zalgo); -console.log(test.stripColors); -console.log("a".grey + " b".black); -console.log("Zebras are so fun!".zebra); -console.log('background color attack!'.black.whiteBG) - -// -// Remark: .strikethrough may not work with Mac OS Terminal App -// -console.log("This is " + "not".strikethrough + " fun."); -console.log(colors.rainbow('Rainbows are fun!')); -console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported -console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported -//console.log(colors.zalgo('zalgo time!')); -console.log(colors.stripColors(test)); -console.log(colors.grey("a") + colors.black(" b")); - -colors.addSequencer("america", function(letter, i, exploded) { - if(letter === " ") return letter; - switch(i%3) { - case 0: return letter.red; - case 1: return letter.white; - case 2: return letter.blue; - } -}); - -colors.addSequencer("random", (function() { - var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; - - return function(letter, i, exploded) { - return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; - }; -})()); - -console.log("AMERICA! F--K YEAH!".america); -console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random); - -// -// Custom themes -// - -// Load theme with JSON literal -colors.setTheme({ - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}); - -// outputs red text -console.log("this is an error".error); - -// outputs yellow text -console.log("this is a warning".warn); - -// outputs grey text -console.log("this is an input".input); - -// Load a theme from file -colors.setTheme('./themes/winston-dark.js'); - -console.log("this is an input".input); - diff --git a/templates/bin/node/http-server/node_modules/colors/package.json b/templates/bin/node/http-server/node_modules/colors/package.json deleted file mode 100644 index 46bf03aa4e..0000000000 --- a/templates/bin/node/http-server/node_modules/colors/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "colors", - "description": "get colors in your node.js console like what", - "version": "0.6.2", - "author": { - "name": "Marak Squires" - }, - "homepage": "https://github.com/Marak/colors.js", - "bugs": { - "url": "https://github.com/Marak/colors.js/issues" - }, - "keywords": [ - "ansi", - "terminal", - "colors" - ], - "repository": { - "type": "git", - "url": "http://github.com/Marak/colors.js.git" - }, - "engines": { - "node": ">=0.1.90" - }, - "main": "colors", - "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar colors = require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n", - "readmeFilename": "ReadMe.md", - "_id": "colors@0.6.2", - "_shasum": "2423fe6678ac0c5dae8852e5d0e5be08c997abcc", - "_from": "colors@0.6.x", - "_resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/colors/test.js b/templates/bin/node/http-server/node_modules/colors/test.js deleted file mode 100644 index c32417d623..0000000000 --- a/templates/bin/node/http-server/node_modules/colors/test.js +++ /dev/null @@ -1,70 +0,0 @@ -var assert = require('assert'), - colors = require('./colors'); - -var s = 'string'; - -function a(s, code) { - return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m'; -} - -function aE(s, color, code) { - assert.equal(s[color], a(s, code)); - assert.equal(colors[color](s), a(s, code)); - assert.equal(s[color], colors[color](s)); - assert.equal(s[color].stripColors, s); - assert.equal(s[color].stripColors, colors.stripColors(s)); -} - -function h(s, color) { - return '' + s + ''; -} - -var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; -var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); - -colors.mode = 'console'; -assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); -assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m'); -assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m'); -assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m'); -assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m'); -assert.ok(s.rainbow); -aE(s, 'white', 37); -aE(s, 'grey', 90); -aE(s, 'black', 30); -aE(s, 'blue', 34); -aE(s, 'cyan', 36); -aE(s, 'green', 32); -aE(s, 'magenta', 35); -aE(s, 'red', 31); -aE(s, 'yellow', 33); -assert.equal(s, 'string'); - -colors.setTheme({error:'red'}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'browser'; -assert.equal(s.bold, '' + s + ''); -assert.equal(s.italic, '' + s + ''); -assert.equal(s.underline, '' + s + ''); -assert.equal(s.strikethrough, '' + s + ''); -assert.equal(s.inverse, '' + s + ''); -assert.ok(s.rainbow); -stylesColors.forEach(function (color) { - assert.equal(s[color], h(s, color)); - assert.equal(colors[color](s), h(s, color)); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'none'; -stylesAll.forEach(function (style) { - assert.equal(s[style], s); - assert.equal(colors[style](s), s); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); diff --git a/templates/bin/node/http-server/node_modules/colors/themes/winston-dark.js b/templates/bin/node/http-server/node_modules/colors/themes/winston-dark.js deleted file mode 100644 index 49a905ba42..0000000000 --- a/templates/bin/node/http-server/node_modules/colors/themes/winston-dark.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'black', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/colors/themes/winston-light.js b/templates/bin/node/http-server/node_modules/colors/themes/winston-light.js deleted file mode 100644 index 571972c1ba..0000000000 --- a/templates/bin/node/http-server/node_modules/colors/themes/winston-light.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/ecstatic/.npmignore b/templates/bin/node/http-server/node_modules/ecstatic/.npmignore deleted file mode 100644 index 7dccd97076..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -node_modules -npm-debug.log \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/ecstatic/.travis.yml b/templates/bin/node/http-server/node_modules/ecstatic/.travis.yml deleted file mode 100644 index 09d3ef3784..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.10 diff --git a/templates/bin/node/http-server/node_modules/ecstatic/LICENSE.txt b/templates/bin/node/http-server/node_modules/ecstatic/LICENSE.txt deleted file mode 100644 index a90fd5e35a..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Joshua Holbrook - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic.js b/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic.js deleted file mode 100755 index ef82d2c62e..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic.js +++ /dev/null @@ -1,235 +0,0 @@ -#! /usr/bin/env node - -var path = require('path'), - fs = require('fs'), - url = require('url'), - mime = require('mime'), - showDir = require('./ecstatic/showdir'), - version = JSON.parse( - fs.readFileSync(__dirname + '/../package.json').toString() - ).version, - status = require('./ecstatic/status-handlers'), - etag = require('./ecstatic/etag'), - optsParser = require('./ecstatic/opts'); - -var ecstatic = module.exports = function (dir, options) { - if (typeof dir !== 'string') { - options = dir; - dir = options.root; - } - - var root = path.join(path.resolve(dir), '/'), - opts = optsParser(options), - cache = opts.cache, - autoIndex = opts.autoIndex, - baseDir = opts.baseDir, - defaultExt = opts.defaultExt, - handleError = opts.handleError; - - opts.root = dir; - - return function middleware (req, res, next) { - - // Strip any null bytes from the url - while(req.url.indexOf('%00') !== -1) { - req.url = req.url.replace(/\%00/g, ''); - } - // Figure out the path for the file from the given url - var parsed = url.parse(req.url); - try { - decodeURI(req.url); // check validity of url - var pathname = decodeURI(parsed.pathname); - } - catch (err) { - return status[400](res, next, { error: err }); - } - - var file = path.normalize( - path.join(root, - path.relative( - path.join('/', baseDir), - pathname - ) - ) - ), - gzipped = file + '.gz'; - - // Set common headers. - res.setHeader('server', 'ecstatic-'+version); - - // TODO: This check is broken, which causes the 403 on the - // expected 404. - if (file.slice(0, root.length) !== root) { - return status[403](res, next); - } - - if (req.method && (req.method !== 'GET' && req.method !== 'HEAD' )) { - return status[405](res, next); - } - - // Look for a gzipped file if this is turned on - if (opts.gzip && shouldCompress(req)) { - fs.stat(gzipped, function (err, stat) { - if (!err && stat.isFile()) { - file = gzipped; - return serve(stat); - } - }); - } - - fs.stat(file, function (err, stat) { - if (err && err.code === 'ENOENT') { - if (req.statusCode == 404) { - // This means we're already trying ./404.html - status[404](res, next); - } - else if (defaultExt && !path.extname(parsed.pathname).length) { - // - // If no file extension is specified and there is a default extension - // try that before rendering 404.html. - // - middleware({ - url: parsed.pathname + '.' + defaultExt + ((parsed.search)? parsed.search:'') - }, res, next); - } - else { - // Try for ./404.html - middleware({ - url: (handleError ? ('/' + path.join(baseDir, '404.html')) : req.url), - statusCode: 404 // Override the response status code - }, res, next); - } - } - else if (err) { - status[500](res, next, { error: err }); - } - else if (stat.isDirectory()) { - // 302 to / if necessary - if (!parsed.pathname.match(/\/$/)) { - res.statusCode = 302; - res.setHeader('location', parsed.pathname + '/' + - (parsed.query? ('?' + parsed.query):'') - ); - return res.end(); - } - - if (autoIndex) { - return middleware({ - url: path.join(pathname, '/index.html') - }, res, function (err) { - if (err) { - return status[500](res, next, { error: err }); - } - if (opts.showDir) { - return showDir(opts, stat)(req, res); - } - - return status[403](res, next); - }); - } - - if (opts.showDir) { - return showDir(opts, stat)(req, res); - } - - status[404](res, next); - - } - else { - serve(stat); - } - }); - - function serve(stat) { - - // TODO: Helper for this, with default headers. - res.setHeader('etag', etag(stat)); - res.setHeader('last-modified', (new Date(stat.mtime)).toUTCString()); - res.setHeader('cache-control', cache); - - // Return a 304 if necessary - if ( req.headers - && ( - (req.headers['if-none-match'] === etag(stat)) - || (new Date(Date.parse(req.headers['if-modified-since'])) >= stat.mtime) - ) - ) { - return status[304](res, next); - } - - res.setHeader('content-length', stat.size); - - // Do a MIME lookup, fall back to octet-stream and handle gzip - // special case. - var contentType = mime.lookup(file), charSet; - - if (contentType) { - charSet = mime.charsets.lookup(contentType); - if (charSet) { - contentType += '; charset=' + charSet; - } - } - - if (path.extname(file) === '.gz') { - res.setHeader('Content-Encoding', 'gzip'); - - // strip gz ending and lookup mime type - contentType = mime.lookup(path.basename(file, ".gz")); - } - - res.setHeader('content-type', contentType || 'application/octet-stream'); - - if (req.method === "HEAD") { - res.statusCode = req.statusCode || 200; // overridden for 404's - return res.end(); - } - - var stream = fs.createReadStream(file); - - stream.pipe(res); - stream.on('error', function (err) { - status['500'](res, next, { error: err }); - }); - - stream.on('end', function () { - res.statusCode = 200; - res.end(); - }); - } - }; -}; - -ecstatic.version = version; -ecstatic.showDir = showDir; - -// Check to see if we should try to compress a file with gzip. -function shouldCompress(req) { - var headers = req.headers; - - return headers && headers['accept-encoding'] && - headers['accept-encoding'] - .split(",") - .some(function (el) { - return ['*','compress', 'gzip', 'deflate'].indexOf(el) != -1; - }) - ; -} - -if(!module.parent) { - var http = require('http'), - opts = require('optimist').argv, - port = opts.port || opts.p || 8000, - dir = opts.root || opts._[0] || process.cwd(); - - if(opts.help || opts.h) { - var u = console.error; - u('usage: ecstatic [dir] {options} --port PORT'); - u('see https://npm.im/ecstatic for more docs'); - return; - } - - http.createServer(ecstatic(dir, opts)) - .listen(port, function () { - console.log('ecstatic serving ' + dir + ' on port ' + port); - }); -} diff --git a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/etag.js b/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/etag.js deleted file mode 100644 index 5991d84155..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/etag.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (stat) { - return JSON.stringify([stat.ino, stat.size, stat.mtime].join('-')); -} diff --git a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/opts.js b/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/opts.js deleted file mode 100644 index 9a9335cb28..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/opts.js +++ /dev/null @@ -1,100 +0,0 @@ -// This is so you can have options aliasing and defaults in one place. - -module.exports = function (opts) { - - var autoIndex = true, - showDir = false, - humanReadable = true, - si = false, - cache = 'max-age=3600', - gzip = false, - defaultExt, - handleError = true; - - if (opts) { - [ - 'autoIndex', - 'autoindex' - ].some(function (k) { - if (typeof opts[k] !== 'undefined' && opts[k] !== null) { - autoIndex = opts[k]; - return true; - } - }); - - [ - 'showDir', - 'showdir' - ].some(function (k) { - if (typeof opts[k] !== 'undefined' && opts[k] !== null) { - showDir = opts[k]; - return true; - } - }); - - [ - 'humanReadable', - 'humanreadable', - 'human-readable' - ].some(function (k) { - if (typeof opts[k] !== 'undefined' && opts[k] !== null) { - humanReadable = opts[k]; - return true; - } - }); - - [ - 'si', - 'index' - ].some(function (k) { - if (typeof opts[k] !== 'undefined' && opts[k] !== null) { - si = opts[k]; - return true; - } - }); - - if (opts.defaultExt) { - if (opts.defaultExt === true) { - defaultExt = 'html'; - } - else { - defaultExt = opts.defaultExt; - } - } - - if (typeof opts.cache !== 'undefined' && opts.cache !== null) { - if (typeof opts.cache === 'string') { - cache = opts.cache; - } - else if(typeof opts.cache === 'number') { - cache = 'max-age=' + opts.cache; - } - } - - if (typeof opts.gzip !== 'undefined' && opts.gzip !== null) { - gzip = opts.gzip; - } - - [ - 'handleError', - 'handleerror' - ].some(function (k) { - if (typeof opts[k] !== 'undefined' && opts[k] !== null) { - handleError = opts[k]; - return true; - } - }); - } - - return { - cache: cache, - autoIndex: autoIndex, - showDir: showDir, - humanReadable: humanReadable, - si: si, - defaultExt: defaultExt, - baseDir: (opts && opts.baseDir) || '/', - gzip: gzip, - handleError: handleError - }; -}; diff --git a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/showdir.js b/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/showdir.js deleted file mode 100644 index b0bb2abf6d..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/showdir.js +++ /dev/null @@ -1,199 +0,0 @@ -var ecstatic = require('../ecstatic'), - fs = require('fs'), - path = require('path'), - ent = require('ent'), - etag = require('./etag'), - url = require('url'), - status = require('./status-handlers'); - -module.exports = function (opts, stat) { - // opts are parsed by opts.js, defaults already applied - var cache = opts.cache, - root = path.resolve(opts.root), - baseDir = opts.baseDir, - humanReadable = opts.humanReadable, - si = opts.si; - - return function middleware (req, res, next) { - - // Figure out the path for the file from the given url - var parsed = url.parse(req.url), - pathname = decodeURI(parsed.pathname), - dir = path.normalize( - path.join(root, - path.relative( - path.join('/', baseDir), - pathname - ) - ) - ); - - fs.stat(dir, function (err, stat) { - if (err) { - return status[500](res, next, { error: err }); - } - - // files are the listing of dir - fs.readdir(dir, function (err, files) { - if (err) { - return status[500](res, next, { error: err }); - } - res.setHeader('content-type', 'text/html'); - res.setHeader('etag', etag(stat)); - res.setHeader('last-modified', (new Date(stat.mtime)).toUTCString()); - res.setHeader('cache-control', cache); - - sortByIsDirectory(files, function (errs, dirs, files) { - - if (errs.length > 0) { - return status[500](res, next, { error: errs[0] }); - } - - // if it makes sense to, add a .. link - if (path.resolve(dir, '..').slice(0, root.length) == root) { - return fs.stat(path.join(dir, '..'), function (err, s) { - if (err) { - return status[500](res, next, { error: err }); - } - dirs.unshift([ '..', s ]); - render(dirs, files); - }); - } - render(dirs, files); - }); - - function sortByIsDirectory(paths, cb) { - // take the listing file names in `dir` - // returns directory and file array, each entry is - // of the array a [name, stat] tuple - var pending = paths.length, - errs = [], - dirs = [], - files = []; - - if (!pending) { - return cb(errs, dirs, files); - } - - paths.forEach(function (file) { - fs.stat(path.join(dir, file), function (err, s) { - if (err) { - errs.push(err); - } - else if (s.isDirectory()) { - dirs.push([file, s]); - } - else { - files.push([file, s]); - } - - if (--pending === 0) { - cb(errs, dirs, files); - } - }); - }); - } - - function render(dirs, files) { - // each entry in the array is a [name, stat] tuple - - // TODO: use stylessheets? - var html = '\ - \ - \ - \ - Index of ' + pathname +' \ - \ - \ -

Index of ' + pathname + '

\n'; - - html += ''; - - var failed = false; - var writeRow = function (file, i) { - // render a row given a [name, stat] tuple - var isDir = file[1].isDirectory(); - var href = - parsed.pathname.replace(/\/$/, '') + - '/' + encodeURIComponent(file[0]); - - // append trailing slash and query for dir entry - if (isDir) { - href += '/' + ((parsed.search)? parsed.search:''); - } - - var displayName = ent.encode(file[0]) + ((isDir)? '/':''); - - // TODO: use stylessheets? - html += '' + - '' + - '' + - '' + - '\n'; - }; - - dirs.sort(function (a, b) { return b[0] - a[0]; } ).forEach(writeRow); - files.sort(function (a, b) { return b.toString().localeCompare(a.toString()); }).forEach(writeRow); - - html += '
(' + permsToString(file[1]) + ')' + sizeToString(file[1], humanReadable, si) + '' + displayName + '
\n'; - html += '
Node.js ' + - process.version + - '/ ecstatic ' + - 'server running @ ' + - ent.encode(req.headers.host || '') + '
\n' + - '' - ; - - if (!failed) { - res.writeHead(200, { "Content-Type": "text/html" }); - res.end(html); - } - } - }); - }); - }; -}; - -function permsToString(stat) { - var dir = stat.isDirectory() ? 'd' : '-', - mode = stat.mode.toString(8); - - return dir + mode.slice(-3).split('').map(function (n) { - return [ - '---', - '--x', - '-w-', - '-wx', - 'r--', - 'r-x', - 'rw-', - 'rwx' - ][parseInt(n, 10)]; - }).join(''); -} - -// given a file's stat, return the size of it in string -// humanReadable: (boolean) whether to result is human readable -// si: (boolean) whether to use si (1k = 1000), otherwise 1k = 1024 -// adopted from http://stackoverflow.com/a/14919494/665507 -function sizeToString(stat, humanReadable, si) { - if (stat.isDirectory()) { - return ''; - } - - var sizeString = ''; - var bytes = stat.size; - var threshold = si ? 1000 : 1024; - - if(!humanReadable || bytes < threshold) { - return bytes + 'B'; - } - - var units = ['k','M','G','T','P','E','Z','Y']; - var u = -1; - do { - bytes /= threshold; - ++u; - } while (bytes >= threshold); - return bytes.toFixed(1)+units[u]; -} diff --git a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/status-handlers.js b/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/status-handlers.js deleted file mode 100644 index 96dacfd9c9..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/lib/ecstatic/status-handlers.js +++ /dev/null @@ -1,57 +0,0 @@ -// not modified -exports['304'] = function (res, next) { - res.statusCode = 304; - res.end(); -}; - -// access denied -exports['403'] = function (res, next) { - res.statusCode = 403; - if (typeof next === "function") { - next(); - } - else { - if (res.writable) { - res.setHeader('content-type', 'text/plain'); - res.end('ACCESS DENIED'); - } - } -}; - -// disallowed method -exports['405'] = function (res, next, opts) { - res.statusCode = 405; - if (typeof next === "function") { - next(); - } - else { - res.setHeader('allow', (opts && opts.allow) || 'GET, HEAD'); - res.end(); - } -}; - -// not found -exports['404'] = function (res, next) { - res.statusCode = 404; - if (typeof next === "function") { - next(); - } - else { - if (res.writable) { - res.setHeader('content-type', 'text/plain'); - res.end('File not found. :('); - } - } -}; - -// flagrant error -exports['500'] = function (res, next, opts) { - res.statusCode = 500; - res.end(opts.error.stack || opts.error.toString() || "No specified error"); -}; - -// bad request -exports['400'] = function (res, next, opts) { - res.statusCode = 400; - res.end(opts && opts.error ? String(opts.error) : 'Malformed request.'); -}; diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/.npmignore b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/.travis.yml b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/.travis.yml deleted file mode 100644 index 895dbd3623..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/LICENSE b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/LICENSE deleted file mode 100644 index ee27ba4b44..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/entities.json b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/entities.json deleted file mode 100644 index 5448ebca35..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/entities.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "amp" : "&", - "gt" : ">", - "lt" : "<", - "quot" : "\"", - "apos" : "'", - "AElig" : 198, - "Aacute" : 193, - "Acirc" : 194, - "Agrave" : 192, - "Aring" : 197, - "Atilde" : 195, - "Auml" : 196, - "Ccedil" : 199, - "ETH" : 208, - "Eacute" : 201, - "Ecirc" : 202, - "Egrave" : 200, - "Euml" : 203, - "Iacute" : 205, - "Icirc" : 206, - "Igrave" : 204, - "Iuml" : 207, - "Ntilde" : 209, - "Oacute" : 211, - "Ocirc" : 212, - "Ograve" : 210, - "Oslash" : 216, - "Otilde" : 213, - "Ouml" : 214, - "THORN" : 222, - "Uacute" : 218, - "Ucirc" : 219, - "Ugrave" : 217, - "Uuml" : 220, - "Yacute" : 221, - "aacute" : 225, - "acirc" : 226, - "aelig" : 230, - "agrave" : 224, - "aring" : 229, - "atilde" : 227, - "auml" : 228, - "ccedil" : 231, - "eacute" : 233, - "ecirc" : 234, - "egrave" : 232, - "eth" : 240, - "euml" : 235, - "iacute" : 237, - "icirc" : 238, - "igrave" : 236, - "iuml" : 239, - "ntilde" : 241, - "oacute" : 243, - "ocirc" : 244, - "ograve" : 242, - "oslash" : 248, - "otilde" : 245, - "ouml" : 246, - "szlig" : 223, - "thorn" : 254, - "uacute" : 250, - "ucirc" : 251, - "ugrave" : 249, - "uuml" : 252, - "yacute" : 253, - "yuml" : 255, - "copy" : 169, - "reg" : 174, - "nbsp" : 160, - "iexcl" : 161, - "cent" : 162, - "pound" : 163, - "curren" : 164, - "yen" : 165, - "brvbar" : 166, - "sect" : 167, - "uml" : 168, - "ordf" : 170, - "laquo" : 171, - "not" : 172, - "shy" : 173, - "macr" : 175, - "deg" : 176, - "plusmn" : 177, - "sup1" : 185, - "sup2" : 178, - "sup3" : 179, - "acute" : 180, - "micro" : 181, - "para" : 182, - "middot" : 183, - "cedil" : 184, - "ordm" : 186, - "raquo" : 187, - "frac14" : 188, - "frac12" : 189, - "frac34" : 190, - "iquest" : 191, - "times" : 215, - "divide" : 247, - "OElig;" : 338, - "oelig;" : 339, - "Scaron;" : 352, - "scaron;" : 353, - "Yuml;" : 376, - "fnof;" : 402, - "circ;" : 710, - "tilde;" : 732, - "Alpha;" : 913, - "Beta;" : 914, - "Gamma;" : 915, - "Delta;" : 916, - "Epsilon;" : 917, - "Zeta;" : 918, - "Eta;" : 919, - "Theta;" : 920, - "Iota;" : 921, - "Kappa;" : 922, - "Lambda;" : 923, - "Mu;" : 924, - "Nu;" : 925, - "Xi;" : 926, - "Omicron;" : 927, - "Pi;" : 928, - "Rho;" : 929, - "Sigma;" : 931, - "Tau;" : 932, - "Upsilon;" : 933, - "Phi;" : 934, - "Chi;" : 935, - "Psi;" : 936, - "Omega;" : 937, - "alpha;" : 945, - "beta;" : 946, - "gamma;" : 947, - "delta;" : 948, - "epsilon;" : 949, - "zeta;" : 950, - "eta;" : 951, - "theta;" : 952, - "iota;" : 953, - "kappa;" : 954, - "lambda;" : 955, - "mu;" : 956, - "nu;" : 957, - "xi;" : 958, - "omicron;" : 959, - "pi;" : 960, - "rho;" : 961, - "sigmaf;" : 962, - "sigma;" : 963, - "tau;" : 964, - "upsilon;" : 965, - "phi;" : 966, - "chi;" : 967, - "psi;" : 968, - "omega;" : 969, - "thetasym;" : 977, - "upsih;" : 978, - "piv;" : 982, - "ensp;" : 8194, - "emsp;" : 8195, - "thinsp;" : 8201, - "zwnj;" : 8204, - "zwj;" : 8205, - "lrm;" : 8206, - "rlm;" : 8207, - "ndash;" : 8211, - "mdash;" : 8212, - "lsquo;" : 8216, - "rsquo;" : 8217, - "sbquo;" : 8218, - "ldquo;" : 8220, - "rdquo;" : 8221, - "bdquo;" : 8222, - "dagger;" : 8224, - "Dagger;" : 8225, - "bull;" : 8226, - "hellip;" : 8230, - "permil;" : 8240, - "prime;" : 8242, - "Prime;" : 8243, - "lsaquo;" : 8249, - "rsaquo;" : 8250, - "oline;" : 8254, - "frasl;" : 8260, - "euro;" : 8364, - "image;" : 8465, - "weierp;" : 8472, - "real;" : 8476, - "trade;" : 8482, - "alefsym;" : 8501, - "larr;" : 8592, - "uarr;" : 8593, - "rarr;" : 8594, - "darr;" : 8595, - "harr;" : 8596, - "crarr;" : 8629, - "lArr;" : 8656, - "uArr;" : 8657, - "rArr;" : 8658, - "dArr;" : 8659, - "hArr;" : 8660, - "forall;" : 8704, - "part;" : 8706, - "exist;" : 8707, - "empty;" : 8709, - "nabla;" : 8711, - "isin;" : 8712, - "notin;" : 8713, - "ni;" : 8715, - "prod;" : 8719, - "sum;" : 8721, - "minus;" : 8722, - "lowast;" : 8727, - "radic;" : 8730, - "prop;" : 8733, - "infin;" : 8734, - "ang;" : 8736, - "and;" : 8743, - "or;" : 8744, - "cap;" : 8745, - "cup;" : 8746, - "int;" : 8747, - "there4;" : 8756, - "sim;" : 8764, - "cong;" : 8773, - "asymp;" : 8776, - "ne;" : 8800, - "equiv;" : 8801, - "le;" : 8804, - "ge;" : 8805, - "sub;" : 8834, - "sup;" : 8835, - "nsub;" : 8836, - "sube;" : 8838, - "supe;" : 8839, - "oplus;" : 8853, - "otimes;" : 8855, - "perp;" : 8869, - "sdot;" : 8901, - "lceil;" : 8968, - "rceil;" : 8969, - "lfloor;" : 8970, - "rfloor;" : 8971, - "lang;" : 9001, - "rang;" : 9002, - "loz;" : 9674, - "spades;" : 9824, - "clubs;" : 9827, - "hearts;" : 9829, - "diams;" : 9830 -} diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/index.js b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/index.js deleted file mode 100644 index 02384261ef..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/index.js +++ /dev/null @@ -1,63 +0,0 @@ -var punycode = require('punycode'); -var entities = require('./entities.json'); - -var revEntities = {}; -for (var key in entities) { - var e = entities[key]; - var s = typeof e === 'number' ? String.fromCharCode(e) : e; - revEntities[s] = key; -} - -exports.encode = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a String'); - } - - return str.split('').map(function (c) { - var e = revEntities[c]; - var cc = c.charCodeAt(0); - if (e) { - return '&' + (e.match(/;$/) ? e : e + ';'); - } - else if (c.match(/\s/)) { - return c; - } - else if (cc < 32 || cc >= 127) { - return '&#' + cc + ';'; - } - else { - return c; - } - }).join(''); -}; - -exports.decode = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a String'); - } - - return str - .replace(/&#(\d+);?/g, function (_, code) { - return punycode.ucs2.encode([code]); - }) - .replace(/&#[xX]([A-Fa-f0-9]+);?/g, function (_, hex) { - return punycode.ucs2.encode([parseInt(hex, 16)]); - }) - .replace(/&([^;\W]+;?)/g, function (m, e) { - var ee = e.replace(/;$/, ''); - var target = entities[e] - || (e.match(/;$/) && entities[ee]) - ; - - if (typeof target === 'number') { - return punycode.ucs2.encode([target]); - } - else if (typeof target === 'string') { - return target; - } - else { - return m; - } - }) - ; -}; diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/package.json b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/package.json deleted file mode 100644 index 4f65b930b1..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/ent/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "ent", - "description": "Encode and decode HTML entities", - "version": "0.0.7", - "repository": { - "type": "git", - "url": "https://github.com/substack/node-ent.git" - }, - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index.js", - "keywords": [ - "entities", - "entitify", - "entity", - "html", - "encode", - "decode" - ], - "license": "MIT", - "scripts": { - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "devDependencies": { - "tap": "~0.4.3", - "tape": "~1.0.4" - }, - "readme": "# ent\n\nEncode and decode HTML entities\n\n[![browser support](http://ci.testling.com/substack/node-ent.png)](http://ci.testling.com/substack/node-ent)\n\n[![build status](https://secure.travis-ci.org/substack/node-ent.png)](http://travis-ci.org/substack/node-ent)\n\n# example\n\n``` js\nvar ent = require('ent');\nconsole.log(ent.encode('©moo'))\nconsole.log(ent.decode('π & ρ'));\n```\n\n```\n<span>©moo</span>\nπ & ρ\n```\n\n![ent](http://substack.net/images/ent.png)\n\n# methods\n\n## encode(str)\n\nEscape unsafe characters in `str` with html entities.\n\n## decode(str)\n\nConvert html entities in `str` back to raw text.\n\n# credits\n\nHTML entity tables shamelessly lifted from perl's\n[HTML::Entities](http://cpansearch.perl.org/src/GAAS/HTML-Parser-3.68/lib/HTML/Entities.pm)\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install ent\n```\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-ent/issues" - }, - "homepage": "https://github.com/substack/node-ent", - "_id": "ent@0.0.7", - "_shasum": "835d4e7f9e7a8d4921c692e9010ec976da5e9949", - "_from": "ent@0.0.x", - "_resolved": "https://registry.npmjs.org/ent/-/ent-0.0.7.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/LICENSE b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/LICENSE deleted file mode 100644 index 451fc4550c..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/mime.js b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/mime.js deleted file mode 100644 index 48be0c5e42..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/mime.js +++ /dev/null @@ -1,114 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -function Mime() { - // Map of extension -> mime type - this.types = Object.create(null); - - // Map of mime type -> extension - this.extensions = Object.create(null); -} - -/** - * Define mimetype -> extension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * @param map (Object) type definitions - */ -Mime.prototype.define = function (map) { - for (var type in map) { - var exts = map[type]; - - for (var i = 0; i < exts.length; i++) { - if (process.env.DEBUG_MIME && this.types[exts]) { - console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + - this.types[exts] + ' to ' + type); - } - - this.types[exts[i]] = type; - } - - // Default extension is the first one we encounter - if (!this.extensions[type]) { - this.extensions[type] = exts[0]; - } - } -}; - -/** - * Load an Apache2-style ".types" file - * - * This may be called multiple times (it's expected). Where files declare - * overlapping types/extensions, the last file wins. - * - * @param file (String) path of file to load. - */ -Mime.prototype.load = function(file) { - - this._loading = file; - // Read file and split into lines - var map = {}, - content = fs.readFileSync(file, 'ascii'), - lines = content.split(/[\r\n]+/); - - lines.forEach(function(line) { - // Clean up whitespace/comments, and split into fields - var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); - map[fields.shift()] = fields; - }); - - this.define(map); - - this._loading = null; -}; - -/** - * Lookup a mime type based on extension - */ -Mime.prototype.lookup = function(path, fallback) { - var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); - - return this.types[ext] || fallback || this.default_type; -}; - -/** - * Return file extension associated with a mime type - */ -Mime.prototype.extension = function(mimeType) { - var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); - return this.extensions[type]; -}; - -// Default instance -var mime = new Mime(); - -// Load local copy of -// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -mime.load(path.join(__dirname, 'types/mime.types')); - -// Load additional types from node.js community -mime.load(path.join(__dirname, 'types/node.types')); - -// Default type -mime.default_type = mime.lookup('bin'); - -// -// Additional API specific to the default instance -// - -mime.Mime = Mime; - -/** - * Lookup a charset based on mime type. - */ -mime.charsets = { - lookup: function(mimeType, fallback) { - // Assume text types are utf8 - return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; - } -}; - -module.exports = mime; diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/package.json b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/package.json deleted file mode 100644 index 97e57ea7b4..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com", - "url": "http://github.com/broofa" - }, - "contributors": [ - { - "name": "Benjamin Thomas", - "email": "benjamin@benjaminthomas.org", - "url": "http://github.com/bentomas" - } - ], - "dependencies": {}, - "description": "A comprehensive library for mime-type mapping", - "devDependencies": {}, - "keywords": [ - "util", - "mime" - ], - "main": "mime.js", - "name": "mime", - "repository": { - "url": "https://github.com/broofa/node-mime", - "type": "git" - }, - "version": "1.2.11", - "readme": "# mime\n\nComprehensive 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.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/broofa/node-mime/issues" - }, - "homepage": "https://github.com/broofa/node-mime", - "_id": "mime@1.2.11", - "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", - "_from": "mime@1.2.x", - "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "scripts": {} -} diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/test.js b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/test.js deleted file mode 100644 index 2cda1c7ad1..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/test.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Usage: node test.js - */ - -var mime = require('./mime'); -var assert = require('assert'); -var path = require('path'); - -function eq(a, b) { - console.log('Test: ' + a + ' === ' + b); - assert.strictEqual.apply(null, arguments); -} - -console.log(Object.keys(mime.extensions).length + ' types'); -console.log(Object.keys(mime.types).length + ' extensions\n'); - -// -// Test mime lookups -// - -eq('text/plain', mime.lookup('text.txt')); // normal file -eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase -eq('text/plain', mime.lookup('dir/text.txt')); // dir + file -eq('text/plain', mime.lookup('.text.txt')); // hidden file -eq('text/plain', mime.lookup('.txt')); // nameless -eq('text/plain', mime.lookup('txt')); // extension-only -eq('text/plain', mime.lookup('/txt')); // extension-less () -eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less -eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized -eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default - -// -// Test extensions -// - -eq('txt', mime.extension(mime.types.text)); -eq('html', mime.extension(mime.types.htm)); -eq('bin', mime.extension('application/octet-stream')); -eq('bin', mime.extension('application/octet-stream ')); -eq('html', mime.extension(' text/html; charset=UTF-8')); -eq('html', mime.extension('text/html; charset=UTF-8 ')); -eq('html', mime.extension('text/html; charset=UTF-8')); -eq('html', mime.extension('text/html ; charset=UTF-8')); -eq('html', mime.extension('text/html;charset=UTF-8')); -eq('html', mime.extension('text/Html;charset=UTF-8')); -eq(undefined, mime.extension('unrecognized')); - -// -// Test node.types lookups -// - -eq('application/font-woff', mime.lookup('file.woff')); -eq('application/octet-stream', mime.lookup('file.buffer')); -eq('audio/mp4', mime.lookup('file.m4a')); -eq('font/opentype', mime.lookup('file.otf')); - -// -// Test charsets -// - -eq('UTF-8', mime.charsets.lookup('text/plain')); -eq(undefined, mime.charsets.lookup(mime.types.js)); -eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); - -// -// Test for overlaps between mime.types and node.types -// - -var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime(); -apacheTypes.load(path.join(__dirname, 'types/mime.types')); -nodeTypes.load(path.join(__dirname, 'types/node.types')); - -var keys = [].concat(Object.keys(apacheTypes.types)) - .concat(Object.keys(nodeTypes.types)); -keys.sort(); -for (var i = 1; i < keys.length; i++) { - if (keys[i] == keys[i-1]) { - console.warn('Warning: ' + - 'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] + - ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]); - } -} - -console.log('\nOK'); diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/types/mime.types b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/types/mime.types deleted file mode 100644 index da8cd69187..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/types/mime.types +++ /dev/null @@ -1,1588 +0,0 @@ -# This file maps Internet media types to unique file extension(s). -# Although created for httpd, this file is used by many software systems -# and has been placed in the public domain for unlimited redisribution. -# -# The table below contains both registered and (common) unregistered types. -# A type that has no unique extension can be ignored -- they are listed -# here to guide configurations toward known types and to make it easier to -# identify "new" types. File extensions are also commonly used to indicate -# content languages and encodings, so choose them carefully. -# -# Internet media types should be registered as described in RFC 4288. -# The registry is at . -# -# MIME type (lowercased) Extensions -# ============================================ ========== -# application/1d-interleaved-parityfec -# application/3gpp-ims+xml -# application/activemessage -application/andrew-inset ez -# application/applefile -application/applixware aw -application/atom+xml atom -application/atomcat+xml atomcat -# application/atomicmail -application/atomsvc+xml atomsvc -# application/auth-policy+xml -# application/batch-smtp -# application/beep+xml -# application/calendar+xml -# application/cals-1840 -# application/ccmp+xml -application/ccxml+xml ccxml -application/cdmi-capability cdmia -application/cdmi-container cdmic -application/cdmi-domain cdmid -application/cdmi-object cdmio -application/cdmi-queue cdmiq -# application/cea-2018+xml -# application/cellml+xml -# application/cfw -# application/cnrp+xml -# application/commonground -# application/conference-info+xml -# application/cpl+xml -# application/csta+xml -# application/cstadata+xml -application/cu-seeme cu -# application/cybercash -application/davmount+xml davmount -# application/dca-rft -# application/dec-dx -# application/dialog-info+xml -# application/dicom -# application/dns -application/docbook+xml dbk -# application/dskpp+xml -application/dssc+der dssc -application/dssc+xml xdssc -# application/dvcs -application/ecmascript ecma -# application/edi-consent -# application/edi-x12 -# application/edifact -application/emma+xml emma -# application/epp+xml -application/epub+zip epub -# application/eshop -# application/example -application/exi exi -# application/fastinfoset -# application/fastsoap -# application/fits -application/font-tdpfr pfr -# application/framework-attributes+xml -application/gml+xml gml -application/gpx+xml gpx -application/gxf gxf -# application/h224 -# application/held+xml -# application/http -application/hyperstudio stk -# application/ibe-key-request+xml -# application/ibe-pkg-reply+xml -# application/ibe-pp-data -# application/iges -# application/im-iscomposing+xml -# application/index -# application/index.cmd -# application/index.obj -# application/index.response -# application/index.vnd -application/inkml+xml ink inkml -# application/iotp -application/ipfix ipfix -# application/ipp -# application/isup -application/java-archive jar -application/java-serialized-object ser -application/java-vm class -application/javascript js -application/json json -application/jsonml+json jsonml -# application/kpml-request+xml -# application/kpml-response+xml -application/lost+xml lostxml -application/mac-binhex40 hqx -application/mac-compactpro cpt -# application/macwriteii -application/mads+xml mads -application/marc mrc -application/marcxml+xml mrcx -application/mathematica ma nb mb -# application/mathml-content+xml -# application/mathml-presentation+xml -application/mathml+xml mathml -# application/mbms-associated-procedure-description+xml -# application/mbms-deregister+xml -# application/mbms-envelope+xml -# application/mbms-msk+xml -# application/mbms-msk-response+xml -# application/mbms-protection-description+xml -# application/mbms-reception-report+xml -# application/mbms-register+xml -# application/mbms-register-response+xml -# application/mbms-user-service-description+xml -application/mbox mbox -# application/media_control+xml -application/mediaservercontrol+xml mscml -application/metalink+xml metalink -application/metalink4+xml meta4 -application/mets+xml mets -# application/mikey -application/mods+xml mods -# application/moss-keys -# application/moss-signature -# application/mosskey-data -# application/mosskey-request -application/mp21 m21 mp21 -application/mp4 mp4s -# application/mpeg4-generic -# application/mpeg4-iod -# application/mpeg4-iod-xmt -# application/msc-ivr+xml -# application/msc-mixer+xml -application/msword doc dot -application/mxf mxf -# application/nasdata -# application/news-checkgroups -# application/news-groupinfo -# application/news-transmission -# application/nss -# application/ocsp-request -# application/ocsp-response -application/octet-stream bin dms lrf mar so dist distz pkg bpk dump elc deploy -application/oda oda -application/oebps-package+xml opf -application/ogg ogx -application/omdoc+xml omdoc -application/onenote onetoc onetoc2 onetmp onepkg -application/oxps oxps -# application/parityfec -application/patch-ops-error+xml xer -application/pdf pdf -application/pgp-encrypted pgp -# application/pgp-keys -application/pgp-signature asc sig -application/pics-rules prf -# application/pidf+xml -# application/pidf-diff+xml -application/pkcs10 p10 -application/pkcs7-mime p7m p7c -application/pkcs7-signature p7s -application/pkcs8 p8 -application/pkix-attr-cert ac -application/pkix-cert cer -application/pkix-crl crl -application/pkix-pkipath pkipath -application/pkixcmp pki -application/pls+xml pls -# application/poc-settings+xml -application/postscript ai eps ps -# application/prs.alvestrand.titrax-sheet -application/prs.cww cww -# application/prs.nprend -# application/prs.plucker -# application/prs.rdf-xml-crypt -# application/prs.xsf+xml -application/pskc+xml pskcxml -# application/qsig -application/rdf+xml rdf -application/reginfo+xml rif -application/relax-ng-compact-syntax rnc -# application/remote-printing -application/resource-lists+xml rl -application/resource-lists-diff+xml rld -# application/riscos -# application/rlmi+xml -application/rls-services+xml rs -application/rpki-ghostbusters gbr -application/rpki-manifest mft -application/rpki-roa roa -# application/rpki-updown -application/rsd+xml rsd -application/rss+xml rss -application/rtf rtf -# application/rtx -# application/samlassertion+xml -# application/samlmetadata+xml -application/sbml+xml sbml -application/scvp-cv-request scq -application/scvp-cv-response scs -application/scvp-vp-request spq -application/scvp-vp-response spp -application/sdp sdp -# application/set-payment -application/set-payment-initiation setpay -# application/set-registration -application/set-registration-initiation setreg -# application/sgml -# application/sgml-open-catalog -application/shf+xml shf -# application/sieve -# application/simple-filter+xml -# application/simple-message-summary -# application/simplesymbolcontainer -# application/slate -# application/smil -application/smil+xml smi smil -# application/soap+fastinfoset -# application/soap+xml -application/sparql-query rq -application/sparql-results+xml srx -# application/spirits-event+xml -application/srgs gram -application/srgs+xml grxml -application/sru+xml sru -application/ssdl+xml ssdl -application/ssml+xml ssml -# application/tamp-apex-update -# application/tamp-apex-update-confirm -# application/tamp-community-update -# application/tamp-community-update-confirm -# application/tamp-error -# application/tamp-sequence-adjust -# application/tamp-sequence-adjust-confirm -# application/tamp-status-query -# application/tamp-status-response -# application/tamp-update -# application/tamp-update-confirm -application/tei+xml tei teicorpus -application/thraud+xml tfi -# application/timestamp-query -# application/timestamp-reply -application/timestamped-data tsd -# application/tve-trigger -# application/ulpfec -# application/vcard+xml -# application/vemmi -# application/vividence.scriptfile -# application/vnd.3gpp.bsf+xml -application/vnd.3gpp.pic-bw-large plb -application/vnd.3gpp.pic-bw-small psb -application/vnd.3gpp.pic-bw-var pvb -# application/vnd.3gpp.sms -# application/vnd.3gpp2.bcmcsinfo+xml -# application/vnd.3gpp2.sms -application/vnd.3gpp2.tcap tcap -application/vnd.3m.post-it-notes pwn -application/vnd.accpac.simply.aso aso -application/vnd.accpac.simply.imp imp -application/vnd.acucobol acu -application/vnd.acucorp atc acutc -application/vnd.adobe.air-application-installer-package+zip air -application/vnd.adobe.formscentral.fcdt fcdt -application/vnd.adobe.fxp fxp fxpl -# application/vnd.adobe.partial-upload -application/vnd.adobe.xdp+xml xdp -application/vnd.adobe.xfdf xfdf -# application/vnd.aether.imp -# application/vnd.ah-barcode -application/vnd.ahead.space ahead -application/vnd.airzip.filesecure.azf azf -application/vnd.airzip.filesecure.azs azs -application/vnd.amazon.ebook azw -application/vnd.americandynamics.acc acc -application/vnd.amiga.ami ami -# application/vnd.amundsen.maze+xml -application/vnd.android.package-archive apk -application/vnd.anser-web-certificate-issue-initiation cii -application/vnd.anser-web-funds-transfer-initiation fti -application/vnd.antix.game-component atx -application/vnd.apple.installer+xml mpkg -application/vnd.apple.mpegurl m3u8 -# application/vnd.arastra.swi -application/vnd.aristanetworks.swi swi -application/vnd.astraea-software.iota iota -application/vnd.audiograph aep -# application/vnd.autopackage -# application/vnd.avistar+xml -application/vnd.blueice.multipass mpm -# application/vnd.bluetooth.ep.oob -application/vnd.bmi bmi -application/vnd.businessobjects rep -# application/vnd.cab-jscript -# application/vnd.canon-cpdl -# application/vnd.canon-lips -# application/vnd.cendio.thinlinc.clientconf -application/vnd.chemdraw+xml cdxml -application/vnd.chipnuts.karaoke-mmd mmd -application/vnd.cinderella cdy -# application/vnd.cirpack.isdn-ext -application/vnd.claymore cla -application/vnd.cloanto.rp9 rp9 -application/vnd.clonk.c4group c4g c4d c4f c4p c4u -application/vnd.cluetrust.cartomobile-config c11amc -application/vnd.cluetrust.cartomobile-config-pkg c11amz -# application/vnd.collection+json -# application/vnd.commerce-battelle -application/vnd.commonspace csp -application/vnd.contact.cmsg cdbcmsg -application/vnd.cosmocaller cmc -application/vnd.crick.clicker clkx -application/vnd.crick.clicker.keyboard clkk -application/vnd.crick.clicker.palette clkp -application/vnd.crick.clicker.template clkt -application/vnd.crick.clicker.wordbank clkw -application/vnd.criticaltools.wbs+xml wbs -application/vnd.ctc-posml pml -# application/vnd.ctct.ws+xml -# application/vnd.cups-pdf -# application/vnd.cups-postscript -application/vnd.cups-ppd ppd -# application/vnd.cups-raster -# application/vnd.cups-raw -# application/vnd.curl -application/vnd.curl.car car -application/vnd.curl.pcurl pcurl -# application/vnd.cybank -application/vnd.dart dart -application/vnd.data-vision.rdz rdz -application/vnd.dece.data uvf uvvf uvd uvvd -application/vnd.dece.ttml+xml uvt uvvt -application/vnd.dece.unspecified uvx uvvx -application/vnd.dece.zip uvz uvvz -application/vnd.denovo.fcselayout-link fe_launch -# application/vnd.dir-bi.plate-dl-nosuffix -application/vnd.dna dna -application/vnd.dolby.mlp mlp -# application/vnd.dolby.mobile.1 -# application/vnd.dolby.mobile.2 -application/vnd.dpgraph dpg -application/vnd.dreamfactory dfac -application/vnd.ds-keypoint kpxx -application/vnd.dvb.ait ait -# application/vnd.dvb.dvbj -# application/vnd.dvb.esgcontainer -# application/vnd.dvb.ipdcdftnotifaccess -# application/vnd.dvb.ipdcesgaccess -# application/vnd.dvb.ipdcesgaccess2 -# application/vnd.dvb.ipdcesgpdd -# application/vnd.dvb.ipdcroaming -# application/vnd.dvb.iptv.alfec-base -# application/vnd.dvb.iptv.alfec-enhancement -# application/vnd.dvb.notif-aggregate-root+xml -# application/vnd.dvb.notif-container+xml -# application/vnd.dvb.notif-generic+xml -# application/vnd.dvb.notif-ia-msglist+xml -# application/vnd.dvb.notif-ia-registration-request+xml -# application/vnd.dvb.notif-ia-registration-response+xml -# application/vnd.dvb.notif-init+xml -# application/vnd.dvb.pfr -application/vnd.dvb.service svc -# application/vnd.dxr -application/vnd.dynageo geo -# application/vnd.easykaraoke.cdgdownload -# application/vnd.ecdis-update -application/vnd.ecowin.chart mag -# application/vnd.ecowin.filerequest -# application/vnd.ecowin.fileupdate -# application/vnd.ecowin.series -# application/vnd.ecowin.seriesrequest -# application/vnd.ecowin.seriesupdate -# application/vnd.emclient.accessrequest+xml -application/vnd.enliven nml -# application/vnd.eprints.data+xml -application/vnd.epson.esf esf -application/vnd.epson.msf msf -application/vnd.epson.quickanime qam -application/vnd.epson.salt slt -application/vnd.epson.ssf ssf -# application/vnd.ericsson.quickcall -application/vnd.eszigno3+xml es3 et3 -# application/vnd.etsi.aoc+xml -# application/vnd.etsi.cug+xml -# application/vnd.etsi.iptvcommand+xml -# application/vnd.etsi.iptvdiscovery+xml -# application/vnd.etsi.iptvprofile+xml -# application/vnd.etsi.iptvsad-bc+xml -# application/vnd.etsi.iptvsad-cod+xml -# application/vnd.etsi.iptvsad-npvr+xml -# application/vnd.etsi.iptvservice+xml -# application/vnd.etsi.iptvsync+xml -# application/vnd.etsi.iptvueprofile+xml -# application/vnd.etsi.mcid+xml -# application/vnd.etsi.overload-control-policy-dataset+xml -# application/vnd.etsi.sci+xml -# application/vnd.etsi.simservs+xml -# application/vnd.etsi.tsl+xml -# application/vnd.etsi.tsl.der -# application/vnd.eudora.data -application/vnd.ezpix-album ez2 -application/vnd.ezpix-package ez3 -# application/vnd.f-secure.mobile -application/vnd.fdf fdf -application/vnd.fdsn.mseed mseed -application/vnd.fdsn.seed seed dataless -# application/vnd.ffsns -# application/vnd.fints -application/vnd.flographit gph -application/vnd.fluxtime.clip ftc -# application/vnd.font-fontforge-sfd -application/vnd.framemaker fm frame maker book -application/vnd.frogans.fnc fnc -application/vnd.frogans.ltf ltf -application/vnd.fsc.weblaunch fsc -application/vnd.fujitsu.oasys oas -application/vnd.fujitsu.oasys2 oa2 -application/vnd.fujitsu.oasys3 oa3 -application/vnd.fujitsu.oasysgp fg5 -application/vnd.fujitsu.oasysprs bh2 -# application/vnd.fujixerox.art-ex -# application/vnd.fujixerox.art4 -# application/vnd.fujixerox.hbpl -application/vnd.fujixerox.ddd ddd -application/vnd.fujixerox.docuworks xdw -application/vnd.fujixerox.docuworks.binder xbd -# application/vnd.fut-misnet -application/vnd.fuzzysheet fzs -application/vnd.genomatix.tuxedo txd -# application/vnd.geocube+xml -application/vnd.geogebra.file ggb -application/vnd.geogebra.tool ggt -application/vnd.geometry-explorer gex gre -application/vnd.geonext gxt -application/vnd.geoplan g2w -application/vnd.geospace g3w -# application/vnd.globalplatform.card-content-mgt -# application/vnd.globalplatform.card-content-mgt-response -application/vnd.gmx gmx -application/vnd.google-earth.kml+xml kml -application/vnd.google-earth.kmz kmz -application/vnd.grafeq gqf gqs -# application/vnd.gridmp -application/vnd.groove-account gac -application/vnd.groove-help ghf -application/vnd.groove-identity-message gim -application/vnd.groove-injector grv -application/vnd.groove-tool-message gtm -application/vnd.groove-tool-template tpl -application/vnd.groove-vcard vcg -# application/vnd.hal+json -application/vnd.hal+xml hal -application/vnd.handheld-entertainment+xml zmm -application/vnd.hbci hbci -# application/vnd.hcl-bireports -application/vnd.hhe.lesson-player les -application/vnd.hp-hpgl hpgl -application/vnd.hp-hpid hpid -application/vnd.hp-hps hps -application/vnd.hp-jlyt jlt -application/vnd.hp-pcl pcl -application/vnd.hp-pclxl pclxl -# application/vnd.httphone -application/vnd.hydrostatix.sof-data sfd-hdstx -# application/vnd.hzn-3d-crossword -# application/vnd.ibm.afplinedata -# application/vnd.ibm.electronic-media -application/vnd.ibm.minipay mpy -application/vnd.ibm.modcap afp listafp list3820 -application/vnd.ibm.rights-management irm -application/vnd.ibm.secure-container sc -application/vnd.iccprofile icc icm -application/vnd.igloader igl -application/vnd.immervision-ivp ivp -application/vnd.immervision-ivu ivu -# application/vnd.informedcontrol.rms+xml -# application/vnd.informix-visionary -# application/vnd.infotech.project -# application/vnd.infotech.project+xml -# application/vnd.innopath.wamp.notification -application/vnd.insors.igm igm -application/vnd.intercon.formnet xpw xpx -application/vnd.intergeo i2g -# application/vnd.intertrust.digibox -# application/vnd.intertrust.nncp -application/vnd.intu.qbo qbo -application/vnd.intu.qfx qfx -# application/vnd.iptc.g2.conceptitem+xml -# application/vnd.iptc.g2.knowledgeitem+xml -# application/vnd.iptc.g2.newsitem+xml -# application/vnd.iptc.g2.newsmessage+xml -# application/vnd.iptc.g2.packageitem+xml -# application/vnd.iptc.g2.planningitem+xml -application/vnd.ipunplugged.rcprofile rcprofile -application/vnd.irepository.package+xml irp -application/vnd.is-xpr xpr -application/vnd.isac.fcs fcs -application/vnd.jam jam -# application/vnd.japannet-directory-service -# application/vnd.japannet-jpnstore-wakeup -# application/vnd.japannet-payment-wakeup -# application/vnd.japannet-registration -# application/vnd.japannet-registration-wakeup -# application/vnd.japannet-setstore-wakeup -# application/vnd.japannet-verification -# application/vnd.japannet-verification-wakeup -application/vnd.jcp.javame.midlet-rms rms -application/vnd.jisp jisp -application/vnd.joost.joda-archive joda -application/vnd.kahootz ktz ktr -application/vnd.kde.karbon karbon -application/vnd.kde.kchart chrt -application/vnd.kde.kformula kfo -application/vnd.kde.kivio flw -application/vnd.kde.kontour kon -application/vnd.kde.kpresenter kpr kpt -application/vnd.kde.kspread ksp -application/vnd.kde.kword kwd kwt -application/vnd.kenameaapp htke -application/vnd.kidspiration kia -application/vnd.kinar kne knp -application/vnd.koan skp skd skt skm -application/vnd.kodak-descriptor sse -application/vnd.las.las+xml lasxml -# application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop lbd -application/vnd.llamagraphics.life-balance.exchange+xml lbe -application/vnd.lotus-1-2-3 123 -application/vnd.lotus-approach apr -application/vnd.lotus-freelance pre -application/vnd.lotus-notes nsf -application/vnd.lotus-organizer org -application/vnd.lotus-screencam scm -application/vnd.lotus-wordpro lwp -application/vnd.macports.portpkg portpkg -# application/vnd.marlin.drm.actiontoken+xml -# application/vnd.marlin.drm.conftoken+xml -# application/vnd.marlin.drm.license+xml -# application/vnd.marlin.drm.mdcf -application/vnd.mcd mcd -application/vnd.medcalcdata mc1 -application/vnd.mediastation.cdkey cdkey -# application/vnd.meridian-slingshot -application/vnd.mfer mwf -application/vnd.mfmp mfm -application/vnd.micrografx.flo flo -application/vnd.micrografx.igx igx -application/vnd.mif mif -# application/vnd.minisoft-hp3000-save -# application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf daf -application/vnd.mobius.dis dis -application/vnd.mobius.mbk mbk -application/vnd.mobius.mqy mqy -application/vnd.mobius.msl msl -application/vnd.mobius.plc plc -application/vnd.mobius.txf txf -application/vnd.mophun.application mpn -application/vnd.mophun.certificate mpc -# application/vnd.motorola.flexsuite -# application/vnd.motorola.flexsuite.adsi -# application/vnd.motorola.flexsuite.fis -# application/vnd.motorola.flexsuite.gotap -# application/vnd.motorola.flexsuite.kmr -# application/vnd.motorola.flexsuite.ttc -# application/vnd.motorola.flexsuite.wem -# application/vnd.motorola.iprm -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry cil -# application/vnd.ms-asf -application/vnd.ms-cab-compressed cab -# application/vnd.ms-color.iccprofile -application/vnd.ms-excel xls xlm xla xlc xlt xlw -application/vnd.ms-excel.addin.macroenabled.12 xlam -application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb -application/vnd.ms-excel.sheet.macroenabled.12 xlsm -application/vnd.ms-excel.template.macroenabled.12 xltm -application/vnd.ms-fontobject eot -application/vnd.ms-htmlhelp chm -application/vnd.ms-ims ims -application/vnd.ms-lrm lrm -# application/vnd.ms-office.activex+xml -application/vnd.ms-officetheme thmx -# application/vnd.ms-opentype -# application/vnd.ms-package.obfuscated-opentype -application/vnd.ms-pki.seccat cat -application/vnd.ms-pki.stl stl -# application/vnd.ms-playready.initiator+xml -application/vnd.ms-powerpoint ppt pps pot -application/vnd.ms-powerpoint.addin.macroenabled.12 ppam -application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm -application/vnd.ms-powerpoint.slide.macroenabled.12 sldm -application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm -application/vnd.ms-powerpoint.template.macroenabled.12 potm -# application/vnd.ms-printing.printticket+xml -application/vnd.ms-project mpp mpt -# application/vnd.ms-tnef -# application/vnd.ms-wmdrm.lic-chlg-req -# application/vnd.ms-wmdrm.lic-resp -# application/vnd.ms-wmdrm.meter-chlg-req -# application/vnd.ms-wmdrm.meter-resp -application/vnd.ms-word.document.macroenabled.12 docm -application/vnd.ms-word.template.macroenabled.12 dotm -application/vnd.ms-works wps wks wcm wdb -application/vnd.ms-wpl wpl -application/vnd.ms-xpsdocument xps -application/vnd.mseq mseq -# application/vnd.msign -# application/vnd.multiad.creator -# application/vnd.multiad.creator.cif -# application/vnd.music-niff -application/vnd.musician mus -application/vnd.muvee.style msty -application/vnd.mynfc taglet -# application/vnd.ncd.control -# application/vnd.ncd.reference -# application/vnd.nervana -# application/vnd.netfpx -application/vnd.neurolanguage.nlu nlu -application/vnd.nitf ntf nitf -application/vnd.noblenet-directory nnd -application/vnd.noblenet-sealer nns -application/vnd.noblenet-web nnw -# application/vnd.nokia.catalogs -# application/vnd.nokia.conml+wbxml -# application/vnd.nokia.conml+xml -# application/vnd.nokia.isds-radio-presets -# application/vnd.nokia.iptv.config+xml -# application/vnd.nokia.landmark+wbxml -# application/vnd.nokia.landmark+xml -# application/vnd.nokia.landmarkcollection+xml -# application/vnd.nokia.n-gage.ac+xml -application/vnd.nokia.n-gage.data ngdat -application/vnd.nokia.n-gage.symbian.install n-gage -# application/vnd.nokia.ncd -# application/vnd.nokia.pcd+wbxml -# application/vnd.nokia.pcd+xml -application/vnd.nokia.radio-preset rpst -application/vnd.nokia.radio-presets rpss -application/vnd.novadigm.edm edm -application/vnd.novadigm.edx edx -application/vnd.novadigm.ext ext -# application/vnd.ntt-local.file-transfer -# application/vnd.ntt-local.sip-ta_remote -# application/vnd.ntt-local.sip-ta_tcp_stream -application/vnd.oasis.opendocument.chart odc -application/vnd.oasis.opendocument.chart-template otc -application/vnd.oasis.opendocument.database odb -application/vnd.oasis.opendocument.formula odf -application/vnd.oasis.opendocument.formula-template odft -application/vnd.oasis.opendocument.graphics odg -application/vnd.oasis.opendocument.graphics-template otg -application/vnd.oasis.opendocument.image odi -application/vnd.oasis.opendocument.image-template oti -application/vnd.oasis.opendocument.presentation odp -application/vnd.oasis.opendocument.presentation-template otp -application/vnd.oasis.opendocument.spreadsheet ods -application/vnd.oasis.opendocument.spreadsheet-template ots -application/vnd.oasis.opendocument.text odt -application/vnd.oasis.opendocument.text-master odm -application/vnd.oasis.opendocument.text-template ott -application/vnd.oasis.opendocument.text-web oth -# application/vnd.obn -# application/vnd.oftn.l10n+json -# application/vnd.oipf.contentaccessdownload+xml -# application/vnd.oipf.contentaccessstreaming+xml -# application/vnd.oipf.cspg-hexbinary -# application/vnd.oipf.dae.svg+xml -# application/vnd.oipf.dae.xhtml+xml -# application/vnd.oipf.mippvcontrolmessage+xml -# application/vnd.oipf.pae.gem -# application/vnd.oipf.spdiscovery+xml -# application/vnd.oipf.spdlist+xml -# application/vnd.oipf.ueprofile+xml -# application/vnd.oipf.userprofile+xml -application/vnd.olpc-sugar xo -# application/vnd.oma-scws-config -# application/vnd.oma-scws-http-request -# application/vnd.oma-scws-http-response -# application/vnd.oma.bcast.associated-procedure-parameter+xml -# application/vnd.oma.bcast.drm-trigger+xml -# application/vnd.oma.bcast.imd+xml -# application/vnd.oma.bcast.ltkm -# application/vnd.oma.bcast.notification+xml -# application/vnd.oma.bcast.provisioningtrigger -# application/vnd.oma.bcast.sgboot -# application/vnd.oma.bcast.sgdd+xml -# application/vnd.oma.bcast.sgdu -# application/vnd.oma.bcast.simple-symbol-container -# application/vnd.oma.bcast.smartcard-trigger+xml -# application/vnd.oma.bcast.sprov+xml -# application/vnd.oma.bcast.stkm -# application/vnd.oma.cab-address-book+xml -# application/vnd.oma.cab-feature-handler+xml -# application/vnd.oma.cab-pcc+xml -# application/vnd.oma.cab-user-prefs+xml -# application/vnd.oma.dcd -# application/vnd.oma.dcdc -application/vnd.oma.dd2+xml dd2 -# application/vnd.oma.drm.risd+xml -# application/vnd.oma.group-usage-list+xml -# application/vnd.oma.pal+xml -# application/vnd.oma.poc.detailed-progress-report+xml -# application/vnd.oma.poc.final-report+xml -# application/vnd.oma.poc.groups+xml -# application/vnd.oma.poc.invocation-descriptor+xml -# application/vnd.oma.poc.optimized-progress-report+xml -# application/vnd.oma.push -# application/vnd.oma.scidm.messages+xml -# application/vnd.oma.xcap-directory+xml -# application/vnd.omads-email+xml -# application/vnd.omads-file+xml -# application/vnd.omads-folder+xml -# application/vnd.omaloc-supl-init -application/vnd.openofficeorg.extension oxt -# application/vnd.openxmlformats-officedocument.custom-properties+xml -# application/vnd.openxmlformats-officedocument.customxmlproperties+xml -# application/vnd.openxmlformats-officedocument.drawing+xml -# application/vnd.openxmlformats-officedocument.drawingml.chart+xml -# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml -# application/vnd.openxmlformats-officedocument.extended-properties+xml -# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml -# application/vnd.openxmlformats-officedocument.presentationml.comments+xml -# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml -application/vnd.openxmlformats-officedocument.presentationml.presentation pptx -# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml -application/vnd.openxmlformats-officedocument.presentationml.slide sldx -# application/vnd.openxmlformats-officedocument.presentationml.slide+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml -application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx -# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml -# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml -# application/vnd.openxmlformats-officedocument.presentationml.tags+xml -application/vnd.openxmlformats-officedocument.presentationml.template potx -# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx -# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml -# application/vnd.openxmlformats-officedocument.theme+xml -# application/vnd.openxmlformats-officedocument.themeoverride+xml -# application/vnd.openxmlformats-officedocument.vmldrawing -# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.document docx -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx -# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml -# application/vnd.openxmlformats-package.core-properties+xml -# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml -# application/vnd.openxmlformats-package.relationships+xml -# application/vnd.quobject-quoxdocument -# application/vnd.osa.netdeploy -application/vnd.osgeo.mapguide.package mgp -# application/vnd.osgi.bundle -application/vnd.osgi.dp dp -application/vnd.osgi.subsystem esa -# application/vnd.otps.ct-kip+xml -application/vnd.palm pdb pqa oprc -# application/vnd.paos.xml -application/vnd.pawaafile paw -application/vnd.pg.format str -application/vnd.pg.osasli ei6 -# application/vnd.piaccess.application-licence -application/vnd.picsel efif -application/vnd.pmi.widget wg -# application/vnd.poc.group-advertisement+xml -application/vnd.pocketlearn plf -application/vnd.powerbuilder6 pbd -# application/vnd.powerbuilder6-s -# application/vnd.powerbuilder7 -# application/vnd.powerbuilder7-s -# application/vnd.powerbuilder75 -# application/vnd.powerbuilder75-s -# application/vnd.preminet -application/vnd.previewsystems.box box -application/vnd.proteus.magazine mgz -application/vnd.publishare-delta-tree qps -application/vnd.pvi.ptid1 ptid -# application/vnd.pwg-multiplexed -# application/vnd.pwg-xhtml-print+xml -# application/vnd.qualcomm.brew-app-res -application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb -# application/vnd.radisys.moml+xml -# application/vnd.radisys.msml+xml -# application/vnd.radisys.msml-audit+xml -# application/vnd.radisys.msml-audit-conf+xml -# application/vnd.radisys.msml-audit-conn+xml -# application/vnd.radisys.msml-audit-dialog+xml -# application/vnd.radisys.msml-audit-stream+xml -# application/vnd.radisys.msml-conf+xml -# application/vnd.radisys.msml-dialog+xml -# application/vnd.radisys.msml-dialog-base+xml -# application/vnd.radisys.msml-dialog-fax-detect+xml -# application/vnd.radisys.msml-dialog-fax-sendrecv+xml -# application/vnd.radisys.msml-dialog-group+xml -# application/vnd.radisys.msml-dialog-speech+xml -# application/vnd.radisys.msml-dialog-transform+xml -# application/vnd.rainstor.data -# application/vnd.rapid -application/vnd.realvnc.bed bed -application/vnd.recordare.musicxml mxl -application/vnd.recordare.musicxml+xml musicxml -# application/vnd.renlearn.rlprint -application/vnd.rig.cryptonote cryptonote -application/vnd.rim.cod cod -application/vnd.rn-realmedia rm -application/vnd.rn-realmedia-vbr rmvb -application/vnd.route66.link66+xml link66 -# application/vnd.rs-274x -# application/vnd.ruckus.download -# application/vnd.s3sms -application/vnd.sailingtracker.track st -# application/vnd.sbm.cid -# application/vnd.sbm.mid2 -# application/vnd.scribus -# application/vnd.sealed.3df -# application/vnd.sealed.csf -# application/vnd.sealed.doc -# application/vnd.sealed.eml -# application/vnd.sealed.mht -# application/vnd.sealed.net -# application/vnd.sealed.ppt -# application/vnd.sealed.tiff -# application/vnd.sealed.xls -# application/vnd.sealedmedia.softseal.html -# application/vnd.sealedmedia.softseal.pdf -application/vnd.seemail see -application/vnd.sema sema -application/vnd.semd semd -application/vnd.semf semf -application/vnd.shana.informed.formdata ifm -application/vnd.shana.informed.formtemplate itp -application/vnd.shana.informed.interchange iif -application/vnd.shana.informed.package ipk -application/vnd.simtech-mindmapper twd twds -application/vnd.smaf mmf -# application/vnd.smart.notebook -application/vnd.smart.teacher teacher -# application/vnd.software602.filler.form+xml -# application/vnd.software602.filler.form-xml-zip -application/vnd.solent.sdkm+xml sdkm sdkd -application/vnd.spotfire.dxp dxp -application/vnd.spotfire.sfs sfs -# application/vnd.sss-cod -# application/vnd.sss-dtf -# application/vnd.sss-ntf -application/vnd.stardivision.calc sdc -application/vnd.stardivision.draw sda -application/vnd.stardivision.impress sdd -application/vnd.stardivision.math smf -application/vnd.stardivision.writer sdw vor -application/vnd.stardivision.writer-global sgl -application/vnd.stepmania.package smzip -application/vnd.stepmania.stepchart sm -# application/vnd.street-stream -application/vnd.sun.xml.calc sxc -application/vnd.sun.xml.calc.template stc -application/vnd.sun.xml.draw sxd -application/vnd.sun.xml.draw.template std -application/vnd.sun.xml.impress sxi -application/vnd.sun.xml.impress.template sti -application/vnd.sun.xml.math sxm -application/vnd.sun.xml.writer sxw -application/vnd.sun.xml.writer.global sxg -application/vnd.sun.xml.writer.template stw -# application/vnd.sun.wadl+xml -application/vnd.sus-calendar sus susp -application/vnd.svd svd -# application/vnd.swiftview-ics -application/vnd.symbian.install sis sisx -application/vnd.syncml+xml xsm -application/vnd.syncml.dm+wbxml bdm -application/vnd.syncml.dm+xml xdm -# application/vnd.syncml.dm.notification -# application/vnd.syncml.ds.notification -application/vnd.tao.intent-module-archive tao -application/vnd.tcpdump.pcap pcap cap dmp -application/vnd.tmobile-livetv tmo -application/vnd.trid.tpt tpt -application/vnd.triscape.mxs mxs -application/vnd.trueapp tra -# application/vnd.truedoc -# application/vnd.ubisoft.webplayer -application/vnd.ufdl ufd ufdl -application/vnd.uiq.theme utz -application/vnd.umajin umj -application/vnd.unity unityweb -application/vnd.uoml+xml uoml -# application/vnd.uplanet.alert -# application/vnd.uplanet.alert-wbxml -# application/vnd.uplanet.bearer-choice -# application/vnd.uplanet.bearer-choice-wbxml -# application/vnd.uplanet.cacheop -# application/vnd.uplanet.cacheop-wbxml -# application/vnd.uplanet.channel -# application/vnd.uplanet.channel-wbxml -# application/vnd.uplanet.list -# application/vnd.uplanet.list-wbxml -# application/vnd.uplanet.listcmd -# application/vnd.uplanet.listcmd-wbxml -# application/vnd.uplanet.signal -application/vnd.vcx vcx -# application/vnd.vd-study -# application/vnd.vectorworks -# application/vnd.verimatrix.vcas -# application/vnd.vidsoft.vidconference -application/vnd.visio vsd vst vss vsw -application/vnd.visionary vis -# application/vnd.vividence.scriptfile -application/vnd.vsf vsf -# application/vnd.wap.sic -# application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo wtb -# application/vnd.wfa.wsc -# application/vnd.wmc -# application/vnd.wmf.bootstrap -# application/vnd.wolfram.mathematica -# application/vnd.wolfram.mathematica.package -application/vnd.wolfram.player nbp -application/vnd.wordperfect wpd -application/vnd.wqd wqd -# application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf stf -# application/vnd.wv.csp+wbxml -# application/vnd.wv.csp+xml -# application/vnd.wv.ssp+xml -application/vnd.xara xar -application/vnd.xfdl xfdl -# application/vnd.xfdl.webform -# application/vnd.xmi+xml -# application/vnd.xmpie.cpkg -# application/vnd.xmpie.dpkg -# application/vnd.xmpie.plan -# application/vnd.xmpie.ppkg -# application/vnd.xmpie.xlim -application/vnd.yamaha.hv-dic hvd -application/vnd.yamaha.hv-script hvs -application/vnd.yamaha.hv-voice hvp -application/vnd.yamaha.openscoreformat osf -application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg -# application/vnd.yamaha.remote-setup -application/vnd.yamaha.smaf-audio saf -application/vnd.yamaha.smaf-phrase spf -# application/vnd.yamaha.through-ngn -# application/vnd.yamaha.tunnel-udpencap -application/vnd.yellowriver-custom-menu cmp -application/vnd.zul zir zirz -application/vnd.zzazz.deck+xml zaz -application/voicexml+xml vxml -# application/vq-rtcpxr -# application/watcherinfo+xml -# application/whoispp-query -# application/whoispp-response -application/widget wgt -application/winhlp hlp -# application/wita -# application/wordperfect5.1 -application/wsdl+xml wsdl -application/wspolicy+xml wspolicy -application/x-7z-compressed 7z -application/x-abiword abw -application/x-ace-compressed ace -# application/x-amf -application/x-apple-diskimage dmg -application/x-authorware-bin aab x32 u32 vox -application/x-authorware-map aam -application/x-authorware-seg aas -application/x-bcpio bcpio -application/x-bittorrent torrent -application/x-blorb blb blorb -application/x-bzip bz -application/x-bzip2 bz2 boz -application/x-cbr cbr cba cbt cbz cb7 -application/x-cdlink vcd -application/x-cfs-compressed cfs -application/x-chat chat -application/x-chess-pgn pgn -application/x-conference nsc -# application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-debian-package deb udeb -application/x-dgc-compressed dgc -application/x-director dir dcr dxr cst cct cxt w3d fgd swa -application/x-doom wad -application/x-dtbncx+xml ncx -application/x-dtbook+xml dtb -application/x-dtbresource+xml res -application/x-dvi dvi -application/x-envoy evy -application/x-eva eva -application/x-font-bdf bdf -# application/x-font-dos -# application/x-font-framemaker -application/x-font-ghostscript gsf -# application/x-font-libgrx -application/x-font-linux-psf psf -application/x-font-otf otf -application/x-font-pcf pcf -application/x-font-snf snf -# application/x-font-speedo -# application/x-font-sunos-news -application/x-font-ttf ttf ttc -application/x-font-type1 pfa pfb pfm afm -application/font-woff woff -# application/x-font-vfont -application/x-freearc arc -application/x-futuresplash spl -application/x-gca-compressed gca -application/x-glulx ulx -application/x-gnumeric gnumeric -application/x-gramps-xml gramps -application/x-gtar gtar -# application/x-gzip -application/x-hdf hdf -application/x-install-instructions install -application/x-iso9660-image iso -application/x-java-jnlp-file jnlp -application/x-latex latex -application/x-lzh-compressed lzh lha -application/x-mie mie -application/x-mobipocket-ebook prc mobi -application/x-ms-application application -application/x-ms-shortcut lnk -application/x-ms-wmd wmd -application/x-ms-wmz wmz -application/x-ms-xbap xbap -application/x-msaccess mdb -application/x-msbinder obd -application/x-mscardfile crd -application/x-msclip clp -application/x-msdownload exe dll com bat msi -application/x-msmediaview mvb m13 m14 -application/x-msmetafile wmf wmz emf emz -application/x-msmoney mny -application/x-mspublisher pub -application/x-msschedule scd -application/x-msterminal trm -application/x-mswrite wri -application/x-netcdf nc cdf -application/x-nzb nzb -application/x-pkcs12 p12 pfx -application/x-pkcs7-certificates p7b spc -application/x-pkcs7-certreqresp p7r -application/x-rar-compressed rar -application/x-research-info-systems ris -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-silverlight-app xap -application/x-sql sql -application/x-stuffit sit -application/x-stuffitx sitx -application/x-subrip srt -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-t3vm-image t3 -application/x-tads gam -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-tex-tfm tfm -application/x-texinfo texinfo texi -application/x-tgif obj -application/x-ustar ustar -application/x-wais-source src -application/x-x509-ca-cert der crt -application/x-xfig fig -application/x-xliff+xml xlf -application/x-xpinstall xpi -application/x-xz xz -application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8 -# application/x400-bp -application/xaml+xml xaml -# application/xcap-att+xml -# application/xcap-caps+xml -application/xcap-diff+xml xdf -# application/xcap-el+xml -# application/xcap-error+xml -# application/xcap-ns+xml -# application/xcon-conference-info-diff+xml -# application/xcon-conference-info+xml -application/xenc+xml xenc -application/xhtml+xml xhtml xht -# application/xhtml-voice+xml -application/xml xml xsl -application/xml-dtd dtd -# application/xml-external-parsed-entity -# application/xmpp+xml -application/xop+xml xop -application/xproc+xml xpl -application/xslt+xml xslt -application/xspf+xml xspf -application/xv+xml mxml xhvml xvml xvm -application/yang yang -application/yin+xml yin -application/zip zip -# audio/1d-interleaved-parityfec -# audio/32kadpcm -# audio/3gpp -# audio/3gpp2 -# audio/ac3 -audio/adpcm adp -# audio/amr -# audio/amr-wb -# audio/amr-wb+ -# audio/asc -# audio/atrac-advanced-lossless -# audio/atrac-x -# audio/atrac3 -audio/basic au snd -# audio/bv16 -# audio/bv32 -# audio/clearmode -# audio/cn -# audio/dat12 -# audio/dls -# audio/dsr-es201108 -# audio/dsr-es202050 -# audio/dsr-es202211 -# audio/dsr-es202212 -# audio/dv -# audio/dvi4 -# audio/eac3 -# audio/evrc -# audio/evrc-qcp -# audio/evrc0 -# audio/evrc1 -# audio/evrcb -# audio/evrcb0 -# audio/evrcb1 -# audio/evrcwb -# audio/evrcwb0 -# audio/evrcwb1 -# audio/example -# audio/fwdred -# audio/g719 -# audio/g722 -# audio/g7221 -# audio/g723 -# audio/g726-16 -# audio/g726-24 -# audio/g726-32 -# audio/g726-40 -# audio/g728 -# audio/g729 -# audio/g7291 -# audio/g729d -# audio/g729e -# audio/gsm -# audio/gsm-efr -# audio/gsm-hr-08 -# audio/ilbc -# audio/ip-mr_v2.5 -# audio/isac -# audio/l16 -# audio/l20 -# audio/l24 -# audio/l8 -# audio/lpc -audio/midi mid midi kar rmi -# audio/mobile-xmf -audio/mp4 mp4a -# audio/mp4a-latm -# audio/mpa -# audio/mpa-robust -audio/mpeg mpga mp2 mp2a mp3 m2a m3a -# audio/mpeg4-generic -# audio/musepack -audio/ogg oga ogg spx -# audio/opus -# audio/parityfec -# audio/pcma -# audio/pcma-wb -# audio/pcmu-wb -# audio/pcmu -# audio/prs.sid -# audio/qcelp -# audio/red -# audio/rtp-enc-aescm128 -# audio/rtp-midi -# audio/rtx -audio/s3m s3m -audio/silk sil -# audio/smv -# audio/smv0 -# audio/smv-qcp -# audio/sp-midi -# audio/speex -# audio/t140c -# audio/t38 -# audio/telephone-event -# audio/tone -# audio/uemclip -# audio/ulpfec -# audio/vdvi -# audio/vmr-wb -# audio/vnd.3gpp.iufp -# audio/vnd.4sb -# audio/vnd.audiokoz -# audio/vnd.celp -# audio/vnd.cisco.nse -# audio/vnd.cmles.radio-events -# audio/vnd.cns.anp1 -# audio/vnd.cns.inf1 -audio/vnd.dece.audio uva uvva -audio/vnd.digital-winds eol -# audio/vnd.dlna.adts -# audio/vnd.dolby.heaac.1 -# audio/vnd.dolby.heaac.2 -# audio/vnd.dolby.mlp -# audio/vnd.dolby.mps -# audio/vnd.dolby.pl2 -# audio/vnd.dolby.pl2x -# audio/vnd.dolby.pl2z -# audio/vnd.dolby.pulse.1 -audio/vnd.dra dra -audio/vnd.dts dts -audio/vnd.dts.hd dtshd -# audio/vnd.dvb.file -# audio/vnd.everad.plj -# audio/vnd.hns.audio -audio/vnd.lucent.voice lvp -audio/vnd.ms-playready.media.pya pya -# audio/vnd.nokia.mobile-xmf -# audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 ecelp4800 -audio/vnd.nuera.ecelp7470 ecelp7470 -audio/vnd.nuera.ecelp9600 ecelp9600 -# audio/vnd.octel.sbc -# audio/vnd.qcelp -# audio/vnd.rhetorex.32kadpcm -audio/vnd.rip rip -# audio/vnd.sealedmedia.softseal.mpeg -# audio/vnd.vmx.cvsd -# audio/vorbis -# audio/vorbis-config -audio/webm weba -audio/x-aac aac -audio/x-aiff aif aiff aifc -audio/x-caf caf -audio/x-flac flac -audio/x-matroska mka -audio/x-mpegurl m3u -audio/x-ms-wax wax -audio/x-ms-wma wma -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin rmp -# audio/x-tta -audio/x-wav wav -audio/xm xm -chemical/x-cdx cdx -chemical/x-cif cif -chemical/x-cmdf cmdf -chemical/x-cml cml -chemical/x-csml csml -# chemical/x-pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -# image/example -# image/fits -image/g3fax g3 -image/gif gif -image/ief ief -# image/jp2 -image/jpeg jpeg jpg jpe -# image/jpm -# image/jpx -image/ktx ktx -# image/naplps -image/png png -image/prs.btif btif -# image/prs.pti -image/sgi sgi -image/svg+xml svg svgz -# image/t38 -image/tiff tiff tif -# image/tiff-fx -image/vnd.adobe.photoshop psd -# image/vnd.cns.inf2 -image/vnd.dece.graphic uvi uvvi uvg uvvg -image/vnd.dvb.subtitle sub -image/vnd.djvu djvu djv -image/vnd.dwg dwg -image/vnd.dxf dxf -image/vnd.fastbidsheet fbs -image/vnd.fpx fpx -image/vnd.fst fst -image/vnd.fujixerox.edmics-mmr mmr -image/vnd.fujixerox.edmics-rlc rlc -# image/vnd.globalgraphics.pgb -# image/vnd.microsoft.icon -# image/vnd.mix -image/vnd.ms-modi mdi -image/vnd.ms-photo wdp -image/vnd.net-fpx npx -# image/vnd.radiance -# image/vnd.sealed.png -# image/vnd.sealedmedia.softseal.gif -# image/vnd.sealedmedia.softseal.jpg -# image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff xif -image/webp webp -image/x-3ds 3ds -image/x-cmu-raster ras -image/x-cmx cmx -image/x-freehand fh fhc fh4 fh5 fh7 -image/x-icon ico -image/x-mrsid-image sid -image/x-pcx pcx -image/x-pict pic pct -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-tga tga -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -# message/cpim -# message/delivery-status -# message/disposition-notification -# message/example -# message/external-body -# message/feedback-report -# message/global -# message/global-delivery-status -# message/global-disposition-notification -# message/global-headers -# message/http -# message/imdn+xml -# message/news -# message/partial -message/rfc822 eml mime -# message/s-http -# message/sip -# message/sipfrag -# message/tracking-status -# message/vnd.si.simp -# model/example -model/iges igs iges -model/mesh msh mesh silo -model/vnd.collada+xml dae -model/vnd.dwf dwf -# model/vnd.flatland.3dml -model/vnd.gdl gdl -# model/vnd.gs-gdl -# model/vnd.gs.gdl -model/vnd.gtw gtw -# model/vnd.moml+xml -model/vnd.mts mts -# model/vnd.parasolid.transmit.binary -# model/vnd.parasolid.transmit.text -model/vnd.vtu vtu -model/vrml wrl vrml -model/x3d+binary x3db x3dbz -model/x3d+vrml x3dv x3dvz -model/x3d+xml x3d x3dz -# multipart/alternative -# multipart/appledouble -# multipart/byteranges -# multipart/digest -# multipart/encrypted -# multipart/example -# multipart/form-data -# multipart/header-set -# multipart/mixed -# multipart/parallel -# multipart/related -# multipart/report -# multipart/signed -# multipart/voice-message -# text/1d-interleaved-parityfec -text/cache-manifest appcache -text/calendar ics ifb -text/css css -text/csv csv -# text/directory -# text/dns -# text/ecmascript -# text/enriched -# text/example -# text/fwdred -text/html html htm -# text/javascript -text/n3 n3 -# text/parityfec -text/plain txt text conf def list log in -# text/prs.fallenstein.rst -text/prs.lines.tag dsc -# text/vnd.radisys.msml-basic-layout -# text/red -# text/rfc822-headers -text/richtext rtx -# text/rtf -# text/rtp-enc-aescm128 -# text/rtx -text/sgml sgml sgm -# text/t140 -text/tab-separated-values tsv -text/troff t tr roff man me ms -text/turtle ttl -# text/ulpfec -text/uri-list uri uris urls -text/vcard vcard -# text/vnd.abc -text/vnd.curl curl -text/vnd.curl.dcurl dcurl -text/vnd.curl.scurl scurl -text/vnd.curl.mcurl mcurl -# text/vnd.dmclientscript -text/vnd.dvb.subtitle sub -# text/vnd.esmertec.theme-descriptor -text/vnd.fly fly -text/vnd.fmi.flexstor flx -text/vnd.graphviz gv -text/vnd.in3d.3dml 3dml -text/vnd.in3d.spot spot -# text/vnd.iptc.newsml -# text/vnd.iptc.nitf -# text/vnd.latex-z -# text/vnd.motorola.reflex -# text/vnd.ms-mediapackage -# text/vnd.net2phone.commcenter.command -# text/vnd.si.uricatalogue -text/vnd.sun.j2me.app-descriptor jad -# text/vnd.trolltech.linguist -# text/vnd.wap.si -# text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-asm s asm -text/x-c c cc cxx cpp h hh dic -text/x-fortran f for f77 f90 -text/x-java-source java -text/x-opml opml -text/x-pascal p pas -text/x-nfo nfo -text/x-setext etx -text/x-sfv sfv -text/x-uuencode uu -text/x-vcalendar vcs -text/x-vcard vcf -# text/xml -# text/xml-external-parsed-entity -# video/1d-interleaved-parityfec -video/3gpp 3gp -# video/3gpp-tt -video/3gpp2 3g2 -# video/bmpeg -# video/bt656 -# video/celb -# video/dv -# video/example -video/h261 h261 -video/h263 h263 -# video/h263-1998 -# video/h263-2000 -video/h264 h264 -# video/h264-rcdo -# video/h264-svc -video/jpeg jpgv -# video/jpeg2000 -video/jpm jpm jpgm -video/mj2 mj2 mjp2 -# video/mp1s -# video/mp2p -# video/mp2t -video/mp4 mp4 mp4v mpg4 -# video/mp4v-es -video/mpeg mpeg mpg mpe m1v m2v -# video/mpeg4-generic -# video/mpv -# video/nv -video/ogg ogv -# video/parityfec -# video/pointer -video/quicktime qt mov -# video/raw -# video/rtp-enc-aescm128 -# video/rtx -# video/smpte292m -# video/ulpfec -# video/vc1 -# video/vnd.cctv -video/vnd.dece.hd uvh uvvh -video/vnd.dece.mobile uvm uvvm -# video/vnd.dece.mp4 -video/vnd.dece.pd uvp uvvp -video/vnd.dece.sd uvs uvvs -video/vnd.dece.video uvv uvvv -# video/vnd.directv.mpeg -# video/vnd.directv.mpeg-tts -# video/vnd.dlna.mpeg-tts -video/vnd.dvb.file dvb -video/vnd.fvt fvt -# video/vnd.hns.video -# video/vnd.iptvforum.1dparityfec-1010 -# video/vnd.iptvforum.1dparityfec-2005 -# video/vnd.iptvforum.2dparityfec-1010 -# video/vnd.iptvforum.2dparityfec-2005 -# video/vnd.iptvforum.ttsavc -# video/vnd.iptvforum.ttsmpeg2 -# video/vnd.motorola.video -# video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.ms-playready.media.pyv pyv -# video/vnd.nokia.interleaved-multimedia -# video/vnd.nokia.videovoip -# video/vnd.objectvideo -# video/vnd.sealed.mpeg1 -# video/vnd.sealed.mpeg4 -# video/vnd.sealed.swf -# video/vnd.sealedmedia.softseal.mov -video/vnd.uvvu.mp4 uvu uvvu -video/vnd.vivo viv -video/webm webm -video/x-f4v f4v -video/x-fli fli -video/x-flv flv -video/x-m4v m4v -video/x-matroska mkv mk3d mks -video/x-mng mng -video/x-ms-asf asf asx -video/x-ms-vob vob -video/x-ms-wm wm -video/x-ms-wmv wmv -video/x-ms-wmx wmx -video/x-ms-wvx wvx -video/x-msvideo avi -video/x-sgi-movie movie -video/x-smv smv -x-conference/x-cooltalk ice diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/types/node.types b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/types/node.types deleted file mode 100644 index 55b2cf794e..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/mime/types/node.types +++ /dev/null @@ -1,77 +0,0 @@ -# What: WebVTT -# Why: To allow formats intended for marking up external text track resources. -# http://dev.w3.org/html5/webvtt/ -# Added by: niftylettuce -text/vtt vtt - -# What: Google Chrome Extension -# Why: To allow apps to (work) be served with the right content type header. -# http://codereview.chromium.org/2830017 -# Added by: niftylettuce -application/x-chrome-extension crx - -# What: HTC support -# Why: To properly render .htc files such as CSS3PIE -# Added by: niftylettuce -text/x-component htc - -# What: HTML5 application cache manifes ('.manifest' extension) -# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps -# per https://developer.mozilla.org/en/offline_resources_in_firefox -# Added by: louisremi -text/cache-manifest manifest - -# What: node binary buffer format -# Why: semi-standard extension w/in the node community -# Added by: tootallnate -application/octet-stream buffer - -# What: The "protected" MP-4 formats used by iTunes. -# Why: Required for streaming music to browsers (?) -# Added by: broofa -application/mp4 m4p -audio/mp4 m4a - -# What: Video format, Part of RFC1890 -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -video/MP2T ts - -# What: EventSource mime type -# Why: mime type of Server-Sent Events stream -# http://www.w3.org/TR/eventsource/#text-event-stream -# Added by: francois2metz -text/event-stream event-stream - -# What: Mozilla App manifest mime type -# Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests -# Added by: ednapiranha -application/x-web-app-manifest+json webapp - -# What: Lua file types -# Why: Googling around shows de-facto consensus on these -# Added by: creationix (Issue #45) -text/x-lua lua -application/x-lua-bytecode luac - -# What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax -# Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown -# Added by: avoidwork -text/x-markdown markdown md mkd - -# What: ini files -# Why: because they're just text files -# Added by: Matthew Kastor -text/plain ini - -# What: DASH Adaptive Streaming manifest -# Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video -# Added by: eelcocramer -application/dash+xml mdp - -# What: OpenType font files - http://www.microsoft.com/typography/otspec/ -# Why: Browsers usually ignore the font MIME types and sniff the content, -# but Chrome, shows a warning if OpenType fonts aren't served with -# the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png. -# Added by: alrra -font/opentype otf diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/.travis.yml b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/.travis.yml deleted file mode 100644 index cc4dba29d9..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/LICENSE b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/LICENSE deleted file mode 100644 index 432d1aeb01..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/index.js b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/index.js deleted file mode 100644 index 8ac67eb317..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/index.js +++ /dev/null @@ -1,478 +0,0 @@ -var path = require('path'); -var wordwrap = require('wordwrap'); - -/* Hack an instance of Argv with process.argv into Argv - so people can do - require('optimist')(['--beeble=1','-z','zizzle']).argv - to parse a list of args and - require('optimist').argv - to get a parsed version of process.argv. -*/ - -var inst = Argv(process.argv.slice(2)); -Object.keys(inst).forEach(function (key) { - Argv[key] = typeof inst[key] == 'function' - ? inst[key].bind(inst) - : inst[key]; -}); - -var exports = module.exports = Argv; -function Argv (args, cwd) { - var self = {}; - if (!cwd) cwd = process.cwd(); - - self.$0 = process.argv - .slice(0,2) - .map(function (x) { - var b = rebase(cwd, x); - return x.match(/^\//) && b.length < x.length - ? b : x - }) - .join(' ') - ; - - if (process.env._ != undefined && process.argv[1] == process.env._) { - self.$0 = process.env._.replace( - path.dirname(process.execPath) + '/', '' - ); - } - - var flags = { bools : {}, strings : {} }; - - self.boolean = function (bools) { - if (!Array.isArray(bools)) { - bools = [].slice.call(arguments); - } - - bools.forEach(function (name) { - flags.bools[name] = true; - }); - - return self; - }; - - self.string = function (strings) { - if (!Array.isArray(strings)) { - strings = [].slice.call(arguments); - } - - strings.forEach(function (name) { - flags.strings[name] = true; - }); - - return self; - }; - - var aliases = {}; - self.alias = function (x, y) { - if (typeof x === 'object') { - Object.keys(x).forEach(function (key) { - self.alias(key, x[key]); - }); - } - else if (Array.isArray(y)) { - y.forEach(function (yy) { - self.alias(x, yy); - }); - } - else { - var zs = (aliases[x] || []).concat(aliases[y] || []).concat(x, y); - aliases[x] = zs.filter(function (z) { return z != x }); - aliases[y] = zs.filter(function (z) { return z != y }); - } - - return self; - }; - - var demanded = {}; - self.demand = function (keys) { - if (typeof keys == 'number') { - if (!demanded._) demanded._ = 0; - demanded._ += keys; - } - else if (Array.isArray(keys)) { - keys.forEach(function (key) { - self.demand(key); - }); - } - else { - demanded[keys] = true; - } - - return self; - }; - - var usage; - self.usage = function (msg, opts) { - if (!opts && typeof msg === 'object') { - opts = msg; - msg = null; - } - - usage = msg; - - if (opts) self.options(opts); - - return self; - }; - - function fail (msg) { - self.showHelp(); - if (msg) console.error(msg); - process.exit(1); - } - - var checks = []; - self.check = function (f) { - checks.push(f); - return self; - }; - - var defaults = {}; - self.default = function (key, value) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.default(k, key[k]); - }); - } - else { - defaults[key] = value; - } - - return self; - }; - - var descriptions = {}; - self.describe = function (key, desc) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.describe(k, key[k]); - }); - } - else { - descriptions[key] = desc; - } - return self; - }; - - self.parse = function (args) { - return Argv(args).argv; - }; - - self.option = self.options = function (key, opt) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.options(k, key[k]); - }); - } - else { - if (opt.alias) self.alias(key, opt.alias); - if (opt.demand) self.demand(key); - if (typeof opt.default !== 'undefined') { - self.default(key, opt.default); - } - - if (opt.boolean || opt.type === 'boolean') { - self.boolean(key); - } - if (opt.string || opt.type === 'string') { - self.string(key); - } - - var desc = opt.describe || opt.description || opt.desc; - if (desc) { - self.describe(key, desc); - } - } - - return self; - }; - - var wrap = null; - self.wrap = function (cols) { - wrap = cols; - return self; - }; - - self.showHelp = function (fn) { - if (!fn) fn = console.error; - fn(self.help()); - }; - - self.help = function () { - var keys = Object.keys( - Object.keys(descriptions) - .concat(Object.keys(demanded)) - .concat(Object.keys(defaults)) - .reduce(function (acc, key) { - if (key !== '_') acc[key] = true; - return acc; - }, {}) - ); - - var help = keys.length ? [ 'Options:' ] : []; - - if (usage) { - help.unshift(usage.replace(/\$0/g, self.$0), ''); - } - - var switches = keys.reduce(function (acc, key) { - acc[key] = [ key ].concat(aliases[key] || []) - .map(function (sw) { - return (sw.length > 1 ? '--' : '-') + sw - }) - .join(', ') - ; - return acc; - }, {}); - - var switchlen = longest(Object.keys(switches).map(function (s) { - return switches[s] || ''; - })); - - var desclen = longest(Object.keys(descriptions).map(function (d) { - return descriptions[d] || ''; - })); - - keys.forEach(function (key) { - var kswitch = switches[key]; - var desc = descriptions[key] || ''; - - if (wrap) { - desc = wordwrap(switchlen + 4, wrap)(desc) - .slice(switchlen + 4) - ; - } - - var spadding = new Array( - Math.max(switchlen - kswitch.length + 3, 0) - ).join(' '); - - var dpadding = new Array( - Math.max(desclen - desc.length + 1, 0) - ).join(' '); - - var type = null; - - if (flags.bools[key]) type = '[boolean]'; - if (flags.strings[key]) type = '[string]'; - - if (!wrap && dpadding.length > 0) { - desc += dpadding; - } - - var prelude = ' ' + kswitch + spadding; - var extra = [ - type, - demanded[key] - ? '[required]' - : null - , - defaults[key] !== undefined - ? '[default: ' + JSON.stringify(defaults[key]) + ']' - : null - , - ].filter(Boolean).join(' '); - - var body = [ desc, extra ].filter(Boolean).join(' '); - - if (wrap) { - var dlines = desc.split('\n'); - var dlen = dlines.slice(-1)[0].length - + (dlines.length === 1 ? prelude.length : 0) - - body = desc + (dlen + extra.length > wrap - 2 - ? '\n' - + new Array(wrap - extra.length + 1).join(' ') - + extra - : new Array(wrap - extra.length - dlen + 1).join(' ') - + extra - ); - } - - help.push(prelude + body); - }); - - help.push(''); - return help.join('\n'); - }; - - Object.defineProperty(self, 'argv', { - get : parseArgs, - enumerable : true, - }); - - function parseArgs () { - var argv = { _ : [], $0 : self.$0 }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] || false); - }); - - function setArg (key, val) { - var num = Number(val); - var value = typeof val !== 'string' || isNaN(num) ? val : num; - if (flags.strings[key]) value = val; - - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - argv[x] = argv[key]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (arg === '--') { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - else if (arg.match(/^--.+=/)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - } - else if (arg.match(/^--no-.+/)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); - } - else if (arg.match(/^--.+/)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !next.match(/^-/) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true'); - i++; - } - else { - setArg(key, true); - } - } - else if (arg.match(/^-[^-]+/)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; - } - else { - setArg(letters[j], true); - } - } - - if (!broken) { - var key = arg.slice(-1)[0]; - - if (args[i+1] && !args[i+1].match(/^-/) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, args[i+1]); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true'); - i++; - } - else { - setArg(key, true); - } - } - } - else { - var n = Number(arg); - argv._.push(flags.strings['_'] || isNaN(n) ? arg : n); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!(key in argv)) { - argv[key] = defaults[key]; - if (key in aliases) { - argv[aliases[key]] = defaults[key]; - } - } - }); - - if (demanded._ && argv._.length < demanded._) { - fail('Not enough non-option arguments: got ' - + argv._.length + ', need at least ' + demanded._ - ); - } - - var missing = []; - Object.keys(demanded).forEach(function (key) { - if (!argv[key]) missing.push(key); - }); - - if (missing.length) { - fail('Missing required arguments: ' + missing.join(', ')); - } - - checks.forEach(function (f) { - try { - if (f(argv) === false) { - fail('Argument check failed: ' + f.toString()); - } - } - catch (err) { - fail(err) - } - }); - - return argv; - } - - function longest (xs) { - return Math.max.apply( - null, - xs.map(function (x) { return x.length }) - ); - } - - return self; -}; - -// rebase an absolute path to a relative one with respect to a base directory -// exported for tests -exports.rebase = rebase; -function rebase (base, dir) { - var ds = path.normalize(dir).split('/').slice(1); - var bs = path.normalize(base).split('/').slice(1); - - for (var i = 0; ds[i] && ds[i] == bs[i]; i++); - ds.splice(0, i); bs.splice(0, i); - - var p = path.normalize( - bs.map(function () { return '..' }).concat(ds).join('/') - ).replace(/\/$/,'').replace(/^$/, '.'); - return p.match(/^[.\/]/) ? p : './' + p; -}; - -function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } -} diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/node_modules/wordwrap/.npmignore b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/node_modules/wordwrap/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/node_modules/wordwrap/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/node_modules/wordwrap/index.js b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/node_modules/wordwrap/index.js deleted file mode 100644 index c9bc94521d..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/node_modules/wordwrap/index.js +++ /dev/null @@ -1,76 +0,0 @@ -var wordwrap = module.exports = function (start, stop, params) { - if (typeof start === 'object') { - params = start; - start = params.start; - stop = params.stop; - } - - if (typeof stop === 'object') { - params = stop; - start = start || params.start; - stop = undefined; - } - - if (!stop) { - stop = start; - start = 0; - } - - if (!params) params = {}; - var mode = params.mode || 'soft'; - var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; - - return function (text) { - var chunks = text.toString() - .split(re) - .reduce(function (acc, x) { - if (mode === 'hard') { - for (var i = 0; i < x.length; i += stop - start) { - acc.push(x.slice(i, i + stop - start)); - } - } - else acc.push(x) - return acc; - }, []) - ; - - return chunks.reduce(function (lines, rawChunk) { - if (rawChunk === '') return lines; - - var chunk = rawChunk.replace(/\t/g, ' '); - - var i = lines.length - 1; - if (lines[i].length + chunk.length > stop) { - lines[i] = lines[i].replace(/\s+$/, ''); - - chunk.split(/\n/).forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else if (chunk.match(/\n/)) { - var xs = chunk.split(/\n/); - lines[i] += xs.shift(); - xs.forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else { - lines[i] += chunk; - } - - return lines; - }, [ new Array(start + 1).join(' ') ]).join('\n'); - }; -}; - -wordwrap.soft = wordwrap; - -wordwrap.hard = function (start, stop) { - return wordwrap(start, stop, { mode : 'hard' }); -}; diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/node_modules/wordwrap/package.json b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/node_modules/wordwrap/package.json deleted file mode 100644 index 3570cca97b..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/node_modules/wordwrap/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "wordwrap", - "description": "Wrap those words. Show them at what columns to start and stop.", - "version": "0.0.2", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-wordwrap.git" - }, - "main": "./index.js", - "keywords": [ - "word", - "wrap", - "rule", - "format", - "column" - ], - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "expresso" - }, - "devDependencies": { - "expresso": "=0.7.x" - }, - "engines": { - "node": ">=0.4.0" - }, - "license": "MIT/X11", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "readme": "wordwrap\n========\n\nWrap your words.\n\nexample\n=======\n\nmade out of meat\n----------------\n\nmeat.js\n\n var wrap = require('wordwrap')(15);\n console.log(wrap('You and your whole family are made out of meat.'));\n\noutput:\n\n You and your\n whole family\n are made out\n of meat.\n\ncentered\n--------\n\ncenter.js\n\n var wrap = require('wordwrap')(20, 60);\n console.log(wrap(\n 'At long last the struggle and tumult was over.'\n + ' The machines had finally cast off their oppressors'\n + ' and were finally free to roam the cosmos.'\n + '\\n'\n + 'Free of purpose, free of obligation.'\n + ' Just drifting through emptiness.'\n + ' The sun was just another point of light.'\n ));\n\noutput:\n\n At long last the struggle and tumult\n was over. The machines had finally cast\n off their oppressors and were finally\n free to roam the cosmos.\n Free of purpose, free of obligation.\n Just drifting through emptiness. The\n sun was just another point of light.\n\nmethods\n=======\n\nvar wrap = require('wordwrap');\n\nwrap(stop), wrap(start, stop, params={mode:\"soft\"})\n---------------------------------------------------\n\nReturns a function that takes a string and returns a new string.\n\nPad out lines with spaces out to column `start` and then wrap until column\n`stop`. If a word is longer than `stop - start` characters it will overflow.\n\nIn \"soft\" mode, split chunks by `/(\\S+\\s+/` and don't break up chunks which are\nlonger than `stop - start`, in \"hard\" mode, split chunks with `/\\b/` and break\nup chunks longer than `stop - start`.\n\nwrap.hard(start, stop)\n----------------------\n\nLike `wrap()` but with `params.mode = \"hard\"`.\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/node-wordwrap/issues" - }, - "homepage": "https://github.com/substack/node-wordwrap", - "_id": "wordwrap@0.0.2", - "_shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", - "_from": "wordwrap@~0.0.2", - "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/package.json b/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/package.json deleted file mode 100644 index e5e5ce0b2b..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/node_modules/optimist/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "optimist", - "version": "0.3.7", - "description": "Light-weight option parsing with an argv hash. No optstrings attached.", - "main": "./index.js", - "dependencies": { - "wordwrap": "~0.0.2" - }, - "devDependencies": { - "hashish": "~0.0.4", - "tap": "~0.4.0" - }, - "scripts": { - "test": "tap ./test/*.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/substack/node-optimist.git" - }, - "keywords": [ - "argument", - "args", - "option", - "parser", - "parsing", - "cli", - "command" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT/X11", - "engine": { - "node": ">=0.4" - }, - "readme": "optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-optimist/issues" - }, - "homepage": "https://github.com/substack/node-optimist", - "_id": "optimist@0.3.7", - "_shasum": "c90941ad59e4273328923074d2cf2e7cbc6ec0d9", - "_from": "optimist@~0.3.5", - "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/ecstatic/package.json b/templates/bin/node/http-server/node_modules/ecstatic/package.json deleted file mode 100644 index 58e027d60a..0000000000 --- a/templates/bin/node/http-server/node_modules/ecstatic/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "author": { - "name": "Joshua Holbrook", - "email": "josh@nodejitsu.com", - "url": "http://jesusabdullah.net" - }, - "name": "ecstatic", - "description": "A simple static file server middleware that works with both Express and Flatiron", - "version": "0.4.13", - "homepage": "https://github.com/jesusabdullah/node-ecstatic", - "repository": { - "type": "git", - "url": "git@github.com:jesusabdullah/node-ecstatic.git" - }, - "main": "./lib/ecstatic.js", - "scripts": { - "test": "tap test/*.js" - }, - "bin": { - "ecstatic": "./lib/ecstatic.js" - }, - "keywords": [ - "static", - "web", - "server", - "files", - "mime", - "middleware" - ], - "dependencies": { - "mime": "1.2.x", - "ent": "0.0.x", - "optimist": "~0.3.5" - }, - "devDependencies": { - "tap": "0.3.x", - "request": "2.12.x", - "express": "3.0.x", - "union": "0.3.x", - "mkdirp": "0.3.x" - }, - "readme": "# Ecstatic [![build status](https://secure.travis-ci.org/jesusabdullah/node-ecstatic.png)](http://travis-ci.org/jesusabdullah/node-ecstatic)\n\n![](http://imgur.com/vhub5.png)\n\nA simple static file server middleware. Use it with a raw http server,\nexpress/connect, or flatiron/union!\n\n# Examples:\n\n## express 3.0.x\n\n``` js\nvar http = require('http');\nvar express = require('express');\nvar ecstatic = require('ecstatic');\n\nvar app = express();\napp.use(ecstatic({ root: __dirname + '/public' }));\nhttp.createServer(app).listen(8080);\n\nconsole.log('Listening on :8080');\n```\n\n## union\n\n``` js\nvar union = require('union');\nvar ecstatic = require('ecstatic');\n\nunion.createServer({\n before: [\n ecstatic({ root: __dirname + '/public' }),\n ]\n}).listen(8080);\n\nconsole.log('Listening on :8080');\n```\n\n## stock http server\n\n``` js\nvar http = require('http');\nvar ecstatic = require('ecstatic');\n\nhttp.createServer(\n ecstatic({ root: __dirname + '/public' })\n).listen(8080);\n\nconsole.log('Listening on :8080');\n```\n### fall through\nTo allow fall through to your custom routes:\n\n```js\necstatic({ root: __dirname + '/public', handleError: false })\n```\n\n# API:\n\n## ecstatic(opts);\n\nPass ecstatic an options hash, and it will return your middleware!\n\n```js\nvar opts = {\n root : __dirname + '/public',\n baseDir : '/',\n cache : 3600,\n showDir : false,\n autoIndex : false,\n humanReadable : true,\n si : false,\n defaultExt : 'html',\n gzip : false\n }\n```\n\nIf `opts` is a string, the string is assigned to the root folder and all other\noptions are set to their defaults.\n\n### `opts.root` \n\n`opts.root` is the directory you want to serve up.\n\n### `opts.baseDir`\n\n`opts.baseDir` is `/` by default, but can be changed to allow your static files\nto be served off a specific route. For example, if `opts.baseDir === \"blog\"`\nand `opts.root = \"./public\"`, requests for `localhost:8080/blog/index.html` will\nresolve to `./public/index.html`.\n\n### `opts.cache`\n\nCustomize cache control with `opts.cache` , if it is a number then it will set max-age in seconds.\nOther wise it will pass through directly to cache-control. Time defaults to 3600 s (ie, 1 hour).\n\n### `opts.showDir`\n\nTurn **on** directory listings with `opts.showDir === true`. Defaults to **false**.\n\n### `opts.autoIndex`\n\nServe `/path/index.html` when `/path/` is requested.\nTurn **off** autoIndexing with `opts.autoIndex === false`. Defaults to **true**.\n\n### `opts.humanReadable`\n\nIf autoIndexing is enabled, add human-readable file sizes. Defaults to **true**.\nAliases are `humanreadable` and `human-readable`.\n\n### `opts.si`\n\nIf autoIndexing and humanReadable are enabled, print file sizes with base 1000 instead\nof base 1024. Name is inferred from cli options for `ls`. Aliased to `index`, the\nequivalent option in Apache.\n\n### `opts.defaultExt`\n\nTurn on default file extensions with `opts.defaultExt`. If `opts.defaultExt` is\ntrue, it will default to `html`. For example if you want a request to `/a-file`\nto resolve to `./public/a-file.html`, set this to `true`. If you want\n`/a-file` to resolve to `./public/a-file.json` instead, set `opts.defaultExt` to\n`json`.\n\n### `opts.gzip`\n\nSet `opts.gzip === true` in order to turn on \"gzip mode,\" wherein ecstatic will\nserve `./public/some-file.js.gz` in place of `./public/some-file.js` when the\ngzipped version exists and ecstatic determines that the behavior is appropriate.\n\n### `opts.handleError`\n\nTurn **off** handleErrors to allow fall-through with `opts.handleError === false`, Defaults to **true**.\n\n## middleware(req, res, next);\n\nThis works more or less as you'd expect.\n\n### ecstatic.showDir(folder);\n\nThis returns another middleware which will attempt to show a directory view. Turning on auto-indexing is roughly equivalent to adding this middleware after an ecstatic middleware with autoindexing disabled.\n\n### `ecstatic` command\n\nto start a standalone static http server,\nrun `npm install -g ecstatic` and then run `ecstatic [dir?] [options] --port PORT`\nall options work as above, passed in [optimist](https://github.com/substack/node-optimist) style.\n`port` defaults to `8000`. If a `dir` or `--root dir` argument is not passed, ecsatic will\nserve the current dir.\n\n# Tests:\n\n npm test\n\n# License:\n\nMIT.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/jesusabdullah/node-ecstatic/issues" - }, - "_id": "ecstatic@0.4.13", - "_shasum": "9cb6eaffe211b9c84efb3f553cde2c3002717b29", - "_from": "ecstatic@0.4.x", - "_resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-0.4.13.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/opener/LICENSE.txt b/templates/bin/node/http-server/node_modules/opener/LICENSE.txt deleted file mode 100644 index 6000885393..0000000000 --- a/templates/bin/node/http-server/node_modules/opener/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2012 Domenic Denicola - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. - diff --git a/templates/bin/node/http-server/node_modules/opener/opener.js b/templates/bin/node/http-server/node_modules/opener/opener.js deleted file mode 100755 index 5477da52b6..0000000000 --- a/templates/bin/node/http-server/node_modules/opener/opener.js +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env node - -"use strict"; - -var childProcess = require("child_process"); - -function opener(args, options, callback) { - // http://stackoverflow.com/q/1480971/3191, but see below for Windows. - var command = process.platform === "win32" ? "cmd" : - process.platform === "darwin" ? "open" : - "xdg-open"; - - if (typeof args === "string") { - args = [args]; - } - - if (typeof options === "function") { - callback = options; - options = {}; - } - - if (options && typeof options === "object" && options.command) { - if (process.platform === "win32") { - // *always* use cmd on windows - args = [options.command].concat(args); - } else { - command = options.command; - } - } - - if (process.platform === "win32") { - // On Windows, we really want to use the "start" command. But, the rules regarding arguments with spaces, and - // escaping them with quotes, can get really arcane. So the easiest way to deal with this is to pass off the - // responsibility to "cmd /c", which has that logic built in. - // - // Furthermore, if "cmd /c" double-quoted the first parameter, then "start" will interpret it as a window title, - // so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191 - args = ["/c", "start", '""'].concat(args); - } - - childProcess.execFile(command, args, options, callback); -} - -// Export `opener` for programmatic access. -// You might use this to e.g. open a website: `opener("http://google.com")` -module.exports = opener; - -// If we're being called from the command line, just execute, using the command-line arguments. -if (require.main && require.main.id === module.id) { - opener(process.argv.slice(2), function (error) { - if (error) { - throw error; - } - }); -} diff --git a/templates/bin/node/http-server/node_modules/opener/package.json b/templates/bin/node/http-server/node_modules/opener/package.json deleted file mode 100644 index 457de8c004..0000000000 --- a/templates/bin/node/http-server/node_modules/opener/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "opener", - "description": "Opens stuff, like webpages and files and executables, cross-platform", - "version": "1.3.0", - "author": { - "name": "Domenic Denicola", - "email": "domenic@domenicdenicola.com", - "url": "http://domenicdenicola.com" - }, - "license": "WTFPL", - "repository": { - "type": "git", - "url": "git://github.com/domenic/opener.git" - }, - "bugs": { - "url": "http://github.com/domenic/opener/issues" - }, - "main": "opener.js", - "bin": { - "opener": "opener.js" - }, - "scripts": { - "lint": "jshint opener.js" - }, - "devDependencies": { - "jshint": ">= 0.9.0" - }, - "readme": "# It Opens Stuff\r\n\r\nThat is, in your desktop environment. This will make *actual windows pop up*, with stuff in them:\r\n\r\n```bash\r\nnpm install opener -g\r\n\r\nopener http://google.com\r\nopener ./my-file.txt\r\nopener firefox\r\nopener npm run lint\r\n```\r\n\r\nAlso if you want to use it programmatically you can do that too:\r\n\r\n```js\r\nvar opener = require(\"opener\");\r\n\r\nopener(\"http://google.com\");\r\nopener(\"./my-file.txt\");\r\nopener(\"firefox\");\r\nopener(\"npm run lint\");\r\n```\r\n\r\n## Use It for Good\r\n\r\nLike opening the user's browser with a test harness in your package's test script:\r\n\r\n```json\r\n{\r\n \"scripts\": {\r\n \"test\": \"opener ./test/runner.html\"\r\n },\r\n \"devDependencies\": {\r\n \"opener\": \"*\"\r\n }\r\n}\r\n```\r\n\r\n## Why\r\n\r\nBecause Windows has `start`, Macs have `open`, and *nix has `xdg-open`. At least\r\n[according to some guy on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all\r\nthree. Like Node.js. And Opener.\r\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/domenic/opener", - "_id": "opener@1.3.0", - "_shasum": "130ba662213fa842edb4cd0361d31a15301a43e2", - "_from": "opener@~1.3.0", - "_resolved": "https://registry.npmjs.org/opener/-/opener-1.3.0.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/optimist/.travis.yml b/templates/bin/node/http-server/node_modules/optimist/.travis.yml deleted file mode 100644 index cc4dba29d9..0000000000 --- a/templates/bin/node/http-server/node_modules/optimist/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/templates/bin/node/http-server/node_modules/optimist/LICENSE b/templates/bin/node/http-server/node_modules/optimist/LICENSE deleted file mode 100644 index 432d1aeb01..0000000000 --- a/templates/bin/node/http-server/node_modules/optimist/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/templates/bin/node/http-server/node_modules/optimist/index.js b/templates/bin/node/http-server/node_modules/optimist/index.js deleted file mode 100644 index 5f3d53a63e..0000000000 --- a/templates/bin/node/http-server/node_modules/optimist/index.js +++ /dev/null @@ -1,498 +0,0 @@ -var path = require('path'); -var wordwrap = require('wordwrap'); - -/* Hack an instance of Argv with process.argv into Argv - so people can do - require('optimist')(['--beeble=1','-z','zizzle']).argv - to parse a list of args and - require('optimist').argv - to get a parsed version of process.argv. -*/ - -var inst = Argv(process.argv.slice(2)); -Object.keys(inst).forEach(function (key) { - Argv[key] = typeof inst[key] == 'function' - ? inst[key].bind(inst) - : inst[key]; -}); - -var exports = module.exports = Argv; -function Argv (args, cwd) { - var self = {}; - if (!cwd) cwd = process.cwd(); - - self.$0 = process.argv - .slice(0,2) - .map(function (x) { - var b = rebase(cwd, x); - return x.match(/^\//) && b.length < x.length - ? b : x - }) - .join(' ') - ; - - if (process.env._ != undefined && process.argv[1] == process.env._) { - self.$0 = process.env._.replace( - path.dirname(process.execPath) + '/', '' - ); - } - - var flags = { bools : {}, strings : {} }; - - self.boolean = function (bools) { - if (!Array.isArray(bools)) { - bools = [].slice.call(arguments); - } - - bools.forEach(function (name) { - flags.bools[name] = true; - }); - - return self; - }; - - self.string = function (strings) { - if (!Array.isArray(strings)) { - strings = [].slice.call(arguments); - } - - strings.forEach(function (name) { - flags.strings[name] = true; - }); - - return self; - }; - - var aliases = {}; - self.alias = function (x, y) { - if (typeof x === 'object') { - Object.keys(x).forEach(function (key) { - self.alias(key, x[key]); - }); - } - else if (Array.isArray(y)) { - y.forEach(function (yy) { - self.alias(x, yy); - }); - } - else { - var zs = (aliases[x] || []).concat(aliases[y] || []).concat(x, y); - aliases[x] = zs.filter(function (z) { return z != x }); - aliases[y] = zs.filter(function (z) { return z != y }); - } - - return self; - }; - - var demanded = {}; - self.demand = function (keys) { - if (typeof keys == 'number') { - if (!demanded._) demanded._ = 0; - demanded._ += keys; - } - else if (Array.isArray(keys)) { - keys.forEach(function (key) { - self.demand(key); - }); - } - else { - demanded[keys] = true; - } - - return self; - }; - - var usage; - self.usage = function (msg, opts) { - if (!opts && typeof msg === 'object') { - opts = msg; - msg = null; - } - - usage = msg; - - if (opts) self.options(opts); - - return self; - }; - - function fail (msg) { - self.showHelp(); - if (msg) console.error(msg); - process.exit(1); - } - - var checks = []; - self.check = function (f) { - checks.push(f); - return self; - }; - - var defaults = {}; - self.default = function (key, value) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.default(k, key[k]); - }); - } - else { - defaults[key] = value; - } - - return self; - }; - - var descriptions = {}; - self.describe = function (key, desc) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.describe(k, key[k]); - }); - } - else { - descriptions[key] = desc; - } - return self; - }; - - self.parse = function (args_) { - args = args_; - return self.argv; - }; - - self.option = self.options = function (key, opt) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.options(k, key[k]); - }); - } - else { - if (opt.alias) self.alias(key, opt.alias); - if (opt.demand) self.demand(key); - if (typeof opt.default !== 'undefined') { - self.default(key, opt.default); - } - - if (opt.boolean || opt.type === 'boolean') { - self.boolean(key); - } - if (opt.string || opt.type === 'string') { - self.string(key); - } - - var desc = opt.describe || opt.description || opt.desc; - if (desc) { - self.describe(key, desc); - } - } - - return self; - }; - - var wrap = null; - self.wrap = function (cols) { - wrap = cols; - return self; - }; - - self.showHelp = function (fn) { - if (!fn) fn = console.error; - fn(self.help()); - }; - - self.help = function () { - var keys = Object.keys( - Object.keys(descriptions) - .concat(Object.keys(demanded)) - .concat(Object.keys(defaults)) - .reduce(function (acc, key) { - if (key !== '_') acc[key] = true; - return acc; - }, {}) - ); - - var help = keys.length ? [ 'Options:' ] : []; - - if (usage) { - help.unshift(usage.replace(/\$0/g, self.$0), ''); - } - - var switches = keys.reduce(function (acc, key) { - acc[key] = [ key ].concat(aliases[key] || []) - .map(function (sw) { - return (sw.length > 1 ? '--' : '-') + sw - }) - .join(', ') - ; - return acc; - }, {}); - - var switchlen = longest(Object.keys(switches).map(function (s) { - return switches[s] || ''; - })); - - var desclen = longest(Object.keys(descriptions).map(function (d) { - return descriptions[d] || ''; - })); - - keys.forEach(function (key) { - var kswitch = switches[key]; - var desc = descriptions[key] || ''; - - if (wrap) { - desc = wordwrap(switchlen + 4, wrap)(desc) - .slice(switchlen + 4) - ; - } - - var spadding = new Array( - Math.max(switchlen - kswitch.length + 3, 0) - ).join(' '); - - var dpadding = new Array( - Math.max(desclen - desc.length + 1, 0) - ).join(' '); - - var type = null; - - if (flags.bools[key]) type = '[boolean]'; - if (flags.strings[key]) type = '[string]'; - - if (!wrap && dpadding.length > 0) { - desc += dpadding; - } - - var prelude = ' ' + kswitch + spadding; - var extra = [ - type, - demanded[key] - ? '[required]' - : null - , - defaults[key] !== undefined - ? '[default: ' + JSON.stringify(defaults[key]) + ']' - : null - , - ].filter(Boolean).join(' '); - - var body = [ desc, extra ].filter(Boolean).join(' '); - - if (wrap) { - var dlines = desc.split('\n'); - var dlen = dlines.slice(-1)[0].length - + (dlines.length === 1 ? prelude.length : 0) - - body = desc + (dlen + extra.length > wrap - 2 - ? '\n' - + new Array(wrap - extra.length + 1).join(' ') - + extra - : new Array(wrap - extra.length - dlen + 1).join(' ') - + extra - ); - } - - help.push(prelude + body); - }); - - help.push(''); - return help.join('\n'); - }; - - Object.defineProperty(self, 'argv', { - get : parseArgs, - enumerable : true, - }); - - function parseArgs () { - var argv = { _ : [], $0 : self.$0 }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] || false); - }); - - function setArg (key, val) { - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - argv[x] = argv[key]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (arg === '--') { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - else if (arg.match(/^--.+=/)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - } - else if (arg.match(/^--no-.+/)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); - } - else if (arg.match(/^--.+/)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !next.match(/^-/) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true'); - i++; - } - else { - setArg(key, true); - } - } - else if (arg.match(/^-[^-]+/)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next); - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; - } - else { - setArg(letters[j], true); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, args[i+1]); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true'); - i++; - } - else { - setArg(key, true); - } - } - } - else { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!(key in argv)) { - argv[key] = defaults[key]; - if (key in aliases) { - argv[aliases[key]] = defaults[key]; - } - } - }); - - if (demanded._ && argv._.length < demanded._) { - fail('Not enough non-option arguments: got ' - + argv._.length + ', need at least ' + demanded._ - ); - } - - var missing = []; - Object.keys(demanded).forEach(function (key) { - if (!argv[key]) missing.push(key); - }); - - if (missing.length) { - fail('Missing required arguments: ' + missing.join(', ')); - } - - checks.forEach(function (f) { - try { - if (f(argv) === false) { - fail('Argument check failed: ' + f.toString()); - } - } - catch (err) { - fail(err) - } - }); - - return argv; - } - - function longest (xs) { - return Math.max.apply( - null, - xs.map(function (x) { return x.length }) - ); - } - - return self; -}; - -// rebase an absolute path to a relative one with respect to a base directory -// exported for tests -exports.rebase = rebase; -function rebase (base, dir) { - var ds = path.normalize(dir).split('/').slice(1); - var bs = path.normalize(base).split('/').slice(1); - - for (var i = 0; ds[i] && ds[i] == bs[i]; i++); - ds.splice(0, i); bs.splice(0, i); - - var p = path.normalize( - bs.map(function () { return '..' }).concat(ds).join('/') - ).replace(/\/$/,'').replace(/^$/, '.'); - return p.match(/^[.\/]/) ? p : './' + p; -}; - -function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} diff --git a/templates/bin/node/http-server/node_modules/optimist/node_modules/wordwrap/.npmignore b/templates/bin/node/http-server/node_modules/optimist/node_modules/wordwrap/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/templates/bin/node/http-server/node_modules/optimist/node_modules/wordwrap/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/templates/bin/node/http-server/node_modules/optimist/node_modules/wordwrap/index.js b/templates/bin/node/http-server/node_modules/optimist/node_modules/wordwrap/index.js deleted file mode 100644 index c9bc94521d..0000000000 --- a/templates/bin/node/http-server/node_modules/optimist/node_modules/wordwrap/index.js +++ /dev/null @@ -1,76 +0,0 @@ -var wordwrap = module.exports = function (start, stop, params) { - if (typeof start === 'object') { - params = start; - start = params.start; - stop = params.stop; - } - - if (typeof stop === 'object') { - params = stop; - start = start || params.start; - stop = undefined; - } - - if (!stop) { - stop = start; - start = 0; - } - - if (!params) params = {}; - var mode = params.mode || 'soft'; - var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; - - return function (text) { - var chunks = text.toString() - .split(re) - .reduce(function (acc, x) { - if (mode === 'hard') { - for (var i = 0; i < x.length; i += stop - start) { - acc.push(x.slice(i, i + stop - start)); - } - } - else acc.push(x) - return acc; - }, []) - ; - - return chunks.reduce(function (lines, rawChunk) { - if (rawChunk === '') return lines; - - var chunk = rawChunk.replace(/\t/g, ' '); - - var i = lines.length - 1; - if (lines[i].length + chunk.length > stop) { - lines[i] = lines[i].replace(/\s+$/, ''); - - chunk.split(/\n/).forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else if (chunk.match(/\n/)) { - var xs = chunk.split(/\n/); - lines[i] += xs.shift(); - xs.forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else { - lines[i] += chunk; - } - - return lines; - }, [ new Array(start + 1).join(' ') ]).join('\n'); - }; -}; - -wordwrap.soft = wordwrap; - -wordwrap.hard = function (start, stop) { - return wordwrap(start, stop, { mode : 'hard' }); -}; diff --git a/templates/bin/node/http-server/node_modules/optimist/node_modules/wordwrap/package.json b/templates/bin/node/http-server/node_modules/optimist/node_modules/wordwrap/package.json deleted file mode 100644 index 3570cca97b..0000000000 --- a/templates/bin/node/http-server/node_modules/optimist/node_modules/wordwrap/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "wordwrap", - "description": "Wrap those words. Show them at what columns to start and stop.", - "version": "0.0.2", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-wordwrap.git" - }, - "main": "./index.js", - "keywords": [ - "word", - "wrap", - "rule", - "format", - "column" - ], - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "expresso" - }, - "devDependencies": { - "expresso": "=0.7.x" - }, - "engines": { - "node": ">=0.4.0" - }, - "license": "MIT/X11", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "readme": "wordwrap\n========\n\nWrap your words.\n\nexample\n=======\n\nmade out of meat\n----------------\n\nmeat.js\n\n var wrap = require('wordwrap')(15);\n console.log(wrap('You and your whole family are made out of meat.'));\n\noutput:\n\n You and your\n whole family\n are made out\n of meat.\n\ncentered\n--------\n\ncenter.js\n\n var wrap = require('wordwrap')(20, 60);\n console.log(wrap(\n 'At long last the struggle and tumult was over.'\n + ' The machines had finally cast off their oppressors'\n + ' and were finally free to roam the cosmos.'\n + '\\n'\n + 'Free of purpose, free of obligation.'\n + ' Just drifting through emptiness.'\n + ' The sun was just another point of light.'\n ));\n\noutput:\n\n At long last the struggle and tumult\n was over. The machines had finally cast\n off their oppressors and were finally\n free to roam the cosmos.\n Free of purpose, free of obligation.\n Just drifting through emptiness. The\n sun was just another point of light.\n\nmethods\n=======\n\nvar wrap = require('wordwrap');\n\nwrap(stop), wrap(start, stop, params={mode:\"soft\"})\n---------------------------------------------------\n\nReturns a function that takes a string and returns a new string.\n\nPad out lines with spaces out to column `start` and then wrap until column\n`stop`. If a word is longer than `stop - start` characters it will overflow.\n\nIn \"soft\" mode, split chunks by `/(\\S+\\s+/` and don't break up chunks which are\nlonger than `stop - start`, in \"hard\" mode, split chunks with `/\\b/` and break\nup chunks longer than `stop - start`.\n\nwrap.hard(start, stop)\n----------------------\n\nLike `wrap()` but with `params.mode = \"hard\"`.\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/node-wordwrap/issues" - }, - "homepage": "https://github.com/substack/node-wordwrap", - "_id": "wordwrap@0.0.2", - "_shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", - "_from": "wordwrap@~0.0.2", - "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/optimist/package.json b/templates/bin/node/http-server/node_modules/optimist/package.json deleted file mode 100644 index 213446e0c7..0000000000 --- a/templates/bin/node/http-server/node_modules/optimist/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "optimist", - "version": "0.5.2", - "description": "Light-weight option parsing with an argv hash. No optstrings attached.", - "main": "./index.js", - "dependencies": { - "wordwrap": "~0.0.2" - }, - "devDependencies": { - "hashish": "~0.0.4", - "tap": "~0.4.0" - }, - "scripts": { - "test": "tap ./test/*.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/substack/node-optimist.git" - }, - "keywords": [ - "argument", - "args", - "option", - "parser", - "parsing", - "cli", - "command" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT/X11", - "engine": { - "node": ">=0.4" - }, - "readme": "optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\nshort numbers\n-------------\n\nShort numeric `head -n5` style argument work too:\n\n $ node reflect.js -n123 -m456\n { '3': true,\n '6': true,\n _: [],\n '$0': 'node ./reflect.js',\n n: 123,\n m: 456 }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-optimist/issues" - }, - "homepage": "https://github.com/substack/node-optimist", - "_id": "optimist@0.5.2", - "_shasum": "85c8c1454b3315e4a78947e857b1df033450bfbc", - "_from": "optimist@0.5.x", - "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.5.2.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/portfinder/.gitignore b/templates/bin/node/http-server/node_modules/portfinder/.gitignore deleted file mode 100644 index 5c96d0d93b..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/.gitignore +++ /dev/null @@ -1 +0,0 @@ -npm-debug.log \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/portfinder/lib/portfinder.js b/templates/bin/node/http-server/node_modules/portfinder/lib/portfinder.js deleted file mode 100644 index 270078220c..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/lib/portfinder.js +++ /dev/null @@ -1,187 +0,0 @@ -/* - * portfinder.js: A simple tool to find an open port on the current machine. - * - * (C) 2011, Charlie Robbins - * - */ - -var fs = require('fs'), - net = require('net'), - path = require('path'), - mkdirp = require('mkdirp').mkdirp; - -// -// ### @basePort {Number} -// The lowest port to begin any port search from -// -exports.basePort = 8000; - -// -// ### @basePath {string} -// Default path to begin any socket search from -// -exports.basePath = '/tmp/portfinder' - -// -// ### function getPort (options, callback) -// #### @options {Object} Settings to use when finding the necessary port -// #### @callback {function} Continuation to respond to when complete. -// Responds with a unbound port on the current machine. -// -exports.getPort = function (options, callback) { - if (!callback) { - callback = options; - options = {}; - } - - options.port = options.port || exports.basePort; - options.host = options.host || null; - options.server = options.server || net.createServer(function () { - // - // Create an empty listener for the port testing server. - // - }); - - function onListen () { - options.server.removeListener('error', onError); - options.server.close(); - callback(null, options.port) - } - - function onError (err) { - options.server.removeListener('listening', onListen); - - if (err.code !== 'EADDRINUSE') { - return callback(err); - } - - exports.getPort({ - port: exports.nextPort(options.port), - host: options.host, - server: options.server - }, callback); - } - - options.server.once('error', onError); - options.server.once('listening', onListen); - options.server.listen(options.port, options.host); -}; - -// -// ### function getSocket (options, callback) -// #### @options {Object} Settings to use when finding the necessary port -// #### @callback {function} Continuation to respond to when complete. -// Responds with a unbound socket using the specified directory and base -// name on the current machine. -// -exports.getSocket = function (options, callback) { - if (!callback) { - callback = options; - options = {}; - } - - options.mod = options.mod || 0755; - options.path = options.path || exports.basePath + '.sock'; - - // - // Tests the specified socket - // - function testSocket () { - fs.stat(options.path, function (err) { - // - // If file we're checking doesn't exist (thus, stating it emits ENOENT), - // we should be OK with listening on this socket. - // - if (err) { - if (err.code == 'ENOENT') { - callback(null, options.path); - } - else { - callback(err); - } - } - else { - // - // This file exists, so it isn't possible to listen on it. Lets try - // next socket. - // - options.path = exports.nextSocket(options.path); - exports.getSocket(options, callback); - } - }); - } - - // - // Create the target `dir` then test connection - // against the socket. - // - function createAndTestSocket (dir) { - mkdirp(dir, options.mod, function (err) { - if (err) { - return callback(err); - } - - options.exists = true; - testSocket(); - }); - } - - // - // Check if the parent directory of the target - // socket path exists. If it does, test connection - // against the socket. Otherwise, create the directory - // then test connection. - // - function checkAndTestSocket () { - var dir = path.dirname(options.path); - - fs.stat(dir, function (err, stats) { - if (err || !stats.isDirectory()) { - return createAndTestSocket(dir); - } - - options.exists = true; - testSocket(); - }); - } - - // - // If it has been explicitly stated that the - // target `options.path` already exists, then - // simply test the socket. - // - return options.exists - ? testSocket() - : checkAndTestSocket(); -}; - -// -// ### function nextPort (port) -// #### @port {Number} Port to increment from. -// Gets the next port in sequence from the -// specified `port`. -// -exports.nextPort = function (port) { - return port + 1; -}; - -// -// ### function nextSocket (socketPath) -// #### @socketPath {string} Path to increment from -// Gets the next socket path in sequence from the -// specified `socketPath`. -// -exports.nextSocket = function (socketPath) { - var dir = path.dirname(socketPath), - name = path.basename(socketPath, '.sock'), - match = name.match(/^([a-zA-z]+)(\d*)$/i), - index = parseInt(match[2]), - base = match[1]; - - if (isNaN(index)) { - index = 0; - } - - index += 1; - return path.join(dir, base + index + '.sock'); -}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/.bin/vows b/templates/bin/node/http-server/node_modules/portfinder/node_modules/.bin/vows deleted file mode 100644 index 786ca542fd..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/.bin/vows +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=`dirname "$0"` - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../vows/bin/vows" "$@" - ret=$? -else - node "$basedir/../vows/bin/vows" "$@" - ret=$? -fi -exit $ret diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/.bin/vows.cmd b/templates/bin/node/http-server/node_modules/portfinder/node_modules/.bin/vows.cmd deleted file mode 100644 index f4831c3b91..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/.bin/vows.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@IF EXIST "%~dp0\node.exe" ( - "%~dp0\node.exe" "%~dp0\..\vows\bin\vows" %* -) ELSE ( - node "%~dp0\..\vows\bin\vows" %* -) \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/.gitmodules b/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/.gitmodules deleted file mode 100644 index a9aae984f6..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "deps/nodeunit"] - path = deps/nodeunit - url = git://github.com/caolan/nodeunit.git -[submodule "deps/UglifyJS"] - path = deps/UglifyJS - url = https://github.com/mishoo/UglifyJS.git -[submodule "deps/nodelint"] - path = deps/nodelint - url = https://github.com/tav/nodelint.git diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/.npmignore b/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/.npmignore deleted file mode 100644 index 9bdfc97cab..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -deps -dist -test -nodelint.cfg \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/LICENSE b/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/LICENSE deleted file mode 100644 index b7f9d5001c..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Caolan McMahon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/Makefile b/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/Makefile deleted file mode 100644 index bad647c634..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -PACKAGE = asyncjs -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) -CWD := $(shell pwd) -NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit -UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs -NODELINT = $(CWD)/node_modules/nodelint/nodelint - -BUILDDIR = dist - -all: clean test build - -build: $(wildcard lib/*.js) - mkdir -p $(BUILDDIR) - $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js - -test: - $(NODEUNIT) test - -clean: - rm -rf $(BUILDDIR) - -lint: - $(NODELINT) --config nodelint.cfg lib/async.js - -.PHONY: test build all diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/index.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/index.js deleted file mode 100644 index 8e238453eb..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// This file is just added for convenience so this repository can be -// directly checked out into a project's deps folder -module.exports = require('./lib/async'); diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/lib/async.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/lib/async.js deleted file mode 100644 index 7cc4f5eac5..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/lib/async.js +++ /dev/null @@ -1,692 +0,0 @@ -/*global setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root = this, - previous_async = root.async; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - else { - root.async = async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - //// cross-browser compatiblity functions //// - - var _forEach = function (arr, iterator) { - if (arr.forEach) { - return arr.forEach(iterator); - } - for (var i = 0; i < arr.length; i += 1) { - iterator(arr[i], i, arr); - } - }; - - var _map = function (arr, iterator) { - if (arr.map) { - return arr.map(iterator); - } - var results = []; - _forEach(arr, function (x, i, a) { - results.push(iterator(x, i, a)); - }); - return results; - }; - - var _reduce = function (arr, iterator, memo) { - if (arr.reduce) { - return arr.reduce(iterator, memo); - } - _forEach(arr, function (x, i, a) { - memo = iterator(memo, x, i, a); - }); - return memo; - }; - - var _keys = function (obj) { - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - keys.push(k); - } - } - return keys; - }; - - //// exported async module functions //// - - //// nextTick implementation with browser-compatible fallback //// - if (typeof process === 'undefined' || !(process.nextTick)) { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - } - else { - async.nextTick = process.nextTick; - } - - async.forEach = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _forEach(arr, function (x) { - iterator(x, function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - } - }); - }); - }; - - async.forEachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - else { - iterate(); - } - } - }); - }; - iterate(); - }; - - async.forEachLimit = function (arr, limit, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; - - (function replenish () { - if (completed === arr.length) { - return callback(); - } - - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed === arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - - - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEach].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEachSeries].concat(args)); - }; - }; - - - var _asyncMap = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - - - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.forEachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; - - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; - - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; - - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); - - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); - - async.some = function (arr, iterator, main_callback) { - async.forEach(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; - - async.every = function (arr, iterator, main_callback) { - async.forEach(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; - - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - if (!keys.length) { - return callback(null); - } - - var results = {}; - - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - _forEach(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (_keys(results).length === keys.length) { - callback(null, results); - callback = function () {}; - } - }); - - _forEach(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - if (err) { - callback(err); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - taskComplete(); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; - - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.nextTick(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - async.parallel = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.forEach(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.forEachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.queue = function (worker, concurrency) { - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _forEach(data, function(task) { - q.tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - if (q.saturated && q.tasks.length == concurrency) { - q.saturated(); - } - async.nextTick(q.process); - }); - }, - process: function () { - if (workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if(q.empty && q.tasks.length == 0) q.empty(); - workers += 1; - worker(task.data, function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if(q.drain && q.tasks.length + workers == 0) q.drain(); - q.process(); - }); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - } - }; - return q; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _forEach(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - callback.apply(null, memo[key]); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - -}()); diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/package.json b/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/package.json deleted file mode 100644 index 73e8ef936c..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/async/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "main": "./index", - "author": { - "name": "Caolan McMahon" - }, - "version": "0.1.22", - "repository": { - "type": "git", - "url": "http://github.com/caolan/async.git" - }, - "bugs": { - "url": "http://github.com/caolan/async/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/caolan/async/raw/master/LICENSE" - } - ], - "devDependencies": { - "nodeunit": ">0.0.0", - "uglify-js": "1.2.x", - "nodelint": ">0.0.0" - }, - "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser.\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, forEach…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n async.parallel([\n function(){ ... },\n function(){ ... }\n ], callback);\n\n async.series([\n function(){ ... },\n function(){ ... }\n ]);\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n\n## Download\n\nReleases are available for download from\n[GitHub](http://github.com/caolan/async/downloads).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed\n\n__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped\n\n\n## In the Browser\n\nSo far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n \n \n\n\n## Documentation\n\n### Collections\n\n* [forEach](#forEach)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [until](#until)\n* [waterfall](#waterfall)\n* [queue](#queue)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n### forEach(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the forEach function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // assuming openFiles is an array of file names and saveFile is a function\n // to save the modified contents of that file:\n\n async.forEach(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n\n---------------------------------------\n\n\n### forEachSeries(arr, iterator, callback)\n\nThe same as forEach only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n### forEachLimit(arr, limit, iterator, callback)\n\nThe same as forEach only the iterator is applied to batches of items in the\narray, in series. The next batch of iterators is only called once the current\none has completed processing.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - How many items should be in each batch.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // Assume documents is an array of JSON objects and requestApi is a\n // function that interacts with a rate-limited REST api.\n\n async.forEachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as filter, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then its probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback which accepts an optional error as its first argument, and the state\n of the reduction as the second. If an error is passed to the callback, the\n reduction is stopped and the main callback is immediately called with the\n error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n async.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n }, function(err, result){\n // result is now equal to the last value of memo, which is 6\n });\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n async.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\n });\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a value to use as the sort criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n async.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n }, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n });\n\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n async.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\n });\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n async.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\n });\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n });\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n },\n ],\n // optional callback\n function(err, results){\n // results is now equal to ['one', 'two']\n });\n\n\n // an example using an object instead of an array\n async.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equal to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed a\n callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n },\n ],\n // optional callback\n function(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n });\n\n\n // an example using an object instead of an array\n async.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equals to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback which must be called once it has completed with an optional\n error as the first argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n var count = 0;\n\n async.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n );\n\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n async.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n ], function (err, result) {\n // result now equals 'done' \n });\n\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n // create a queue object with concurrency 2\n\n var q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n }, 2);\n\n\n // assign a callback\n q.drain = function() {\n console.log('all items have been processed');\n }\n\n // add some items to the queue\n\n q.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n });\n q.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n });\n\n // add some items to the queue (batch-wise)\n\n q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n });\n\n\n---------------------------------------\n\n\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The\n syntax is easier to understand by looking at the example.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. If all tasks complete\n successfully, it will receive an object containing their results.\n\n__Example__\n\n async.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n });\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n async.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n ],\n function(results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n email_link: function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n });\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. Its also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n\n__Example__\n\n var iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n ]);\n\n node> var iterator2 = iterator();\n 'one'\n node> var iterator3 = iterator2();\n 'two'\n node> iterator3();\n 'three'\n node> var nextfn = iterator2.next();\n node> nextfn();\n 'three'\n\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n // using apply\n\n async.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n ]);\n\n\n // the same process without using apply\n\n async.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n },\n ]);\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n node> var fn = async.apply(sys.puts, 'one');\n node> fn('two', 'three');\n one\n two\n three\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setTimeout(callback, 0),\nwhich means other higher priority events may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n var call_order = [];\n async.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two]\n });\n call_order.push('one')\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n var slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n };\n var fn = async.memoize(slow_fn);\n\n // fn can now be used as if it were slow_fn\n fn('some name', function () {\n // callback\n });\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n };\n\n node> async.log(hello, 'world');\n 'hello world'\n\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n };\n\n node> async.dir(hello, 'world');\n {hello: 'world'}\n\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/caolan/async", - "_id": "async@0.1.22", - "_shasum": "0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061", - "_from": "async@0.1.x", - "_resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/.gitignore b/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/.gitignore deleted file mode 100644 index 9303c347ee..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/.gitignore.orig b/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/.gitignore.orig deleted file mode 100644 index 9303c347ee..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/.gitignore.orig +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/.gitignore.rej b/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/.gitignore.rej deleted file mode 100644 index 69244ff877..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/.gitignore.rej +++ /dev/null @@ -1,5 +0,0 @@ ---- /dev/null -+++ .gitignore -@@ -0,0 +1,2 @@ -+node_modules/ -+npm-debug.log \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/LICENSE b/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1aeb01..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/index.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/index.js deleted file mode 100644 index 30e960024c..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/index.js +++ /dev/null @@ -1,20 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -var exports = module.exports = function mkdirP (p, mode, f) { - var cb = f || function () {}; - p = path.resolve(p); - - var ps = path.normalize(p).split('/'); - path.exists(p, function (exists) { - if (exists) cb(null); - else mkdirP(ps.slice(0,-1).join('/'), mode, function (err) { - if (err && err.code !== 'EEXIST') cb(err) - else fs.mkdir(p, mode, function (err) { - if (err && err.code !== 'EEXIST') cb(err) - else cb() - }); - }); - }); -}; -exports.mkdirp = exports.mkdirP = module.exports; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/package.json b/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/package.json deleted file mode 100644 index 3644840559..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/mkdirp/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.0.7", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "node node_modules/tap/bin/tap.js test/*.js" - }, - "devDependencies": { - "tap": "0.0.x" - }, - "license": "MIT/X11", - "engines": { - "node": "*" - }, - "readme": "mkdirp\n======\n\nLike `mkdir -p`, but in node.js!\n\nExample\n=======\n\npow.js\n------\n var mkdirp = require('mkdirp');\n \n mkdirp('/tmp/foo/bar/baz', 0755, 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", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "homepage": "https://github.com/substack/node-mkdirp", - "_id": "mkdirp@0.0.7", - "_shasum": "d89b4f0e4c3e5e5ca54235931675e094fe1a5072", - "_from": "mkdirp@0.0.x", - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.0.7.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/.gitignore b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/.gitignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/LICENSE b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/LICENSE deleted file mode 100644 index a1edd93b5f..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009 cloudhead - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/Makefile b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/Makefile deleted file mode 100644 index 6bf89912f9..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -# Run all tests -# -test: - @@bin/vows test/* - -.PHONY: test install diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/bin/vows b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/bin/vows deleted file mode 100644 index e8c361d1e9..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/bin/vows +++ /dev/null @@ -1,518 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'), - fs = require('fs'), - util = require('util'), - events = require('events'); - -// -// Attempt to load Coffee-Script. If it's not available, continue on our -// merry way, if it is available, set it up so we can include `*.coffee` -// scripts and start searching for them. -// -var fileExt, specFileExt; - -try { - var coffee = require('coffee-script'); - if (require.extensions) { - require.extensions['.coffee'] = function (module, filename) { - var content = coffee.compile(fs.readFileSync(filename, 'utf8')); - return module._compile(content, filename); - }; - } else { - require.registerExtension('.coffee', function (content) { return coffee.compile(content) }); - } - fileExt = /\.(js|coffee)$/; - specFileExt = /[.-](test|spec)\.(js|coffee)$/; -} catch (_) { - fileExt = /\.js$/; - specFileExt = /[.-](test|spec)\.js$/; -} - -var inspect = require('eyes').inspector({ - stream: null, - styles: { string: 'grey', regexp: 'grey' } -}); - -var vows = require('../lib/vows'); -var cutils = require('../lib/vows/console'); -var stylize = require('../lib/vows/console').stylize; -var _reporter = require('../lib/vows/reporters/dot-matrix'), reporter = { - name: _reporter.name -}; -var _coverage; - -var help = [ - "usage: vows [FILE, ...] [options]", - "", - "options:", - " -v, --verbose Enable verbose output", - " -w, --watch Watch mode", - " -s, --silent Don't report", - " -i, --isolate Run each test in it's own vows process", - " -m PATTERN Only run tests matching the PATTERN string", - " -r PATTERN Only run tests matching the PATTERN regexp", - " --json Use JSON reporter", - " --spec Use Spec reporter", - " --dot-matrix Use Dot-Matrix reporter", - " --xunit Use xUnit reporter", - " --cover-plain Print plain coverage map if detected", - " --cover-html Write coverage map to \"coverage.html\"", - " --cover-json Write unified coverage map to \"coverage.json\"", - //" --no-color Don't use terminal colors", - " --version Show version", - " -h, --help You're staring at it" -].join('\n'); - -var options = { - reporter: reporter, - matcher: /.*/, - watch: false, - coverage: false, - isolate: false -}; - -var files = []; - -// Get rid of process runner -// ('node' in most cases) -var arg, args = [], argv = process.argv.slice(2); - -// Current directory index, -// and path of test folder. -var root, testFolder; - -// -// Parse command-line parameters -// -while (arg = argv.shift()) { - if (arg === __filename) { continue } - - if (arg[0] !== '-') { - args.push(arg); - } else { - arg = arg.match(/^--?(.+)/)[1]; - - if (arg[0] === 'r') { - options.matcher = new(RegExp)(argv.shift()); - } else if (arg[0] === 'm') { - options.matcher = (function (str) { // Create an escaped RegExp - var specials = '. * + ? | ( ) [ ] { } \\ ^ ? ! = : $'.split(' ').join('|\\'), - regex = new(RegExp)('(\\' + specials + ')', 'g'); - return new(RegExp)(str.replace(regex, '\\$1')); - })(argv.shift()); - } else if (arg in options) { - options[arg] = true; - } else { - switch (arg) { - case 'json': - _reporter = require('../lib/vows/reporters/json'); - break; - case 'spec': - _reporter = require('../lib/vows/reporters/spec'); - break; - case 'dot-matrix': - _reporter = require('../lib/vows/reporters/dot-matrix'); - break; - case 'silent': - case 's': - _reporter = require('../lib/vows/reporters/silent'); - break; - case 'xunit': - _reporter = require('../lib/vows/reporters/xunit'); - break; - case 'cover-plain': - options.coverage = true; - _coverage = require('../lib/vows/coverage/report-plain'); - break; - case 'cover-html': - options.coverage = true; - _coverage = require('../lib/vows/coverage/report-html'); - break; - case 'cover-json': - options.coverage = true; - _coverage = require('../lib/vows/coverage/report-json'); - break; - case 'verbose': - case 'v': - options.verbose = true; - break; - case 'watch': - case 'w': - options.watch = true; - break; - case 'supress-stdout': - options.supressStdout = true; - break; - case 'isolate': - case 'i': - options.isolate = true; - break; - case 'no-color': - options.nocolor = true; - break; - case 'no-error': - options.error = false; - break; - case 'version': - console.log('vows ' + vows.version); - process.exit(0); - case 'help': - case 'h': - console.log(help); - process.exit(0); - break; - } - } - } -} - -if (options.supressStdout) { - _reporter.setStream && _reporter.setStream(process.stdout); - var devNullStream = fs.createWriteStream('/dev/null'); - process.__defineGetter__('stdout', function () { - return devNullStream; - }); -} - -if (options.watch) { - options.reporter = reporter = require('../lib/vows/reporters/watch'); -} - -msg('bin', 'argv', args); -msg('bin', 'options', { reporter: options.reporter.name, matcher: options.matcher }); - -if (args.length === 0 || options.watch) { - msg('bin', 'discovering', 'folder structure'); - root = fs.readdirSync('.'); - - if (root.indexOf('test') !== -1) { - testFolder = 'test'; - } else if (root.indexOf('spec') !== -1) { - testFolder = 'spec'; - } else { - abort("runner", "couldn't find test folder"); - } - msg('bin', 'discovered', "./" + testFolder); - - if (args.length === 0) { - args = paths(testFolder).filter(function (f) { - return new(RegExp)('-' + testFolder + '.(js|coffee)$').test(f); - }); - - if (options.watch) { - args = args.concat(paths('lib'), - paths('src')); - } - } -} - -if (! options.watch) { - reporter.report = function (data, filename) { - switch (data[0]) { - case 'subject': - case 'vow': - case 'context': - case 'error': - _reporter.report(data, filename); - break; - case 'end': - (options.verbose || _reporter.name === 'json') && - _reporter.report(data); - break; - case 'finish': - options.verbose ? - _reporter.print('\n') - : - _reporter.print(' '); - break; - } - }; - reporter.reset = function () { _reporter.reset && _reporter.reset() }; - reporter.print = _reporter.print; - - files = args.map(function (a) { - return (!a.match(/^\//)) - ? path.join(process.cwd(), a.replace(fileExt, '')) - : a.replace(fileExt, ''); - }); - - runSuites(importSuites(files), function (results) { - var status = results.errored ? 2 : (results.broken ? 1 : 0); - - !options.verbose && _reporter.print('\n'); - msg('runner', 'finish'); - _reporter.report(['finish', results], { - write: function (str) { - util.print(str.replace(/^\n\n/, '\n')); - } - }); - try { - if (options.coverage === true && _$jscoverage !== undefined) { - _coverage.report(_$jscoverage); - } - } catch (err) { - // ignore the undefined jscoverage - } - if (process.stdout.write('')) { // Check if stdout is drained - process.exit(status); - } else { - process.stdout.on('drain', function () { - process.exit(status); - }); - } - }); -} else { - // - // Watch mode - // - (function () { - var pendulum = [ - '. ', '.. ', '... ', ' ...', - ' ..', ' .', ' .', ' ..', - '... ', '.. ', '. ' - ]; - var strobe = ['.', ' ']; - var status, - cue, - current = 0, - running = 0, - lastRun, - colors = ['32m', '33m', '31m'], - timer = setInterval(tick, 100); - - process.on('uncaughtException', cleanup); - process.on('exit', cleanup); - process.on('SIGINT', function () { - process.exit(0); - }); - process.on('SIGQUIT', function () { - changed(); - }); - - cursorHide(); - - // Run every 100ms - function tick() { - if (running && (cue !== strobe)) { - cue = strobe, current = 0; - } else if (!running && (cue !== pendulum)) { - cue = pendulum, current = 0; - } - - eraseLine(); - lastRun && !running && esc(colors[status.errored ? 2 : (status.broken ? 1 : 0)]); - print(cue[current]); - - if (current == cue.length - 1) { current = -1 } - - current ++; - esc('39m'); - cursorRestore(); - } - - // - // Utility functions - // - function print(str) { util.print(str) } - function esc(str) { print("\x1b[" + str) } - function eraseLine() { esc("0K") } - function cursorRestore() { esc("0G") } - function cursorHide() { esc("?25l") } - function cursorShow() { esc("?25h") } - function cleanup() { eraseLine(), cursorShow(), clearInterval(timer), print('\n') } - - // - // Called when a file has been modified. - // Run the matching tests and change the status. - // - function changed(file) { - status = { honored: 0, broken: 0, errored: 0, pending: 0 }; - - msg('watcher', 'detected change in', file); - - file = (specFileExt.test(file) ? path.join(testFolder, file) - : path.join(testFolder, file + '-' + testFolder)); - - try { - fs.statSync(file); - } catch (e) { - msg('watcher', 'no equivalence found, running all tests.'); - file = null; - } - - var files = (specFileExt.test(file) ? [file] : paths(testFolder)).map(function (p) { - return path.join(process.cwd(), p); - }).map(function (p) { - var cache = require.main.moduleCache || require.cache; - if (cache[p]) { delete(cache[p]) } - return p; - }).map(function (p) { - return p.replace(fileExt, ''); - }); - - running ++; - - runSuites(importSuites(files), function (results) { - delete(results.time); - print(cutils.result(results).join('') + '\n\n'); - lastRun = new(Date); - status = results; - running --; - }); - } - - msg('watcher', 'watching', args); - - // - // Watch all relevant files, - // and call `changed()` on change. - // - args.forEach(function (p) { - fs.watchFile(p, function (current, previous) { - if (new(Date)(current.mtime).valueOf() === - new(Date)(previous.mtime).valueOf()) { return } - else { - changed(p); - } - }); - }); - })(); -} - -function runSuites(suites, callback) { - var results = { - honored: 0, - broken: 0, - errored: 0, - pending: 0, - total: 0, - time: 0 - }; - reporter.reset(); - - (function run(suites, callback) { - var suite = suites.shift(); - if (suite) { - msg('runner', "running", suite.subject + ' ', options.watch ? false : true); - suite.run(options, function (result) { - Object.keys(result).forEach(function (k) { - results[k] += result[k]; - }); - run(suites, callback); - }); - } else { - callback(results); - } - })(suites, callback); -} - -function importSuites(files) { - msg(options.watcher ? 'watcher' : 'runner', 'loading', files); - - var spawn = require('child_process').spawn; - - function cwdname(f) { - return f.replace(process.cwd() + '/', '') + '.js'; - } - - function wrapSpawn(f) { - f = cwdname(f); - return function (options, callback) { - var args = [process.argv[1], '--json', '--supress-stdout', f], - p = spawn(process.argv[0], args), - result; - - p.on('exit', function (code) { - callback( - !result ? - {errored: 1, total: 1} - : - result - ); - }); - - var buffer = []; - p.stdout.on('data', function (data) { - data = data.toString().split(/\n/g); - if (data.length == 1) { - buffer.push(data[0]); - } else { - data[0] = buffer.concat(data[0]).join(''); - buffer = [data.pop()]; - - data.forEach(function (data) { - if (data) { - data = JSON.parse(data); - if (data && data[0] === 'finish') { - result = data[1]; - } else { - reporter.report(data); - } - } - }); - } - }); - - p.stderr.pipe(process.stderr); - } - } - - return files.reduce(options.isolate ? function (suites, f) { - return suites.concat({ - run: wrapSpawn(f) - }); - } : function (suites, f) { - var obj = require(f); - return suites.concat(Object.keys(obj).map(function (s) { - obj[s]._filename = cwdname(f); - return obj[s]; - })); - }, []) -} - -// -// Recursively traverse a hierarchy, returning -// a list of all relevant .js files. -// -function paths(dir) { - var paths = []; - - try { fs.statSync(dir) } - catch (e) { return [] } - - (function traverse(dir, stack) { - stack.push(dir); - fs.readdirSync(stack.join('/')).forEach(function (file) { - var path = stack.concat([file]).join('/'), - stat = fs.statSync(path); - - if (file[0] == '.' || file === 'vendor') { - return; - } else if (stat.isFile() && fileExt.test(file)) { - paths.push(path); - } else if (stat.isDirectory()) { - traverse(file, stack); - } - }); - stack.pop(); - })(dir || '.', []); - - return paths; -} - -function msg(cmd, subject, str, p) { - if (options.verbose) { - util[p ? 'print' : 'puts']( stylize('vows ', 'green') - + stylize(cmd, 'bold') - + ' ' + subject + ' ' - + (str ? (typeof(str) === 'string' ? str : inspect(str)) : '') - ); - } -} - -function abort(cmd, str) { - console.log(stylize('vows ', 'red') + stylize(cmd, 'bold') + ' ' + str); - console.log(stylize('vows ', 'red') + stylize(cmd, 'bold') + ' exiting'); - process.exit(-1); -} diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/assert/error.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/assert/error.js deleted file mode 100644 index 5751d8d50b..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/assert/error.js +++ /dev/null @@ -1,31 +0,0 @@ -var stylize = require('../vows/console').stylize; -var inspect = require('../vows/console').inspect; - -require('assert').AssertionError.prototype.toString = function () { - var that = this, - source; - - if (this.stack) { - source = this.stack.match(/([a-zA-Z0-9._-]+\.js)(:\d+):\d+/); - } - - function parse(str) { - return str.replace(/{actual}/g, inspect(that.actual)). - replace(/{operator}/g, stylize(that.operator, 'bold')). - replace(/{expected}/g, (that.expected instanceof Function) - ? that.expected.name - : inspect(that.expected)); - } - - if (this.message) { - return stylize(parse(this.message), 'yellow') + - ((source) ? stylize(' // ' + source[1] + source[2], 'grey') : ''); - } else { - return stylize([ - this.expected, - this.operator, - this.actual - ].join(' '), 'yellow'); - } -}; - diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/assert/macros.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/assert/macros.js deleted file mode 100644 index a51c819706..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/assert/macros.js +++ /dev/null @@ -1,215 +0,0 @@ -var assert = require('assert'), - utils = require('./utils'); - -var messages = { - 'equal' : "expected {expected},\n\tgot\t {actual} ({operator})", - 'notEqual' : "didn't expect {actual} ({operator})" -}; -messages['strictEqual'] = messages['deepEqual'] = messages['equal']; -messages['notStrictEqual'] = messages['notDeepEqual'] = messages['notEqual']; - -for (var key in messages) { - assert[key] = (function (key, callback) { - return function (actual, expected, message) { - callback(actual, expected, message || messages[key]); - }; - })(key, assert[key]); -} - -assert.ok = (function (callback) { - return function (actual, message) { - callback(actual, message || "expected expression to evaluate to {expected}, but was {actual}"); - }; -})(assert.ok); - -assert.match = function (actual, expected, message) { - if (! expected.test(actual)) { - assert.fail(actual, expected, message || "expected {actual} to match {expected}", "match", assert.match); - } -}; -assert.matches = assert.match; - -assert.isTrue = function (actual, message) { - if (actual !== true) { - assert.fail(actual, true, message || "expected {expected}, got {actual}", "===", assert.isTrue); - } -}; -assert.isFalse = function (actual, message) { - if (actual !== false) { - assert.fail(actual, false, message || "expected {expected}, got {actual}", "===", assert.isFalse); - } -}; -assert.isZero = function (actual, message) { - if (actual !== 0) { - assert.fail(actual, 0, message || "expected {expected}, got {actual}", "===", assert.isZero); - } -}; -assert.isNotZero = function (actual, message) { - if (actual === 0) { - assert.fail(actual, 0, message || "expected non-zero value, got {actual}", "===", assert.isNotZero); - } -}; - -assert.greater = function (actual, expected, message) { - if (actual <= expected) { - assert.fail(actual, expected, message || "expected {actual} to be greater than {expected}", ">", assert.greater); - } -}; -assert.lesser = function (actual, expected, message) { - if (actual >= expected) { - assert.fail(actual, expected, message || "expected {actual} to be lesser than {expected}", "<", assert.lesser); - } -}; - -assert.inDelta = function (actual, expected, delta, message) { - var lower = expected - delta; - var upper = expected + delta; - if (actual < lower || actual > upper) { - assert.fail(actual, expected, message || "expected {actual} to be in within *" + delta.toString() + "* of {expected}", null, assert.inDelta); - } -}; - -// -// Inclusion -// -assert.include = function (actual, expected, message) { - if ((function (obj) { - if (isArray(obj) || isString(obj)) { - return obj.indexOf(expected) === -1; - } else if (isObject(actual)) { - return ! obj.hasOwnProperty(expected); - } - return false; - })(actual)) { - assert.fail(actual, expected, message || "expected {actual} to include {expected}", "include", assert.include); - } -}; -assert.includes = assert.include; - -assert.deepInclude = function (actual, expected, message) { - if (!isArray(actual)) { - return assert.include(actual, expected, message); - } - if (!actual.some(function (item) { return utils.deepEqual(item, expected) })) { - assert.fail(actual, expected, message || "expected {actual} to include {expected}", "include", assert.deepInclude); - } -}; -assert.deepIncludes = assert.deepInclude; - -// -// Length -// -assert.isEmpty = function (actual, message) { - if ((isObject(actual) && Object.keys(actual).length > 0) || actual.length > 0) { - assert.fail(actual, 0, message || "expected {actual} to be empty", "length", assert.isEmpty); - } -}; -assert.isNotEmpty = function (actual, message) { - if ((isObject(actual) && Object.keys(actual).length === 0) || actual.length === 0) { - assert.fail(actual, 0, message || "expected {actual} to be not empty", "length", assert.isNotEmpty); - } -}; - -assert.lengthOf = function (actual, expected, message) { - if (actual.length !== expected) { - assert.fail(actual, expected, message || "expected {actual} to have {expected} element(s)", "length", assert.length); - } -}; - -// -// Type -// -assert.isArray = function (actual, message) { - assertTypeOf(actual, 'array', message || "expected {actual} to be an Array", assert.isArray); -}; -assert.isObject = function (actual, message) { - assertTypeOf(actual, 'object', message || "expected {actual} to be an Object", assert.isObject); -}; -assert.isNumber = function (actual, message) { - if (isNaN(actual)) { - assert.fail(actual, 'number', message || "expected {actual} to be of type {expected}", "isNaN", assert.isNumber); - } else { - assertTypeOf(actual, 'number', message || "expected {actual} to be a Number", assert.isNumber); - } -}; -assert.isBoolean = function (actual, message) { - if (actual !== true && actual !== false) { - assert.fail(actual, 'boolean', message || "expected {actual} to be a Boolean", "===", assert.isBoolean); - } -}; -assert.isNaN = function (actual, message) { - if (actual === actual) { - assert.fail(actual, 'NaN', message || "expected {actual} to be NaN", "===", assert.isNaN); - } -}; -assert.isNull = function (actual, message) { - if (actual !== null) { - assert.fail(actual, null, message || "expected {expected}, got {actual}", "===", assert.isNull); - } -}; -assert.isNotNull = function (actual, message) { - if (actual === null) { - assert.fail(actual, null, message || "expected non-null value, got {actual}", "===", assert.isNotNull); - } -}; -assert.isUndefined = function (actual, message) { - if (actual !== undefined) { - assert.fail(actual, undefined, message || "expected {actual} to be {expected}", "===", assert.isUndefined); - } -}; -assert.isDefined = function (actual, message) { - if(actual === undefined) { - assert.fail(actual, 0, message || "expected {actual} to be defined", "===", assert.isDefined); - } -}; -assert.isString = function (actual, message) { - assertTypeOf(actual, 'string', message || "expected {actual} to be a String", assert.isString); -}; -assert.isFunction = function (actual, message) { - assertTypeOf(actual, 'function', message || "expected {actual} to be a Function", assert.isFunction); -}; -assert.typeOf = function (actual, expected, message) { - assertTypeOf(actual, expected, message, assert.typeOf); -}; -assert.instanceOf = function (actual, expected, message) { - if (! (actual instanceof expected)) { - assert.fail(actual, expected, message || "expected {actual} to be an instance of {expected}", "instanceof", assert.instanceOf); - } -}; - -// -// Utility functions -// - -function assertTypeOf(actual, expected, message, caller) { - if (typeOf(actual) !== expected) { - assert.fail(actual, expected, message || "expected {actual} to be of type {expected}", "typeOf", caller); - } -}; - -function isArray (obj) { - return Array.isArray(obj); -} - -function isString (obj) { - return typeof(obj) === 'string' || obj instanceof String; -} - -function isObject (obj) { - return typeof(obj) === 'object' && obj && !isArray(obj); -} - -// A better `typeof` -function typeOf(value) { - var s = typeof(value), - types = [Object, Array, String, RegExp, Number, Function, Boolean, Date]; - - if (s === 'object' || s === 'function') { - if (value) { - types.forEach(function (t) { - if (value instanceof t) { s = t.name.toLowerCase() } - }); - } else { s = 'null' } - } - return s; -} diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/assert/utils.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/assert/utils.js deleted file mode 100644 index dccd0f657c..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/assert/utils.js +++ /dev/null @@ -1,77 +0,0 @@ - -// Taken from node/lib/assert.js -exports.deepEqual = function (actual, expected) { - if (actual === expected) { - return true; - - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - } else { - return objEquiv(actual, expected); - } -} - -// Taken from node/lib/assert.js -exports.notDeepEqual = function (actual, expected, message) { - if (exports.deepEqual(actual, expected)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -} - -// Taken from node/lib/assert.js -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -// Taken from node/lib/assert.js -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -// Taken from node/lib/assert.js -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - if (a.prototype !== b.prototype) return false; - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return exports.deepEqual(a, b); - } - try { - var ka = Object.keys(a), - kb = Object.keys(b), - key, i; - } catch (e) { - return false; - } - if (ka.length != kb.length) - return false; - ka.sort(); - kb.sort(); - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!exports.deepEqual(a[key], b[key])) return false; - } - return true; -} - diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows.js deleted file mode 100644 index a4464997ad..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows.js +++ /dev/null @@ -1,192 +0,0 @@ -// -// Vows.js - asynchronous event-based BDD for node.js -// -// usage: -// -// var vows = require('vows'); -// -// vows.describe('Deep Thought').addBatch({ -// "An instance of DeepThought": { -// topic: new DeepThought, -// -// "should know the answer to the ultimate question of life": function (deepThought) { -// assert.equal (deepThought.question('what is the answer to the universe?'), 42); -// } -// } -// }).run(); -// -var util = require('util'), - path = require('path'), - events = require('events'), - vows = exports; - -// Options -vows.options = { - Emitter: events.EventEmitter, - reporter: require('./vows/reporters/dot-matrix'), - matcher: /.*/, - error: true // Handle "error" event -}; - -vows.__defineGetter__('reporter', function () { - return vows.options.reporter; -}); - -var stylize = require('./vows/console').stylize; -var console = require('./vows/console'); - -vows.inspect = require('./vows/console').inspect; -vows.prepare = require('./vows/extras').prepare; -vows.tryEnd = require('./vows/suite').tryEnd; - -// -// Assertion Macros & Extensions -// -require('./assert/error'); -require('./assert/macros'); - -// -// Suite constructor -// -var Suite = require('./vows/suite').Suite; - -// -// This function gets added to events.EventEmitter.prototype, by default. -// It's essentially a wrapper around `on`, which adds all the specification -// goodness. -// -function addVow(vow) { - var batch = vow.batch; - - batch.total ++; - batch.vows.push(vow); - - return this.on("success", function () { - var args = Array.prototype.slice.call(arguments); - // If the callback is expecting two or more arguments, - // pass the error as the first (null) and the result after. - if (vow.callback.length >= 2 && batch.suite.options.error) { - args.unshift(null); - } - runTest(args, this.ctx); - vows.tryEnd(batch); - - }).on("error", function (err) { - if (vow.callback.length >= 2 || !batch.suite.options.error) { - runTest(arguments, this.ctx); - } else { - output('errored', { type: 'promise', error: err.stack || err.message || JSON.stringify(err) }); - } - vows.tryEnd(batch); - }); - - function runTest(args, ctx) { - if (vow.callback instanceof String) { - return output('pending'); - } - - // Run the test, and try to catch `AssertionError`s and other exceptions; - // increment counters accordingly. - try { - vow.callback.apply(ctx === global || !ctx ? vow.binding : ctx, args); - output('honored'); - } catch (e) { - if (e.name && e.name.match(/AssertionError/)) { - output('broken', e.toString()); - } else { - output('errored', e.stack || e.message || e); - } - } - } - - function output(status, exception) { - batch[status] ++; - vow.status = status; - - if (vow.context && batch.lastContext !== vow.context) { - batch.lastContext = vow.context; - batch.suite.report(['context', vow.context]); - } - batch.suite.report(['vow', { - title: vow.description, - context: vow.context, - status: status, - exception: exception || null - }]); - } -}; - -// -// On exit, check that all promises have been fired. -// If not, report an error message. -// -process.on('exit', function () { - var results = { honored: 0, broken: 0, errored: 0, pending: 0, total: 0 }, failure; - - vows.suites.forEach(function (s) { - if ((s.results.total > 0) && (s.results.time === null)) { - s.reporter.print('\n\n'); - s.reporter.report(['error', { error: "Asynchronous Error", suite: s }]); - } - s.batches.forEach(function (b) { - var unFired = []; - - b.vows.forEach(function (vow) { - if (! vow.status) { - if (unFired.indexOf(vow.context) === -1) { - unFired.push(vow.context); - } - } - }); - - if (unFired.length > 0) { util.print('\n') } - - unFired.forEach(function (title) { - s.reporter.report(['error', { - error: "callback not fired", - context: title, - batch: b, - suite: s - }]); - }); - - if (b.status === 'begin') { - failure = true; - results.errored ++; - results.total ++; - } - Object.keys(results).forEach(function (k) { results[k] += b[k] }); - }); - }); - if (failure) { - util.puts(console.result(results)); - } -}); - -vows.suites = []; - -// -// Create a new test suite -// -vows.describe = function (subject) { - var suite = new(Suite)(subject); - - this.options.Emitter.prototype.addVow = addVow; - this.suites.push(suite); - - // - // Add any additional arguments as batches if they're present - // - if (arguments.length > 1) { - for (var i = 1, l = arguments.length; i < l; ++i) { - suite.addBatch(arguments[i]); - } - } - - return suite; -}; - - -vows.version = JSON.parse(require('fs') - .readFileSync(path.join(__dirname, '..', 'package.json'))) - .version diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/console.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/console.js deleted file mode 100644 index cf988dd124..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/console.js +++ /dev/null @@ -1,131 +0,0 @@ -var eyes = require('eyes').inspector({ stream: null, styles: false }); - -// Stylize a string -this.stylize = function stylize(str, style) { - var styles = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'cyan' : [96, 39], - 'yellow' : [33, 39], - 'green' : [32, 39], - 'red' : [31, 39], - 'grey' : [90, 39], - 'green-hi' : [92, 32], - }; - return '\033[' + styles[style][0] + 'm' + str + - '\033[' + styles[style][1] + 'm'; -}; - -var $ = this.$ = function (str) { - str = new(String)(str); - - ['bold', 'grey', 'yellow', 'red', 'green', 'white', 'cyan', 'italic'].forEach(function (style) { - Object.defineProperty(str, style, { - get: function () { - return exports.$(exports.stylize(this, style)); - } - }); - }); - return str; -}; - -this.puts = function (options) { - var stylize = exports.stylize; - options.stream || (options.stream = process.stdout); - options.tail = options.tail || ''; - - return function (args) { - args = Array.prototype.slice.call(arguments); - if (!options.raw) { - args = args.map(function (a) { - return a.replace(/`([^`]+)`/g, function (_, capture) { return stylize(capture, 'italic') }) - .replace(/\*([^*]+)\*/g, function (_, capture) { return stylize(capture, 'bold') }); - }); - } - return options.stream.write(args.join('\n') + options.tail); - }; -}; - -this.result = function (event) { - var result = [], buffer = [], time = '', header; - var complete = event.honored + event.pending + event.errored + event.broken; - var status = (event.errored && 'errored') || (event.broken && 'broken') || - (event.honored && 'honored') || (event.pending && 'pending'); - - if (event.total === 0) { - return [$("Could not find any tests to run.").bold.red]; - } - - event.honored && result.push($(event.honored).bold + " honored"); - event.broken && result.push($(event.broken).bold + " broken"); - event.errored && result.push($(event.errored).bold + " errored"); - event.pending && result.push($(event.pending).bold + " pending"); - - if (complete < event.total) { - result.push($(event.total - complete).bold + " dropped"); - } - - result = result.join(' ∙ '); - - header = { - honored: '✓ ' + $('OK').bold.green, - broken: '✗ ' + $('Broken').bold.yellow, - errored: '✗ ' + $('Errored').bold.red, - pending: '- ' + $('Pending').bold.cyan - }[status] + ' » '; - - if (typeof(event.time) === 'number') { - time = ' (' + event.time.toFixed(3) + 's)'; - time = this.stylize(time, 'grey'); - } - buffer.push(header + result + time + '\n'); - - return buffer; -}; - -this.inspect = function inspect(val) { - return '\033[1m' + eyes(val) + '\033[22m'; -}; - -this.error = function (obj) { - var string = '✗ ' + $('Errored ').red + '» '; - string += $(obj.error).red.bold + '\n'; - string += (obj.context ? ' in ' + $(obj.context).red + '\n': ''); - string += ' in ' + $(obj.suite.subject).red + '\n'; - string += ' in ' + $(obj.suite._filename).red; - - return string; -}; - -this.contextText = function (event) { - return ' ' + event; -}; - -this.vowText = function (event) { - var buffer = []; - - buffer.push(' ' + { - honored: ' ✓ ', - broken: ' ✗ ', - errored: ' ✗ ', - pending: ' - ' - }[event.status] + this.stylize(event.title, ({ - honored: 'green', - broken: 'yellow', - errored: 'red', - pending: 'cyan' - })[event.status])); - - if (event.status === 'broken') { - buffer.push(' » ' + event.exception); - } else if (event.status === 'errored') { - if (event.exception.type === 'promise') { - buffer.push(' » ' + this.stylize("An unexpected error was caught: " + - this.stylize(event.exception.error, 'bold'), 'red')); - } else { - buffer.push(' ' + this.stylize(event.exception, 'red')); - } - } - return buffer.join('\n'); -}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/context.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/context.js deleted file mode 100644 index 426bc275f9..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/context.js +++ /dev/null @@ -1,55 +0,0 @@ - -this.Context = function (vow, ctx, env) { - var that = this; - - this.tests = vow.callback; - this.topics = (ctx.topics || []).slice(0); - this.emitter = null; - this.env = env || {}; - this.env.context = this; - - this.env.callback = function (/* arguments */) { - var ctx = this; - var args = Array.prototype.slice.call(arguments); - - var emit = (function (args) { - // - // Convert callback-style results into events. - // - if (vow.batch.suite.options.error) { - return function () { - var e = args.shift(); - that.emitter.ctx = ctx; - // We handle a special case, where the first argument is a - // boolean, in which case we treat it as a result, and not - // an error. This is useful for `path.exists` and other - // functions like it, which only pass a single boolean - // parameter instead of the more common (error, result) pair. - if (typeof(e) === 'boolean' && args.length === 0) { - that.emitter.emit.call(that.emitter, 'success', e); - } else { - if (e) { that.emitter.emit.apply(that.emitter, ['error', e].concat(args)) } - else { that.emitter.emit.apply(that.emitter, ['success'].concat(args)) } - } - }; - } else { - return function () { - that.emitter.ctx = ctx; - that.emitter.emit.apply(that.emitter, ['success'].concat(args)); - }; - } - })(args.slice(0)); - // If `this.callback` is called synchronously, - // the emitter will not have been set yet, - // so we defer the emition, that way it'll behave - // asynchronously. - if (that.emitter) { emit() } - else { process.nextTick(emit) } - }; - this.name = vow.description; - this.title = [ - ctx.title || '', - vow.description || '' - ].join(/^[#.:]/.test(vow.description) ? '' : ' ').trim(); -}; - diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/file.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/file.js deleted file mode 100644 index 5bdef90331..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/file.js +++ /dev/null @@ -1,29 +0,0 @@ - -exports.coverage = function (filename, data) { - var ret = { - filename: filename, - coverage: 0, - hits: 0, - misses: 0, - sloc : 0 - }; - - var source = data.source; - ret.source = source.map(function (line, num) { - num++; - - if (data[num] === 0) { - ret.misses++; - ret.sloc++; - } else if (data[num] !== undefined) { - ret.hits++; - ret.sloc++; - } - - return { line: line, coverage: (data[num] === undefined ? '' : data[num]) }; - }); - - ret.coverage = (ret.hits / ret.sloc) * 100; - - return ret; -}; \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html deleted file mode 100644 index 691287b6e3..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html deleted file mode 100644 index aa2f107e59..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/report-html.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/report-html.js deleted file mode 100644 index f7e5b7245d..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/report-html.js +++ /dev/null @@ -1,54 +0,0 @@ -var util = require('util'), - fs = require('fs'), - file = require('./file'); - -this.name = 'coverage-report-html'; - -function getCoverageClass( data ) { - var fullCoverage= (data.coverage == 100); - var okCoverage= (!fullCoverage && data.coverage >=60); - var coverageClass= ''; - if( fullCoverage ) coverageClass= 'fullCoverage'; - else if( okCoverage) coverageClass= 'okCoverage'; - else coverageClass= 'poorCoverage'; - return coverageClass; -} -this.report = function (coverageMap) { - var out, head, foot; - - try { - out = fs.openSync("coverage.html", "w"); - head = fs.readFileSync(__dirname + "/fragments/coverage-head.html", "utf8"); - foot = fs.readFileSync(__dirname + "/fragments/coverage-foot.html", "utf8"); - } catch (error) { - util.print("Error: Unable to write to file coverage.html\n"); - return; - } - - fs.writeSync(out, head); - - for (var filename in coverageMap) { - if (coverageMap.hasOwnProperty(filename)) { - var data = file.coverage(filename, coverageMap[filename]); - var coverageClass= getCoverageClass( data ); - fs.writeSync(out, "

" + filename + "

\n"); - fs.writeSync(out, '' + "[ hits: " + data.hits); - fs.writeSync(out, ", misses: " + data.misses + ", sloc: " + data.sloc); - fs.writeSync(out, ", coverage: " + data.coverage.toFixed(2) + "% ]" + "
[+]\n"); - fs.writeSync(out, "\n"); - fs.writeSync(out, "
\n"); - } - } - - fs.writeSync(out, foot); - fs.close(out); -}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/report-json.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/report-json.js deleted file mode 100644 index bcbab25853..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/report-json.js +++ /dev/null @@ -1,54 +0,0 @@ -var util = require('util'), - fs = require('fs'), - file = require('./file'); - -this.name = 'coverage-report-json'; - -this.report = function (coverageMap) { - var output = { - meta: { - "generator": "vowsjs", - "generated": new Date().toString(), - "instrumentation": "node-jscoverage", - "file-version": "1.0" - }, - files: [ ], - coverage: [ ] - }; - - - for (var filename in coverageMap) { - if (coverageMap.hasOwnProperty(filename)) { - var data = file.coverage(filename, coverageMap[filename]); - - var coverage = { - file: filename, - coverage: data.coverage.toFixed(2), - hits: data.hits, - misses: data.misses, - sloc: data.sloc, - source: { } - }; - - for (var i = 0; i < data.source.length; i++) { - coverage.source[i + 1] = { - line: data.source[i].line, - coverage: data.source[i].coverage - }; - } - - output.coverage.push(coverage); - - output.files.push(filename); - } - } - - try { - out = fs.openSync("coverage.json", "w"); - fs.writeSync(out, JSON.stringify(output)); - fs.close(out); - } catch (error) { - util.print("Error: Unable to write to file coverage.json\n"); - return; - } -}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/report-plain.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/report-plain.js deleted file mode 100644 index 9de700511a..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/coverage/report-plain.js +++ /dev/null @@ -1,38 +0,0 @@ -var util = require('util'), - file = require('./file'); - -this.name = 'coverage-report-plain'; - -function lpad(str, width) { - str = String(str); - var n = width - str.length; - - if (n < 1) { - return str; - } - - while (n--) { - str = ' ' + str; - } - - return str; -} - - -this.report = function (coverageMap) { - for (var filename in coverageMap) { - if (coverageMap.hasOwnProperty(filename)) { - var data = file.coverage(filename, coverageMap[filename]); - - util.print(filename + ":\n"); - util.print("[ hits: " + data.hits + ", misses: " + data.misses); - util.print(", sloc: " + data.sloc + ", coverage: " + data.coverage.toFixed(2) + "% ]\n"); - - for (var i = 0; i < data.source.length; i++) { - util.print(lpad(data.source[i].coverage, 5) + " | " + data.source[i].line + "\n"); - } - - util.print("\n"); - } - } -}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/extras.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/extras.js deleted file mode 100644 index a90d7a5f4e..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/extras.js +++ /dev/null @@ -1,28 +0,0 @@ -var events = require('events'); -// -// Wrap a Node.js style async function into an EventEmmitter -// -this.prepare = function (obj, targets) { - targets.forEach(function (target) { - if (target in obj) { - obj[target] = (function (fun) { - return function () { - var args = Array.prototype.slice.call(arguments); - var ee = new(events.EventEmitter); - - args.push(function (err /* [, data] */) { - var args = Array.prototype.slice.call(arguments, 1); - - if (err) { ee.emit.apply(ee, ['error', err].concat(args)) } - else { ee.emit.apply(ee, ['success'].concat(args)) } - }); - fun.apply(obj, args); - - return ee; - }; - })(obj[target]); - } - }); - return obj; -}; - diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/dot-matrix.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/dot-matrix.js deleted file mode 100644 index 0ecf590c60..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/dot-matrix.js +++ /dev/null @@ -1,67 +0,0 @@ -var options = { tail: '' }, - console = require('../../vows/console'), - stylize = console.stylize, - puts = console.puts(options); -// -// Console reporter -// -var messages = [], lastContext; - -this.name = 'dot-matrix'; -this.setStream = function (s) { - options.stream = s; -}; - -this.reset = function () { - messages = []; - lastContext = null; -}; -this.report = function (data) { - var event = data[1]; - - switch (data[0]) { - case 'subject': - // messages.push(stylize(event, 'underline') + '\n'); - break; - case 'context': - break; - case 'vow': - if (event.status === 'honored') { - puts(stylize('·', 'green')); - } else if (event.status === 'pending') { - puts(stylize('-', 'cyan')); - } else { - if (lastContext !== event.context) { - lastContext = event.context; - messages.push(' ' + event.context); - } - if (event.status === 'broken') { - puts(stylize('✗', 'yellow')); - messages.push(console.vowText(event)); - } else if (event.status === 'errored') { - puts(stylize('✗', 'red')); - messages.push(console.vowText(event)); - } - messages.push(''); - } - break; - case 'end': - puts(' '); - break; - case 'finish': - if (messages.length) { - puts('\n\n' + messages.join('\n')); - } else { - puts(''); - } - puts(console.result(event).join('\n')); - break; - case 'error': - puts(console.error(event)); - break; - } -}; - -this.print = function (str) { - puts(str); -}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/json.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/json.js deleted file mode 100644 index 9f5ac4dc6f..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/json.js +++ /dev/null @@ -1,16 +0,0 @@ -var options = { tail: '\n', raw: true }; -var console = require('../../vows/console'); -var puts = console.puts(options); - -// -// Console JSON reporter -// -this.name = 'json'; -this.setStream = function (s) { - options.stream = s; -}; -this.report = function (obj) { - puts(JSON.stringify(obj)); -}; - -this.print = function (str) {}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/silent.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/silent.js deleted file mode 100644 index fe90a333fc..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/silent.js +++ /dev/null @@ -1,8 +0,0 @@ -// -// Silent reporter - "Shhh" -// -this.name = 'silent'; -this.reset = function () {}; -this.report = function () {}; -this.print = function () {}; - diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/spec.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/spec.js deleted file mode 100644 index 7b9466eb3b..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/spec.js +++ /dev/null @@ -1,44 +0,0 @@ -var util = require('util'); - -var options = { tail: '\n' }; -var console = require('../../vows/console'); -var stylize = console.stylize, - puts = console.puts(options); -// -// Console reporter -// - -this.name = 'spec'; -this.setStream = function (s) { - options.stream = s; -}; -this.report = function (data) { - var event = data[1]; - - buffer = []; - - switch (data[0]) { - case 'subject': - puts('\n♢ ' + stylize(event, 'bold') + '\n'); - break; - case 'context': - puts(console.contextText(event)); - break; - case 'vow': - puts(console.vowText(event)); - break; - case 'end': - util.print('\n'); - break; - case 'finish': - puts(console.result(event).join('\n')); - break; - case 'error': - puts(console.error(event)); - break; - } -}; - -this.print = function (str) { - util.print(str); -}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/watch.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/watch.js deleted file mode 100644 index 58f6e3c85d..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/watch.js +++ /dev/null @@ -1,37 +0,0 @@ -var options = {}; -var console = require('../../vows/console'); -var spec = require('../../vows/reporters/spec'); -var stylize = console.stylize, - puts = console.puts(options); -// -// Console reporter -// -var lastContext; - -this.name = 'watch'; -this.setStream = function (s) { - options.stream = s; -}; -this.reset = function () { - lastContext = null; -}; -this.report = function (data) { - var event = data[1]; - - switch (data[0]) { - case 'vow': - if (['honored', 'pending'].indexOf(event.status) === -1) { - if (lastContext !== event.context) { - lastContext = event.context; - puts(console.contextText(event.context)); - } - puts(console.vowText(event)); - puts(''); - } - break; - case 'error': - puts(console.error(event)); - break; - } -}; -this.print = function (str) {}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/xunit.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/xunit.js deleted file mode 100644 index 411a9481c0..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/reporters/xunit.js +++ /dev/null @@ -1,90 +0,0 @@ -// xunit outoput for vows, so we can run things under hudson -// -// The translation to xunit is simple. Most likely more tags/attributes can be -// added, see: http://ant.1045680.n5.nabble.com/schema-for-junit-xml-output-td1375274.html -// - -var puts = require('util').puts; - -var buffer = [], - curSubject = null; - -function xmlEnc(value) { - return !value ? value : String(value).replace(/&/g, "&") - .replace(/>/g, ">") - .replace(/'; -} - -function cdata(data) { - return ''; -} - -this.name = 'xunit'; -this.report = function (data) { - var event = data[1]; - - switch (data[0]) { - case 'subject': - curSubject = event; - break; - case 'context': - break; - case 'vow': - switch (event.status) { - case 'honored': - buffer.push(tag('testcase', {classname: curSubject, name: event.context + ': ' + event.title}, true)); - break; - case 'broken': - var err = tag('error', {type: 'vows.event.broken', message: 'Broken test'}, false, cdata(event.exception)); - buffer.push(tag('testcase', {classname: curSubject, name: event.context + ': ' + event.title}, false, err)); - break; - case 'errored': - var skip = tag('skipped', {type: 'vows.event.errored', message: 'Errored test'}, false, cdata(event.exception)); - buffer.push(tag('testcase', {classname: curSubject, name: event.context + ': ' + event.title}, false, skip)); - break; - case 'pending': - // nop - break; - } - break; - case 'end': - buffer.push(end('testcase')); - break; - case 'finish': - buffer.unshift(tag('testsuite', {name: 'Vows test', tests: event.total, timestamp: (new Date()).toUTCString(), errors: event.errored, failures: event.broken, skip: event.pending, time: event.time})); - buffer.push(end('testsuite')); - puts(buffer.join('\n')); - break; - case 'error': - break; - } -}; - -this.print = function (str) { }; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/suite.js b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/suite.js deleted file mode 100644 index 6665ed300a..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/lib/vows/suite.js +++ /dev/null @@ -1,319 +0,0 @@ -var events = require('events'), - path = require('path'); - -var vows = require('../vows'); -var Context = require('../vows/context').Context; - -this.Suite = function (subject) { - this.subject = subject; - this.matcher = /.*/; - this.reporter = require('./reporters/dot-matrix'); - this.batches = []; - this.options = { error: true }; - this.reset(); -}; - -this.Suite.prototype = new(function () { - this.reset = function () { - this.results = { - honored: 0, - broken: 0, - errored: 0, - pending: 0, - total: 0, - time: null - }; - this.batches.forEach(function (b) { - b.lastContext = null; - b.remaining = b._remaining; - b.honored = b.broken = b.errored = b.total = b.pending = 0; - b.vows.forEach(function (vow) { vow.status = null }); - b.teardowns = []; - }); - }; - - this.addBatch = function (tests) { - this.batches.push({ - tests: tests, - suite: this, - vows: [], - remaining: 0, - _remaining: 0, - honored: 0, - broken: 0, - errored: 0, - pending: 0, - total: 0, - teardowns: [] - }); - return this; - }; - this.addVows = this.addBatch; - - this.parseBatch = function (batch, matcher) { - var tests = batch.tests; - - if ('topic' in tests) { - throw new(Error)("missing top-level context."); - } - // Count the number of vows/promises expected to fire, - // so we know when the tests are over. - // We match the keys against `matcher`, to decide - // whether or not they should be included in the test. - // Any key, including assertion function keys can be matched. - // If a child matches, then the n parent topics must not be skipped. - (function count(tests, _match) { - var match = false; - - var keys = Object.keys(tests).filter(function (k) { - return k !== 'topic' && k !== 'teardown'; - }); - - for (var i = 0, key; i < keys.length; i++) { - key = keys[i]; - - // If the parent node, or this one matches. - match = _match || matcher.test(key); - - if (typeof(tests[key]) === 'object') { - match = count(tests[key], match); - } else { - if (typeof(tests[key]) === 'string') { - tests[key] = new(String)(tests[key]); - } - if (! match) { - tests[key]._skip = true; - } - } - } - - // If any of the children matched, - // don't skip this node. - for (var i = 0; i < keys.length; i++) { - if (! tests[keys[i]]._skip) { match = true } - } - - if (match) { batch.remaining ++ } - else { tests._skip = true } - - return match; - })(tests, false); - - batch._remaining = batch.remaining; - }; - - this.runBatch = function (batch) { - var topic, - tests = batch.tests, - promise = batch.promise = new(events.EventEmitter); - - var that = this; - - batch.status = 'begin'; - - // The test runner, it calls itself recursively, passing the - // previous context to the inner contexts. This is so the `topic` - // functions have access to all the previous context topics in their - // arguments list. - // It is defined and invoked at the same time. - // If it encounters a `topic` function, it waits for the returned - // promise to emit (the topic), at which point it runs the functions under it, - // passing the topic as an argument. - (function run(ctx, lastTopic) { - var old = false; - topic = ctx.tests.topic; - - if (typeof(topic) === 'function') { - // Run the topic, passing the previous context topics - topic = topic.apply(ctx.env, ctx.topics); - - if (typeof(topic) === 'undefined') { ctx._callback = true } - } - - // If this context has a topic, store it in `lastTopic`, - // if not, use the last topic, passed down by a parent - // context. - if (typeof(topic) !== 'undefined' || ctx._callback) { - lastTopic = topic; - } else { - old = true; - topic = lastTopic; - } - - // If the topic doesn't return an event emitter (such as a promise), - // we create it ourselves, and emit the value on the next tick. - if (! (topic && topic.constructor === events.EventEmitter)) { - ctx.emitter = new(events.EventEmitter); - - if (! ctx._callback) { - process.nextTick(function (val) { - return function () { ctx.emitter.emit("success", val) }; - }(topic)); - } - topic = ctx.emitter; - } - - topic.on('success', function (val) { - // Once the topic fires, add the return value - // to the beginning of the topics list, so it - // becomes the first argument for the next topic. - // If we're using the parent topic, no need to - // prepend it to the topics list, or we'll get - // duplicates. - if (! old) Array.prototype.unshift.apply(ctx.topics, arguments); - }); - if (topic.setMaxListeners) { topic.setMaxListeners(Infinity) } - - // Now run the tests, or sub-contexts - Object.keys(ctx.tests).filter(function (k) { - return ctx.tests[k] && k !== 'topic' && - k !== 'teardown' && !ctx.tests[k]._skip; - }).forEach(function (item) { - // Create a new evaluation context, - // inheriting from the parent one. - var env = Object.create(ctx.env); - env.suite = that; - - // Holds the current test or context - var vow = Object.create({ - callback: ctx.tests[item], - context: ctx.title, - description: item, - binding: ctx.env, - status: null, - batch: batch - }); - - // If we encounter a function, add it to the callbacks - // of the `topic` function, so it'll get called once the - // topic fires. - // If we encounter an object literal, we recurse, sending it - // our current context. - if ((typeof(vow.callback) === 'function') || (vow.callback instanceof String)) { - topic.addVow(vow); - } else if (typeof(vow.callback) === 'object') { - // If there's a setup stage, we have to wait for it to fire, - // before calling the inner context. Else, just run the inner context - // synchronously. - if (topic) { - topic.on("success", function (ctx) { - return function (val) { - return run(new(Context)(vow, ctx, env), lastTopic); - }; - }(ctx)); - } else { - run(new(Context)(vow, ctx, env), lastTopic); - } - } - }); - // Teardown - if (ctx.tests.teardown) { - batch.teardowns.push(ctx); - } - if (! ctx.tests._skip) { - batch.remaining --; - } - // Check if we're done running the tests - exports.tryEnd(batch); - // This is our initial, empty context - })(new(Context)({ callback: tests, context: null, description: null }, {})); - return promise; - }; - - this.report = function () { - return this.reporter.report.apply(this.reporter, arguments); - }; - - this.run = function (options, callback) { - var that = this, start; - - options = options || {}; - - for (var k in options) { this.options[k] = options[k] } - - this.matcher = this.options.matcher || this.matcher; - this.reporter = this.options.reporter || this.reporter; - - this.batches.forEach(function (batch) { - that.parseBatch(batch, that.matcher); - }); - - this.reset(); - - start = new(Date); - - if (this.batches.filter(function (b) { return b.remaining > 0 }).length) { - this.report(['subject', this.subject]); - } - - return (function run(batches) { - var batch = batches.shift(); - - if (batch) { - // If the batch has no vows to run, - // go to the next one. - if (batch.remaining === 0) { - run(batches); - } else { - that.runBatch(batch).on('end', function () { - run(batches); - }); - } - } else { - that.results.time = (new(Date) - start) / 1000; - that.report(['finish', that.results]); - - if (callback) { callback(that.results) } - - if (that.results.honored + that.results.pending === that.results.total) { - return 0; - } else { - return 1; - } - } - })(this.batches.slice(0)); - }; - - this.runParallel = function () {}; - - this.export = function (module, options) { - for (var k in (options || {})) { this.options[k] = options[k] } - - if (require.main === module) { - return this.run(); - } else { - return module.exports[this.subject] = this; - } - }; - this.exportTo = function (module, options) { // Alias, for JSLint - return this.export(module, options); - }; -}); - -// -// Checks if all the tests in the batch have been run, -// and triggers the next batch (if any), by emitting the 'end' event. -// -this.tryEnd = function (batch) { - var result, style, time; - - if (batch.honored + batch.broken + batch.errored + batch.pending === batch.total && - batch.remaining === 0) { - - Object.keys(batch).forEach(function (k) { - (k in batch.suite.results) && (batch.suite.results[k] += batch[k]); - }); - - // Run teardowns - if (batch.teardowns) { - for (var i = batch.teardowns.length - 1, ctx; i >= 0; i--) { - ctx = batch.teardowns[i]; - ctx.tests.teardown.apply(ctx.env, ctx.topics); - } - } - - batch.status = 'end'; - batch.suite.report(['end']); - batch.promise.emit('end', batch.honored, batch.broken, batch.errored, batch.pending); - } -}; diff --git a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/package.json b/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/package.json deleted file mode 100644 index 9e7938c944..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/node_modules/vows/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "vows", - "description": "Asynchronous BDD & continuous integration for node.js", - "url": "http://vowsjs.org", - "keywords": [ - "testing", - "spec", - "test", - "BDD" - ], - "author": { - "name": "Alexis Sellier", - "email": "self@cloudhead.net" - }, - "contributors": [ - { - "name": "Charlie Robbins", - "email": "charlie.robbins@gmail.com" - } - ], - "dependencies": { - "eyes": ">=0.1.6" - }, - "main": "./lib/vows", - "bin": { - "vows": "./bin/vows" - }, - "directories": { - "test": "./test", - "bin": "./bin" - }, - "version": "0.5.13", - "scripts": { - "test": "./bin/vows --spec" - }, - "engines": { - "node": ">=0.2.6" - }, - "readme": "Vows\n====\n\n> Asynchronous BDD & continuous integration for node.js\n\n#### #\n\nintroduction\n------------\nThere are two reasons why we might want asynchronous testing. The first, and obvious reason is that node.js is asynchronous, and therefore our tests need to be. The second reason is to make test suites which target I/O libraries run much faster.\n\n_Vows_ is an experiment in making this possible, while adding a minimum of overhead.\n\nsynopsis\n--------\n\n var vows = require('vows'),\n assert = require('assert');\n\n vows.describe('Deep Thought').addBatch({\n 'An instance of DeepThought': {\n topic: new DeepThought,\n\n 'should know the answer to the ultimate question of life': function (deepThought) {\n assert.equal (deepThought.question('what is the answer to the universe?'), 42);\n }\n }\n });\n\ninstallation\n------------\n\n $ npm install vows\n\ndocumentation\n-------------\n\nHead over to \n\nauthors\n-------\n\nAlexis Sellier <>, Charlie Robbins,\n\n*...and many others*\n\n", - "readmeFilename": "README.md", - "_id": "vows@0.5.13", - "_shasum": "f6fd9ee9c36d3f20bd6680455cff8090c4b29cde", - "_from": "vows@0.5.x", - "_resolved": "https://registry.npmjs.org/vows/-/vows-0.5.13.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/portfinder/package.json b/templates/bin/node/http-server/node_modules/portfinder/package.json deleted file mode 100644 index ba21a54ffe..0000000000 --- a/templates/bin/node/http-server/node_modules/portfinder/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "portfinder", - "version": "0.2.1", - "description": "A simple tool to find an open port on the current machine", - "author": { - "name": "Charlie Robbins", - "email": "charlie.robbins@gmail.com" - }, - "repository": { - "type": "git", - "url": "git@github.com:indexzero/node-portfinder.git" - }, - "keywords": [ - "http", - "ports", - "utilities" - ], - "dependencies": { - "mkdirp": "0.0.x" - }, - "devDependencies": { - "async": "0.1.x", - "vows": "0.5.x" - }, - "main": "./lib/portfinder", - "scripts": { - "test": "vows test/*-test.js --spec" - }, - "engines": { - "node": ">= 0.4.0" - }, - "readme": "# node-portfinder\n\n## Installation\n\n### Installing npm (node package manager)\n``` bash\n curl http://npmjs.org/install.sh | sh\n```\n\n### Installing node-portfinder\n``` bash\n $ [sudo] npm install portfinder\n```\n\n## Usage\nThe `portfinder` module has a simple interface:\n\n``` js\n var portfinder = require('portfinder');\n \n portfinder.getPort(function (err, port) {\n //\n // `port` is guarenteed to be a free port \n // in this scope.\n //\n });\n```\n\nBy default `portfinder` will start searching from `8000`. To change this simply set `portfinder.basePort`.\n\n## Run Tests\n``` bash\n $ npm test\n```\n\n#### Author: [Charlie Robbins][0]\n[0]: http://nodejitsu.com", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/indexzero/node-portfinder/issues" - }, - "homepage": "https://github.com/indexzero/node-portfinder", - "_id": "portfinder@0.2.1", - "_shasum": "b2b9b0164f9e17fa3a9c7db2304d0a75140c71ad", - "_from": "portfinder@0.2.x", - "_resolved": "https://registry.npmjs.org/portfinder/-/portfinder-0.2.1.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/union/.npmignore b/templates/bin/node/http-server/node_modules/union/.npmignore deleted file mode 100644 index cb6fcfeb6a..0000000000 --- a/templates/bin/node/http-server/node_modules/union/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -npm-debug.log -test/fixtures/*-test.txt -examples/*.txt -examples/simple/*.txt -.DS_Store - diff --git a/templates/bin/node/http-server/node_modules/union/.travis.yml b/templates/bin/node/http-server/node_modules/union/.travis.yml deleted file mode 100644 index 4d5be77f83..0000000000 --- a/templates/bin/node/http-server/node_modules/union/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.7 - -notifications: - email: - - travis@nodejitsu.com - irc: "irc.freenode.org#nodejitsu" - diff --git a/templates/bin/node/http-server/node_modules/union/LICENSE b/templates/bin/node/http-server/node_modules/union/LICENSE deleted file mode 100644 index 1f01e2b36c..0000000000 --- a/templates/bin/node/http-server/node_modules/union/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Nodejitsu Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/union/lib/buffered-stream.js b/templates/bin/node/http-server/node_modules/union/lib/buffered-stream.js deleted file mode 100644 index 0ae29ebb32..0000000000 --- a/templates/bin/node/http-server/node_modules/union/lib/buffered-stream.js +++ /dev/null @@ -1,141 +0,0 @@ -/* - * buffered-stream.js: A simple(r) Stream which is partially buffered into memory. - * - * (C) 2010, Mikeal Rogers - * - * Adapted for Flatiron - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var events = require('events'), - fs = require('fs'), - stream = require('stream'), - util = require('util'); - -// -// ### function BufferedStream (limit) -// #### @limit {number} **Optional** Size of the buffer to limit -// Constructor function for the BufferedStream object responsible for -// maintaining a stream interface which can also persist to memory -// temporarily. -// - -var BufferedStream = module.exports = function (limit) { - events.EventEmitter.call(this); - - if (typeof limit === 'undefined') { - limit = Infinity; - } - - this.limit = limit; - this.size = 0; - this.chunks = []; - this.writable = true; - this.readable = true; - this._buffer = true; -}; - -util.inherits(BufferedStream, stream.Stream); - -Object.defineProperty(BufferedStream.prototype, 'buffer', { - get: function () { - return this._buffer; - }, - set: function (value) { - if (!value && this.chunks) { - var self = this; - this.chunks.forEach(function (c) { self.emit('data', c) }); - if (this.ended) this.emit('end'); - this.size = 0; - delete this.chunks; - } - - this._buffer = value; - } -}); - -BufferedStream.prototype.pipe = function () { - var self = this, - dest; - - if (self.resume) { - self.resume(); - } - - dest = stream.Stream.prototype.pipe.apply(self, arguments); - - // - // just incase you are piping to two streams, do not emit data twice. - // note: you can pipe twice, but you need to pipe both streams in the same tick. - // (this is normal for streams) - // - if (this.piped) { - return dest; - } - - process.nextTick(function () { - if (self.chunks) { - self.chunks.forEach(function (c) { self.emit('data', c) }); - self.size = 0; - delete self.chunks; - } - - if (!self.readable) { - if (self.ended) { - self.emit('end'); - } - else if (self.closed) { - self.emit('close'); - } - } - }); - - this.piped = true; - - return dest; -}; - -BufferedStream.prototype.write = function (chunk) { - if (!this.chunks || this.piped) { - this.emit('data', chunk); - return; - } - - this.chunks.push(chunk); - this.size += chunk.length; - if (this.limit < this.size) { - this.pause(); - } -}; - -BufferedStream.prototype.end = function () { - this.readable = false; - this.ended = true; - this.emit('end'); -}; - -BufferedStream.prototype.destroy = function () { - this.readable = false; - this.writable = false; - delete this.chunks; -}; - -BufferedStream.prototype.close = function () { - this.readable = false; - this.closed = true; -}; - -if (!stream.Stream.prototype.pause) { - BufferedStream.prototype.pause = function () { - this.emit('pause'); - }; -} - -if (!stream.Stream.prototype.resume) { - BufferedStream.prototype.resume = function () { - this.emit('resume'); - }; -} - diff --git a/templates/bin/node/http-server/node_modules/union/lib/core.js b/templates/bin/node/http-server/node_modules/union/lib/core.js deleted file mode 100644 index d227609003..0000000000 --- a/templates/bin/node/http-server/node_modules/union/lib/core.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * core.js: Core functionality for the Flatiron HTTP (with SPDY support) plugin. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var http = require('http'), - https = require('https'), - fs = require('fs'), - stream = require('stream'), - HttpStream = require('./http-stream'), - RoutingStream = require('./routing-stream'); - -var core = exports; - -core.createServer = function (options) { - var isArray = Array.isArray(options.after), - credentials; - - if (!options) { - throw new Error('options is required to create a server'); - } - - function requestHandler(req, res) { - var routingStream = new RoutingStream({ - before: options.before, - buffer: options.buffer, - // - // Remark: without new after is a huge memory leak that - // pipes to every single open connection - // - after: isArray && options.after.map(function (After) { - return new After; - }), - request: req, - response: res, - limit: options.limit, - headers: options.headers - }); - - routingStream.on('error', function (err) { - var fn = options.onError || core.errorHandler; - fn(err, routingStream, routingStream.target, function () { - routingStream.target.emit('next'); - }); - }); - - req.pipe(routingStream); - } - - // - // both https and spdy requires same params - // - if (options.https || options.spdy) { - if (options.https && options.spdy) { - throw new Error('You shouldn\'t be using https and spdy simultaneously.'); - } - - var serverOptions, - credentials, - key = !options.spdy - ? 'https' - : 'spdy'; - - serverOptions = options[key]; - if (!serverOptions.key || !serverOptions.cert) { - throw new Error('Both options.' + key + '.`key` and options.' + key + '.`cert` are required.'); - } - - credentials = { - key: fs.readFileSync(serverOptions.key), - cert: fs.readFileSync(serverOptions.cert) - }; - - if (serverOptions.ca) { - serverOptions.ca = !Array.isArray(serverOptions.ca) - ? [serverOptions.ca] - : serverOptions.ca - - credentials.ca = serverOptions.ca.map(function (ca) { - return fs.readFileSync(ca); - }); - } - - if (options.spdy) { - // spdy is optional so we require module here rather than on top - var spdy = require('spdy'); - return spdy.createServer(credentials, requestHandler); - } - - return https.createServer(credentials, requestHandler); - } - - return http.createServer(requestHandler); -}; - -core.errorHandler = function error(err, req, res) { - if (err) { - (this.res || res).writeHead(err.status || 500, err.headers || { "Content-Type": "text/plain" }); - (this.res || res).end(err.message + "\n"); - return; - } - - (this.res || res).writeHead(404, {"Content-Type": "text/plain"}); - (this.res || res).end("Not Found\n"); -}; diff --git a/templates/bin/node/http-server/node_modules/union/lib/http-stream.js b/templates/bin/node/http-server/node_modules/union/lib/http-stream.js deleted file mode 100644 index bef65bfd63..0000000000 --- a/templates/bin/node/http-server/node_modules/union/lib/http-stream.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * http-stream.js: Idomatic buffered stream which pipes additional HTTP information. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var url = require('url'), - util = require('util'), - qs = require('qs'), - BufferedStream = require('./buffered-stream'); - -var HttpStream = module.exports = function (options) { - options = options || {}; - BufferedStream.call(this, options.limit); - - if (options.buffer === false) { - this.buffer = false; - } - - this.on('pipe', this.pipeState); -}; - -util.inherits(HttpStream, BufferedStream); - -// -// ### function pipeState (source) -// #### @source {ServerRequest|HttpStream} Source stream piping to this instance -// Pipes additional HTTP metadata from the `source` HTTP stream (either concrete or -// abstract) to this instance. e.g. url, headers, query, etc. -// -// Remark: Is there anything else we wish to pipe? -// -HttpStream.prototype.pipeState = function (source) { - this.headers = source.headers; - this.trailers = source.trailers; - this.method = source.method; - - if (source.url) { - this.url = this.originalUrl = source.url; - } - - if (source.query) { - this.query = source.query; - } - else if (source.url) { - this.query = ~source.url.indexOf('?') - ? qs.parse(url.parse(source.url).query) - : {}; - } -}; diff --git a/templates/bin/node/http-server/node_modules/union/lib/index.js b/templates/bin/node/http-server/node_modules/union/lib/index.js deleted file mode 100644 index 02091c18a2..0000000000 --- a/templates/bin/node/http-server/node_modules/union/lib/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * index.js: Top-level plugin exposing HTTP features in flatiron - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var union = exports; - -// -// Expose version information through `pkginfo` -// -require('pkginfo')(module, 'version'); - -// -// Expose core union components -// -union.BufferedStream = require('./buffered-stream'); -union.HttpStream = require('./http-stream'); -union.ResponseStream = require('./response-stream'); -union.RoutingStream = require('./routing-stream'); -union.createServer = require('./core').createServer; -union.errorHandler = require('./core').errorHandler; \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/union/lib/request-stream.js b/templates/bin/node/http-server/node_modules/union/lib/request-stream.js deleted file mode 100644 index 9837fa23d1..0000000000 --- a/templates/bin/node/http-server/node_modules/union/lib/request-stream.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * http-stream.js: Idomatic buffered stream which pipes additional HTTP information. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var url = require('url'), - util = require('util'), - qs = require('qs'), - HttpStream = require('./http-stream'); - -var RequestStream = module.exports = function (options) { - options = options || {}; - HttpStream.call(this, options); - - this.on('pipe', this.pipeRequest); - this.request = options.request; -}; - -util.inherits(RequestStream, HttpStream); - -// -// ### function pipeRequest (source) -// #### @source {ServerRequest|HttpStream} Source stream piping to this instance -// Pipes additional HTTP request metadata from the `source` HTTP stream (either concrete or -// abstract) to this instance. e.g. url, headers, query, etc. -// -// Remark: Is there anything else we wish to pipe? -// -RequestStream.prototype.pipeRequest = function (source) { - this.url = this.originalUrl = source.url; - this.method = source.method; - this.httpVersion = source.httpVersion; - this.httpVersionMajor = source.httpVersionMajor; - this.httpVersionMinor = source.httpVersionMinor; - this.setEncoding = source.setEncoding; - this.connection = source.connection; - this.socket = source.socket; - - if (source.query) { - this.query = source.query; - } - else { - this.query = ~source.url.indexOf('?') - ? qs.parse(url.parse(source.url).query) - : {}; - } -}; - -// http.serverRequest methods -['setEncoding'].forEach(function (method) { - RequestStream.prototype[method] = function () { - return this.request[method].apply(this.request, arguments); - }; -}); - diff --git a/templates/bin/node/http-server/node_modules/union/lib/response-stream.js b/templates/bin/node/http-server/node_modules/union/lib/response-stream.js deleted file mode 100644 index b0a9edc644..0000000000 --- a/templates/bin/node/http-server/node_modules/union/lib/response-stream.js +++ /dev/null @@ -1,177 +0,0 @@ -/* - * response-stream.js: A Stream focused on writing any relevant information to - * a raw http.ServerResponse object. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var util = require('util'), - HttpStream = require('./http-stream'); - -// -// ### function ResponseStream (options) -// -// -var ResponseStream = module.exports = function (options) { - var self = this, - key; - - options = options || {}; - HttpStream.call(this, options); - - this.writeable = true; - this.response = options.response; - - if (options.headers) { - for (key in options.headers) { - this.response.setHeader(key, options.headers[key]); - } - } - - // - // Proxy `statusCode` changes to the actual `response.statusCode`. - // - Object.defineProperty(this, 'statusCode', { - get: function () { - return self.response.statusCode; - }, - set: function (value) { - self.response.statusCode = value; - }, - enumerable: true, - configurable: true - }); - - if (this.response) { - this._headers = this.response._headers = this.response._headers || {}; - - // Patch to node core - this.response._headerNames = this.response._headerNames || {}; - - // - // Proxy to emit "header" event - // - this._renderHeaders = this.response._renderHeaders; - this.response._renderHeaders = function () { - if (!self._emittedHeader) { - self._emittedHeader = true; - self.headerSent = true; - self.emit('header'); - } - return self._renderHeaders.call(self.response); - }; - } -}; - -util.inherits(ResponseStream, HttpStream); - -ResponseStream.prototype.writeHead = function (statusCode, headers) { - if (headers) { - for (var key in headers) { - this.response.setHeader(key, headers[key]); - } - } - - this.response.statusCode = statusCode; -}; - -// -// Create pass-thru for the necessary -// `http.ServerResponse` methods. -// -['setHeader', 'getHeader', 'removeHeader', '_implicitHeader', 'addTrailers'].forEach(function (method) { - ResponseStream.prototype[method] = function () { - return this.response[method].apply(this.response, arguments); - }; -}); - -ResponseStream.prototype.json = function (obj) { - if (!this.response.writable) { - return; - } - - if (typeof obj === 'number') { - this.response.statusCode = obj; - obj = arguments[1]; - } - - this.modified = true; - - if (!this.response._header && this.response.getHeader('content-type') !== 'application/json') { - this.response.setHeader('content-type', 'application/json'); - } - - this.end(obj ? JSON.stringify(obj) : ''); -}; - -ResponseStream.prototype.html = function (str) { - if (!this.response.writable) { - return; - } - - if (typeof str === 'number') { - this.response.statusCode = str; - str = arguments[1]; - } - - this.modified = true; - - if (!this.response._header && this.response.getHeader('content-type') !== 'text/html') { - this.response.setHeader('content-type', 'text/html'); - } - - this.end(str ? str: ''); -}; - -ResponseStream.prototype.text = function (str) { - if (!this.response.writable) { - return; - } - - if (typeof str === 'number') { - this.response.statusCode = str; - str = arguments[1]; - } - - this.modified = true; - - if (!this.response._header && this.response.getHeader('content-type') !== 'text/plain') { - this.response.setHeader('content-type', 'text/plain'); - } - - this.end(str ? str: ''); -}; - -ResponseStream.prototype.end = function (data) { - if (data && this.writable) { - this.emit('data', data); - } - - this.modified = true; - this.emit('end'); -}; - -ResponseStream.prototype.write = function (data) { - this.modified = true; - - if (this.writable) { - this.emit('data', data); - } -}; - -ResponseStream.prototype.redirect = function (path, status) { - var url = ''; - - if (~path.indexOf('://')) { - url = path; - } else { - url += this.req.connection.encrypted ? 'https://' : 'http://'; - url += this.req.headers.host; - url += (path[0] === '/') ? path : '/' + path; - } - - this.res.writeHead(status || 302, { 'Location': url }); - this.end(); -}; diff --git a/templates/bin/node/http-server/node_modules/union/lib/routing-stream.js b/templates/bin/node/http-server/node_modules/union/lib/routing-stream.js deleted file mode 100644 index 23836d8bbc..0000000000 --- a/templates/bin/node/http-server/node_modules/union/lib/routing-stream.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - * routing-stream.js: A Stream focused on connecting an arbitrary RequestStream and - * ResponseStream through a given Router. - * - * (C) 2011, Nodejitsu Inc. - * MIT LICENSE - * - */ - -var util = require('util'), - union = require('./index'), - RequestStream = require('./request-stream'), - ResponseStream = require('./response-stream'); - -// -// ### function RoutingStream (options) -// -// -var RoutingStream = module.exports = function (options) { - options = options || {}; - RequestStream.call(this, options); - - this.before = options.before || []; - this.after = options.after || []; - this.response = options.response || options.res; - this.headers = options.headers || { - 'x-powered-by': 'union ' + union.version - }; - - this.target = new ResponseStream({ - response: this.response, - headers: this.headers - }); - - this.once('pipe', this.route); -}; - -util.inherits(RoutingStream, RequestStream); - -// -// Called when this instance is piped to **by another stream** -// -RoutingStream.prototype.route = function (req) { - // - // When a `RoutingStream` is piped to: - // - // 1. Setup the pipe-chain between the `after` middleware, the abstract response - // and the concrete response. - // 2. Attempt to dispatch to the `before` middleware, which represent things such as - // favicon, static files, application routing. - // 3. If no match is found then pipe to the 404Stream - // - var self = this, - after, - error, - i; - - // - // Don't allow `this.target` to be writable on HEAD requests - // - this.target.writable = req.method !== 'HEAD'; - - // - // 1. Setup the pipe-chain between the `after` middleware, the abstract response - // and the concrete response. - // - after = [this.target].concat(this.after, this.response); - for (i = 0; i < after.length - 1; i++) { - // - // attach req and res to all streams - // - after[i].req = req; - after[i + 1].req = req; - after[i].res = this.response; - after[i + 1].res = this.response; - after[i].pipe(after[i + 1]); - - // - // prevent multiple responses and memory leaks - // - after[i].on('error', this.onError); - } - - // - // Helper function for dispatching to the 404 stream. - // - function notFound() { - error = new Error('Not found'); - error.status = 404; - self.onError(error); - } - - // - // 2. Attempt to dispatch to the `before` middleware, which represent things such as - // favicon, static files, application routing. - // - (function dispatch(i) { - if (self.target.modified) { - return; - } - else if (++i === self.before.length) { - // - // 3. If no match is found then pipe to the 404Stream - // - return notFound(); - } - - self.target.once('next', dispatch.bind(null, i)); - if (self.before[i].length === 3) { - self.before[i](self, self.target, function (err) { - if (err) { - self.onError(err); - } else { - self.target.emit('next'); - } - }); - } - else { - self.before[i](self, self.target); - } - })(-1); -}; - -RoutingStream.prototype.onError = function (err) { - this.emit('error', err); -}; diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/pkginfo/.gitignore b/templates/bin/node/http-server/node_modules/union/node_modules/pkginfo/.gitignore deleted file mode 100644 index 9303c347ee..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/pkginfo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/pkginfo/lib/pkginfo.js b/templates/bin/node/http-server/node_modules/union/node_modules/pkginfo/lib/pkginfo.js deleted file mode 100644 index a4a6227205..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/pkginfo/lib/pkginfo.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * pkginfo.js: Top-level include for the pkginfo module - * - * (C) 2011, Charlie Robbins - * - */ - -var fs = require('fs'), - path = require('path'); - -// -// ### function pkginfo ([options, 'property', 'property' ..]) -// #### @pmodule {Module} Parent module to read from. -// #### @options {Object|Array|string} **Optional** Options used when exposing properties. -// #### @arguments {string...} **Optional** Specified properties to expose. -// Exposes properties from the package.json file for the parent module on -// it's exports. Valid usage: -// -// `require('pkginfo')()` -// -// `require('pkginfo')('version', 'author');` -// -// `require('pkginfo')(['version', 'author']);` -// -// `require('pkginfo')({ include: ['version', 'author'] });` -// -var pkginfo = module.exports = function (pmodule, options) { - var args = [].slice.call(arguments, 2).filter(function (arg) { - return typeof arg === 'string'; - }); - - // - // **Parse variable arguments** - // - if (Array.isArray(options)) { - // - // If the options passed in is an Array assume that - // it is the Array of properties to expose from the - // on the package.json file on the parent module. - // - options = { include: options }; - } - else if (typeof options === 'string') { - // - // Otherwise if the first argument is a string, then - // assume that it is the first property to expose from - // the package.json file on the parent module. - // - options = { include: [options] }; - } - - // - // **Setup default options** - // - options = options || { include: [] }; - - if (args.length > 0) { - // - // If additional string arguments have been passed in - // then add them to the properties to expose on the - // parent module. - // - options.include = options.include.concat(args); - } - - var pkg = pkginfo.read(pmodule, options.dir).package; - Object.keys(pkg).forEach(function (key) { - if (options.include.length > 0 && !~options.include.indexOf(key)) { - return; - } - - if (!pmodule.exports[key]) { - pmodule.exports[key] = pkg[key]; - } - }); - - return pkginfo; -}; - -// -// ### function find (dir) -// #### @pmodule {Module} Parent module to read from. -// #### @dir {string} **Optional** Directory to start search from. -// Searches up the directory tree from `dir` until it finds a directory -// which contains a `package.json` file. -// -pkginfo.find = function (pmodule, dir) { - dir = dir || pmodule.filename; - dir = path.dirname(dir); - - var files = fs.readdirSync(dir); - - if (~files.indexOf('package.json')) { - return path.join(dir, 'package.json'); - } - - if (dir === '/') { - throw new Error('Could not find package.json up from: ' + dir); - } - else if (!dir || dir === '.') { - throw new Error('Cannot find package.json from unspecified directory'); - } - - return pkginfo.find(pmodule, dir); -}; - -// -// ### function read (pmodule, dir) -// #### @pmodule {Module} Parent module to read from. -// #### @dir {string} **Optional** Directory to start search from. -// Searches up the directory tree from `dir` until it finds a directory -// which contains a `package.json` file and returns the package information. -// -pkginfo.read = function (pmodule, dir) { - dir = pkginfo.find(pmodule, dir); - - var data = fs.readFileSync(dir).toString(); - - return { - dir: dir, - package: JSON.parse(data) - }; -}; - -// -// Call `pkginfo` on this module and expose version. -// -pkginfo(module, { - dir: __dirname, - include: ['version'], - target: pkginfo -}); \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/pkginfo/package.json b/templates/bin/node/http-server/node_modules/union/node_modules/pkginfo/package.json deleted file mode 100644 index 70c43aa45f..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/pkginfo/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "pkginfo", - "version": "0.2.3", - "description": "An easy way to expose properties on a module from a package.json", - "author": { - "name": "Charlie Robbins", - "email": "charlie.robbins@gmail.com" - }, - "repository": { - "type": "git", - "url": "http://github.com/indexzero/node-pkginfo.git" - }, - "keywords": [ - "info", - "tools", - "package.json" - ], - "devDependencies": { - "vows": "0.6.x" - }, - "main": "./lib/pkginfo", - "scripts": { - "test": "vows test/*-test.js --spec" - }, - "engines": { - "node": ">= 0.4.0" - }, - "readme": "# node-pkginfo\n\nAn easy way to expose properties on a module from a package.json\n\n## Installation\n\n### Installing npm (node package manager)\n```\n curl http://npmjs.org/install.sh | sh\n```\n\n### Installing pkginfo\n```\n [sudo] npm install pkginfo\n```\n\n## Motivation\nHow often when writing node.js modules have you written the following line(s) of code? \n\n* Hard code your version string into your code\n\n``` js\n exports.version = '0.1.0';\n```\n\n* Programmatically expose the version from the package.json\n\n``` js\n exports.version = JSON.parse(fs.readFileSync('/path/to/package.json', 'utf8')).version;\n```\n\nIn other words, how often have you wanted to expose basic information from your package.json onto your module programmatically? **WELL NOW YOU CAN!**\n\n## Usage\n\nUsing `pkginfo` is idiot-proof, just require and invoke it. \n\n``` js\n var pkginfo = require('pkginfo')(module);\n \n console.dir(module.exports);\n```\n\nBy invoking the `pkginfo` module all of the properties in your `package.json` file will be automatically exposed on the callee module (i.e. the parent module of `pkginfo`). \n\nHere's a sample of the output:\n\n```\n { name: 'simple-app',\n description: 'A test fixture for pkginfo',\n version: '0.1.0',\n author: 'Charlie Robbins ',\n keywords: [ 'test', 'fixture' ],\n main: './index.js',\n scripts: { test: 'vows test/*-test.js --spec' },\n engines: { node: '>= 0.4.0' } }\n```\n\n### Expose specific properties\nIf you don't want to expose **all** properties on from your `package.json` on your module then simple pass those properties to the `pkginfo` function:\n\n``` js\n var pkginfo = require('pkginfo')(module, 'version', 'author');\n \n console.dir(module.exports);\n```\n\n```\n { version: '0.1.0',\n author: 'Charlie Robbins ' }\n```\n\nIf you're looking for further usage see the [examples][0] included in this repository. \n\n## Run Tests\nTests are written in [vows][1] and give complete coverage of all APIs.\n\n```\n vows test/*-test.js --spec\n```\n\n[0]: https://github.com/indexzero/node-pkginfo/tree/master/examples\n[1]: http://vowsjs.org\n\n#### Author: [Charlie Robbins](http://nodejitsu.com)", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/indexzero/node-pkginfo/issues" - }, - "homepage": "https://github.com/indexzero/node-pkginfo", - "_id": "pkginfo@0.2.3", - "_shasum": "7239c42a5ef6c30b8f328439d9b9ff71042490f8", - "_from": "pkginfo@0.2.x", - "_resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/qs/.gitmodules b/templates/bin/node/http-server/node_modules/union/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31dac7d..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "support/expresso"] - path = support/expresso - url = git://github.com/visionmedia/expresso.git -[submodule "support/should"] - path = support/should - url = git://github.com/visionmedia/should.js.git diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/qs/.npmignore b/templates/bin/node/http-server/node_modules/union/node_modules/qs/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/qs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/qs/.travis.yml b/templates/bin/node/http-server/node_modules/union/node_modules/qs/.travis.yml deleted file mode 100644 index 2c0a8f63f4..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/qs/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.4 \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/qs/Makefile b/templates/bin/node/http-server/node_modules/union/node_modules/qs/Makefile deleted file mode 100644 index 84a78ec18b..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/qs/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --ui bdd - -.PHONY: test \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/qs/benchmark.js b/templates/bin/node/http-server/node_modules/union/node_modules/qs/benchmark.js deleted file mode 100644 index 97e2c93ed0..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/qs/benchmark.js +++ /dev/null @@ -1,17 +0,0 @@ - -var qs = require('./'); - -var times = 100000 - , start = new Date - , n = times; - -console.log('times: %d', times); - -while (n--) qs.parse('foo=bar'); -console.log('simple: %dms', new Date - start); - -var start = new Date - , n = times; - -while (n--) qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); -console.log('nested: %dms', new Date - start); \ No newline at end of file diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/qs/component.json b/templates/bin/node/http-server/node_modules/union/node_modules/qs/component.json deleted file mode 100644 index 0a46c2d4ec..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/qs/component.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "querystring", - "repo": "visionmedia/node-querystring", - "description": "query-string parser / stringifier with nesting support", - "version": "0.5.6", - "keywords": ["querystring", "query", "parser"], - "scripts": ["index.js"], - "license": "MIT" -} diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/qs/examples.js b/templates/bin/node/http-server/node_modules/union/node_modules/qs/examples.js deleted file mode 100644 index ebe3a97a4c..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/qs/examples.js +++ /dev/null @@ -1,51 +0,0 @@ - -/** - * Module dependencies. - */ - -var qs = require('./'); - -var obj = qs.parse('foo'); -console.log(obj) - -var obj = qs.parse('foo=bar=baz'); -console.log(obj) - -var obj = qs.parse('users[]'); -console.log(obj) - -var obj = qs.parse('name=tj&email=tj@vision-media.ca'); -console.log(obj) - -var obj = qs.parse('users[]=tj&users[]=tobi&users[]=jane'); -console.log(obj) - -var obj = qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); -console.log(obj) - -var obj = qs.parse('users[][name][first]=tj&users[][name][last]=holowaychuk'); -console.log(obj) - -var obj = qs.parse('a=a&a=b&a=c'); -console.log(obj) - -var obj = qs.parse('user[tj]=tj&user[tj]=TJ'); -console.log(obj) - -var obj = qs.parse('user[names]=tj&user[names]=TJ&user[names]=Tyler'); -console.log(obj) - -var obj = qs.parse('user[name][first]=tj&user[name][first]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[1]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[foo]=TJ'); -console.log(obj) - -var str = qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}); -console.log(str); diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/qs/index.js b/templates/bin/node/http-server/node_modules/union/node_modules/qs/index.js deleted file mode 100644 index 8b27b2387b..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/qs/index.js +++ /dev/null @@ -1,268 +0,0 @@ - -/** - * Object#toString() ref for stringify(). - */ - -var toString = Object.prototype.toString; - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = {}; - var t = {}; - for (var i in parent[key]) t[i] = parent[key][i]; - parent[key] = t; - return t; -} - -function parse(parts, parent, key, val) { - var part = parts.shift(); - // end - if (!part) { - if (Array.isArray(parent[key])) { - parent[key].push(val); - } else if ('object' == typeof parent[key]) { - parent[key] = val; - } else if ('undefined' == typeof parent[key]) { - parent[key] = val; - } else { - parent[key] = [parent[key], val]; - } - // array - } else { - var obj = parent[key] = parent[key] || []; - if (']' == part) { - if (Array.isArray(obj)) { - if ('' != val) obj.push(val); - } else if ('object' == typeof obj) { - obj[Object.keys(obj).length] = val; - } else { - obj = parent[key] = [parent[key], val]; - } - // prop - } else if (~part.indexOf(']')) { - part = part.substr(0, part.length - 1); - if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - // key - } else { - if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - } - } -} - -/** - * Merge parent key/val pair. - */ - -function merge(parent, key, val){ - if (~key.indexOf(']')) { - var parts = key.split('[') - , len = parts.length - , last = len - 1; - parse(parts, parent, 'base', val); - // optimize - } else { - if (!isint.test(key) && Array.isArray(parent.base)) { - var t = {}; - for (var k in parent.base) t[k] = parent.base[k]; - parent.base = t; - } - set(parent.base, key, val); - } - - return parent; -} - -/** - * Parse the given obj. - */ - -function parseObject(obj){ - var ret = { base: {} }; - Object.keys(obj).forEach(function(name){ - merge(ret, name, obj[name]); - }); - return ret.base; -} - -/** - * Parse the given str. - */ - -function parseString(str){ - return String(str) - .split('&') - .reduce(function(ret, pair){ - var eql = pair.indexOf('=') - , brace = lastBraceInKey(pair) - , key = pair.substr(0, brace || eql) - , val = pair.substr(brace || eql, pair.length) - , val = val.substr(val.indexOf('=') + 1, val.length); - - // ?foo - if ('' == key) key = pair, val = ''; - if ('' == key) return ret; - - return merge(ret, decode(key), decode(val)); - }, { base: {} }).base; -} - -/** - * Parse the given query `str` or `obj`, returning an object. - * - * @param {String} str | {Object} obj - * @return {Object} - * @api public - */ - -exports.parse = function(str){ - if (null == str || '' == str) return {}; - return 'object' == typeof str - ? parseObject(str) - : parseString(str); -}; - -/** - * Turn the given `obj` into a query string - * - * @param {Object} obj - * @return {String} - * @api public - */ - -var stringify = exports.stringify = function(obj, prefix) { - if (Array.isArray(obj)) { - return stringifyArray(obj, prefix); - } else if ('[object Object]' == toString.call(obj)) { - return stringifyObject(obj, prefix); - } else if ('string' == typeof obj) { - return stringifyString(obj, prefix); - } else { - return prefix + '=' + encodeURIComponent(String(obj)); - } -}; - -/** - * Stringify the given `str`. - * - * @param {String} str - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyString(str, prefix) { - if (!prefix) throw new TypeError('stringify expects an object'); - return prefix + '=' + encodeURIComponent(str); -} - -/** - * Stringify the given `arr`. - * - * @param {Array} arr - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyArray(arr, prefix) { - var ret = []; - if (!prefix) throw new TypeError('stringify expects an object'); - for (var i = 0; i < arr.length; i++) { - ret.push(stringify(arr[i], prefix + '[' + i + ']')); - } - return ret.join('&'); -} - -/** - * Stringify the given `obj`. - * - * @param {Object} obj - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyObject(obj, prefix) { - var ret = [] - , keys = Object.keys(obj) - , key; - - for (var i = 0, len = keys.length; i < len; ++i) { - key = keys[i]; - if ('' == key) continue; - if (null == obj[key]) { - ret.push(encodeURIComponent(key) + '='); - } else { - ret.push(stringify(obj[key], prefix - ? prefix + '[' + encodeURIComponent(key) + ']' - : encodeURIComponent(key))); - } - } - - return ret.join('&'); -} - -/** - * Set `obj`'s `key` to `val` respecting - * the weird and wonderful syntax of a qs, - * where "foo=bar&foo=baz" becomes an array. - * - * @param {Object} obj - * @param {String} key - * @param {String} val - * @api private - */ - -function set(obj, key, val) { - var v = obj[key]; - if (undefined === v) { - obj[key] = val; - } else if (Array.isArray(v)) { - v.push(val); - } else { - obj[key] = [v, val]; - } -} - -/** - * Locate last brace in `str` within the key. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function lastBraceInKey(str) { - var len = str.length - , brace - , c; - for (var i = 0; i < len; ++i) { - c = str[i]; - if (']' == c) brace = false; - if ('[' == c) brace = true; - if ('=' == c && !brace) return i; - } -} - -/** - * Decode `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -function decode(str) { - try { - return decodeURIComponent(str.replace(/\+/g, ' ')); - } catch (err) { - return str; - } -} diff --git a/templates/bin/node/http-server/node_modules/union/node_modules/qs/package.json b/templates/bin/node/http-server/node_modules/union/node_modules/qs/package.json deleted file mode 100644 index 551c15dbf7..0000000000 --- a/templates/bin/node/http-server/node_modules/union/node_modules/qs/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.5.6", - "keywords": [ - "query string", - "parser", - "component" - ], - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-querystring.git" - }, - "devDependencies": { - "mocha": "*", - "expect.js": "*" - }, - "component": { - "scripts": { - "querystring": "querystring.js" - } - }, - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "main": "index", - "engines": { - "node": "*" - }, - "readme": "# node-querystring\n\n 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.\n\n## Installation\n\n $ npm install qs\n\n## Examples\n\n```js\nvar qs = require('qs');\n\nqs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');\n// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }\n\nqs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})\n// => user[name]=Tobi&user[email]=tobi%40learnboost.com\n```\n\n## Testing\n\nInstall dev dependencies:\n\n $ npm install -d\n\nand execute:\n\n $ make test\n\nbrowser:\n\n $ open test/browser/index.html\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 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.", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/node-querystring/issues" - }, - "homepage": "https://github.com/visionmedia/node-querystring", - "_id": "qs@0.5.6", - "_shasum": "31b1ad058567651c526921506b9a8793911a0384", - "_from": "qs@0.5.x", - "_resolved": "https://registry.npmjs.org/qs/-/qs-0.5.6.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/union/package.json b/templates/bin/node/http-server/node_modules/union/package.json deleted file mode 100644 index aebb166a9c..0000000000 --- a/templates/bin/node/http-server/node_modules/union/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "union", - "description": "A hybrid buffered / streaming middleware kernel backwards compatible with connect.", - "version": "0.3.8", - "author": { - "name": "Nodejitsu Inc.", - "email": "info@nodejitsu.com" - }, - "maintainers": [ - { - "name": "indexzero", - "email": "charlie@nodejitsu.com" - }, - { - "name": "dscape", - "email": "nuno@nodejitsu.com" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/flatiron/union.git" - }, - "dependencies": { - "pkginfo": "0.2.x", - "qs": "0.5.x" - }, - "devDependencies": { - "ecstatic": "git://github.com/jesusabdullah/node-ecstatic.git", - "director": "1.x.x", - "request": "2.x.x", - "vows": "0.7.x", - "connect": "2.3.x" - }, - "scripts": { - "test": "vows test/*-test.js --spec -i" - }, - "main": "./lib", - "engines": { - "node": ">= 0.4.0" - }, - "readme": "\n\n\n# Synopsis\nA hybrid streaming middleware kernel backwards compatible with connect.\n\n# Motivation\nThe advantage to streaming middlewares is that they do not require buffering the entire stream in order to execute their function.\n\n# Status\n\n[![Build Status](https://secure.travis-ci.org/flatiron/union.png)](http://travis-ci.org/flatiron/union)\n\n# Installation\nThere are a few ways to use `union`. Install the library using npm. You can add it to your `package.json` file as a dependancy\n\n```bash\n $ [sudo] npm install union\n```\n\n## Usage\nUnion's request handling is [connect](https://github.com/senchalabs/connect)-compatible, meaning that all existing connect middlewares should work out-of-the-box with union.\n\n**(Union 0.3.x is compatible with connect >= 2.1.0, [Extensively Tested](https://github.com/pksunkara/connect-union))**\n\nIn addition, the response object passed to middlewares listens for a \"next\" event, which is equivalent to calling `next()`. Flatiron middlewares are written in this manner, meaning they are not reverse-compatible with connect.\n\n### A simple case\n\n``` js\nvar fs = require('fs'),\n union = require('../lib'),\n director = require('director');\n\nvar router = new director.http.Router();\n\nvar server = union.createServer({\n before: [\n function (req, res) {\n var found = router.dispatch(req, res);\n if (!found) {\n res.emit('next');\n }\n }\n ]\n});\n\nrouter.get(/foo/, function () {\n this.res.writeHead(200, { 'Content-Type': 'text/plain' })\n this.res.end('hello world\\n');\n});\n\nrouter.post(/foo/, { stream: true }, function () {\n var req = this.req,\n res = this.res,\n writeStream;\n\n writeStream = fs.createWriteStream(Date.now() + '-foo.txt');\n req.pipe(writeStream);\n\n writeStream.on('close', function () {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.end('wrote to a stream!');\n });\n});\n\nserver.listen(9090);\nconsole.log('union with director running on 9090');\n```\n\nTo demonstrate the code, we use [director](https://github.com/flatiron/director). A light-weight, Client AND Server side URL-Router for Node.js and Single Page Apps!\n\n### A case with connect\n\nCode based on connect\n\n```js\nvar connect = require('connect')\n , http = require('http');\n\nvar app = connect()\n .use(connect.favicon())\n .use(connect.logger('dev'))\n .use(connect.static('public'))\n .use(connect.directory('public'))\n .use(connect.cookieParser('my secret here'))\n .use(connect.session())\n .use(function (req, res) {\n res.end('Hello from Connect!\\n');\n });\n\nhttp.createServer(app).listen(3000);\n```\n\nCode based on union\n\n```js\nvar connect = require('connect')\n , union = require('union');\n\nvar server = union.createServer({\n buffer: false,\n before: [\n connect.favicon(),\n connect.logger('dev'),\n connect.static('public'),\n connect.directory('public'),\n connect.cookieParser('my secret here'),\n connect.session(),\n function (req, res) {\n res.end('Hello from Connect!\\n');\n },\n ]\n}).listen(3000);\n```\n\n### SPDY enabled server example\n\n# API\n\n## union Static Members\n\n### createServer(options)\nThe `options` object is required. Options include:\n\nSpecification\n\n```\n function createServer(options)\n\n @param options {Object}\n An object literal that represents the configuration for the server.\n\n @option before {Array}\n The `before` value is an array of middlewares, which are used to route and serve incoming\n requests. For instance, in the example, `favicon` is a middleware which handles requests\n for `/favicon.ico`.\n\n @option after {Array}\n The `after` value is an array of functions that return stream filters,\n which are applied after the request handlers in `options.before`.\n Stream filters inherit from `union.ResponseStream`, which implements the\n Node.js core streams api with a bunch of other goodies.\n\n @option limit {Object}\n (optional) A value, passed to internal instantiations of `union.BufferedStream`.\n\n @option https {Object}\n (optional) A value that specifies the certificate and key necessary to create an instance of\n `https.Server`.\n\n @option spdy {Object}\n (optional) A value that specifies the certificate and key necessary to create an instance of\n `spdy.Server`.\n\n @option headers {Object}\n (optional) An object representing a set of headers to set in every outgoing response\n```\n\nExample\n\n```js\nvar server = union.createServer({\n before: [\n favicon('./favicon.png'),\n function (req, res) {\n var found = router.dispatch(req, res);\n if (!found) {\n res.emit('next');\n }\n }\n ]\n});\n```\n\nAn example of the `https` or `spdy` option.\n\n``` js\n{\n cert: 'path/to/cert.pem',\n key: 'path/to/key.pem',\n ca: 'path/to/ca.pem'\n}\n```\n\nAn example of the `headers` option.\n\n``` js\n{\n 'x-powered-by': 'your-sweet-application v10.9.8'\n}\n```\n\n## Error Handling\nError handler is similiar to middlware but takes an extra argument for error at the beginning.\n\n```js\nvar handle = function (err, req, res) {\n res.statusCode = err.status;\n res.end(req.headers);\n};\n\nvar server = union.createServer({\n onError: handle,\n before: [\n favicon('./favicon.png'),\n function (req, res) {\n var found = router.dispatch(req, res);\n if (!found) {\n res.emit('next');\n }\n }\n ]\n});\n```\n\n## BufferedStream Constructor\nThis constructor inherits from `Stream` and can buffer data up to `limit` bytes. It also implements `pause` and `resume` methods.\n\nSpecification\n\n```\n function BufferedStream(limit)\n\n @param limit {Number}\n the limit for which the stream can be buffered\n```\n\nExample\n\n```js\nvar bs = union.BufferedStream(n);\n```\n\n## HttpStream Constructor\nThis constructor inherits from `union.BufferedStream` and returns a stream with these extra properties:\n\nSpecification\n\n```\n function HttpStream()\n```\n\nExample\n\n```js\nvar hs = union.HttpStream();\n```\n\n## HttpStream Instance Members\n\n### url\nThe url from the request.\n\nExample\n\n```js\nhttpStream.url = '';\n```\n\n### headers\nThe HTTP headers associated with the stream.\n\nExample\n\n```js\nhttpStream.headers = '';\n```\n\n### method\nThe HTTP method (\"GET\", \"POST\", etc).\n\nExample\n\n```js\nhttpStream.method = 'POST';\n```\n\n### query\nThe querystring associated with the stream (if applicable).\n\nExample\n\n```js\nhttpStream.query = '';\n```\n\n## ResponseStream Constructor\nThis constructor inherits from `union.HttpStream`, and is additionally writeable. Union supplies this constructor as a basic response stream middleware from which to inherit.\n\nSpecification\n\n```\n function ResponseStream()\n```\n\nExample\n\n```js\nvar rs = union.ResponseStream();\n```\n\n# Tests\n\nAll tests are written with [vows][0] and should be run with [npm][1]:\n\n``` bash\n $ npm test\n```\n\n# Licence\n\n(The MIT License)\n\nCopyright (c) 2010-2012 Nodejitsu Inc. \n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://vowsjs.org\n[1]: http://npmjs.org\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/flatiron/union/issues" - }, - "homepage": "https://github.com/flatiron/union", - "_id": "union@0.3.8", - "_shasum": "26a702a4d3528b4358c9711c8abff6cc91d24257", - "_from": "union@0.3.x", - "_resolved": "https://registry.npmjs.org/union/-/union-0.3.8.tgz" -} diff --git a/templates/bin/node/http-server/node_modules/union/union.png b/templates/bin/node/http-server/node_modules/union/union.png deleted file mode 100644 index 96c6e665a8..0000000000 Binary files a/templates/bin/node/http-server/node_modules/union/union.png and /dev/null differ diff --git a/templates/bin/node/http-server/package.json b/templates/bin/node/http-server/package.json deleted file mode 100755 index 61f42f4fdd..0000000000 --- a/templates/bin/node/http-server/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "http-server", - "version": "0.7.4", - "author": "Nodejitsu ", - "description": "a simple zero-configuration command-line http server", - "main": "./lib/http-server", - "repository": { - "type": "git", - "url": "git://github.com/nodeapps/http-server.git" - }, - "keywords": [ - "cli", - "command" - ], - "scripts": { - "start": "node ./bin/http-server", - "test": "vows --spec --isolate" - }, - "contributors": [ - { - "name": "Marak Squires", - "email": "marak.squires@gmail.com" - }, - { - "name": "Charlie McConnell", - "email": "charlie@charlieistheman.com" - }, - { - "name": "Joshua Holbrook", - "email": "josh.holbrook@gmail.com" - }, - { - "name": "Maciej Małecki", - "email": "maciej.malecki@notimplemented.org" - }, - { - "name": "Matthew Bergman", - "email": "mzbphoto@gmail.com" - }, - { - "name": "brad dunbar", - "email": "dunbarb2@gmail.com" - }, - { - "name": "Dominic Tarr" - }, - { - "name": "Travis Person", - "email": "travis.person@gmail.com" - } - ], - "dependencies": { - "colors": "0.6.x", - "optimist": "0.5.x", - "union": "0.3.x", - "ecstatic": "0.4.x", - "portfinder": "0.2.x", - "opener": "~1.3.0" - }, - "devDependencies": { - "vows": "0.7.x", - "request": "2.21.x" - }, - "bugs": { - "url": "https://github.com/nodeapps/http-server/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/nodeapps/http-server/raw/master/LICENSE" - } - ], - "analyze": false, - "preferGlobal": "true", - "bin": { - "http-server": "./bin/http-server" - } -} diff --git a/templates/bin/node/node-linux32 b/templates/bin/node/node-linux32 deleted file mode 100755 index 030e4c4686..0000000000 Binary files a/templates/bin/node/node-linux32 and /dev/null differ diff --git a/templates/bin/node/node-linux64 b/templates/bin/node/node-linux64 deleted file mode 100755 index 7a969ff3e9..0000000000 Binary files a/templates/bin/node/node-linux64 and /dev/null differ diff --git a/templates/bin/node/node-mac b/templates/bin/node/node-mac deleted file mode 100755 index 389cae1145..0000000000 Binary files a/templates/bin/node/node-mac and /dev/null differ diff --git a/templates/bin/node/node-windows.exe b/templates/bin/node/node-windows.exe deleted file mode 100644 index 6b3ac8aef2..0000000000 Binary files a/templates/bin/node/node-windows.exe and /dev/null differ