diff --git a/ChangeLog b/ChangeLog
index c824514..d472e92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2016-01-21 07:49 marc
+
+ * ChangeLog, nodejs/public/javascripts/servicedock.js,
+ nodejs/public/stylesheets/servicedock.css: create docker run
+ commands from configuration json
+
+2016-01-20 15:55 marc
+
+ * nodejs/public/javascripts/servicedock.js,
+ nodejs/public/stylesheets/servicedock.css,
+ nodejs/sockets/index.js, nodejs/views/index.ejs: possibility to
+ download configuration
+
2016-01-19 16:20 marc
* nodejs/package.json.in, nodejs/public/javascripts/servicedock.js,
diff --git a/nodejs/makefile.am b/nodejs/makefile.am
index 4ade29f..b5e821e 100644
--- a/nodejs/makefile.am
+++ b/nodejs/makefile.am
@@ -4,10 +4,16 @@
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
-EXTRA_DIST = servicedock.js package.json.in node_modules public routes sockets views
+EXTRA_DIST = servicedock.js package.json.in public routes sockets views
nodejsdir = ${pkgdatadir}/nodejs
+node_modules: package.json.in
+ npm install
+
+clean-local:
+ -rm -r node_modules
+
install-data-hook:
test -d $(DESTDIR)${nodejsdir} || mkdir -p $(DESTDIR)${nodejsdir}
chmod -R u+w $(DESTDIR)${nodejsdir}
diff --git a/nodejs/node_modules/.bin/express b/nodejs/node_modules/.bin/express
deleted file mode 120000
index b741d99..0000000
--- a/nodejs/node_modules/.bin/express
+++ /dev/null
@@ -1 +0,0 @@
-../express/bin/express
\ No newline at end of file
diff --git a/nodejs/node_modules/.bin/stylus b/nodejs/node_modules/.bin/stylus
deleted file mode 120000
index 4113f9b..0000000
--- a/nodejs/node_modules/.bin/stylus
+++ /dev/null
@@ -1 +0,0 @@
-../stylus/bin/stylus
\ No newline at end of file
diff --git a/nodejs/node_modules/ejs/Jakefile b/nodejs/node_modules/ejs/Jakefile
deleted file mode 100644
index 0362e98..0000000
--- a/nodejs/node_modules/ejs/Jakefile
+++ /dev/null
@@ -1,45 +0,0 @@
-var fs = require('fs')
- , buildOpts = {
- printStdout: true
- , printStderr: true
- };
-
-task('build', ['browserify', 'minify'], function () {
- console.log('Build completed.');
-});
-
-desc('Cleans browerified/minified files and package files');
-task('clean', ['clobber'], function () {
- jake.rmRf('./ejs.js');
- jake.rmRf('./ejs.min.js');
-});
-
-task('browserify', {async: true}, function () {
- jake.exec('./node_modules/browserify/bin/cmd.js lib/ejs.js > ejs.js',
- buildOpts, function () {
- console.log('Browserification completed.');
- setTimeout(complete, 0);
- });
-});
-
-task('minify', {async: true}, function () {
- jake.exec('./node_modules/uglify-js/bin/uglifyjs ejs.js > ejs.min.js',
- buildOpts, function () {
- console.log('Minification completed.');
- setTimeout(complete, 0);
- });
-});
-
-publishTask('ejs', ['build'], function () {
- this.packageFiles.include([
- 'Jakefile'
- , 'README.md'
- , 'package.json'
- , 'ejs.js'
- , 'ejs.min.js'
- , 'lib/**'
- , 'test/**'
- ]);
-});
-
-
diff --git a/nodejs/node_modules/ejs/README.md b/nodejs/node_modules/ejs/README.md
deleted file mode 100644
index f0bffdb..0000000
--- a/nodejs/node_modules/ejs/README.md
+++ /dev/null
@@ -1,178 +0,0 @@
-# EJS
-
-Embedded JavaScript templates
-
-[](https://travis-ci.org/mde/ejs)
-[](https://david-dm.org/mde/ejs#info=devDependencies)
-
-## Installation
-
-```bash
-$ npm install ejs
-```
-
-## Features
-
- * Control flow with `<% %>`
- * Escaped output with `<%= %>`
- * Unescaped raw output with `<%- %>`
- * Trim-mode ('newline slurping') with `-%>` ending tag
- * Custom delimiters (e.g., use ' ?>' instead of '<% %>')
- * Includes
- * Client-side support
- * Static caching of intermediate JavaScript
- * Static caching of templates
- * Complies with the [Express](http://expressjs.com) view system
-
-## Example
-
-```html
-<% if (user) { %>
-
<%= user.name %>
-<% } %>
-```
-
-## Usage
-
-```javascript
-var template = ejs.compile(str, options);
-template(data);
-// => Rendered HTML string
-
-ejs.render(str, data, options);
-// => Rendered HTML string
-```
-
-You can also use the shortcut `ejs.render(dataAndOptions);` where you pass
-everything in a single object. In that case, you'll end up with local variables
-for all the passed options.
-
-## Options
-
- - `cache` Compiled functions are cached, requires `filename`
- - `filename` Used by `cache` to key caches, and for includes
- - `context` Function execution context
- - `compileDebug` When `false` no debug instrumentation is compiled
- - `client` Returns standalone compiled function
- - `delimiter` Character to use with angle brackets for open/close
- - `debug` Output generated function body
- - `_with` Whether or not to use `with() {}` constructs. If `false` then the locals will be stored in the `locals` object.
- - `rmWhitespace` Remove all safe-to-remove whitespace, including leading
- and trailing whitespace. It also enables a safer version of `-%>` line
- slurping for all scriptlet tags (it does not strip new lines of tags in
- the middle of a line).
-
-## Tags
-
- - `<%` 'Scriptlet' tag, for control-flow, no output
- - `<%=` Outputs the value into the template (HTML escaped)
- - `<%-` Outputs the unescaped value into the template
- - `<%#` Comment tag, no execution, no output
- - `<%%` Outputs a literal '<%'
- - `%>` Plain ending tag
- - `-%>` Trim-mode ('newline slurp') tag, trims following newline
-
-## Includes
-
-Includes either have to be an absolute path, or, if not, are assumed as
-relative to the template with the `include` call. (This requires the
-`filename` option.) For example if you are including `./views/user/show.ejs`
-from `./views/users.ejs` you would use `<%- include('user/show') %>`.
-
-You'll likely want to use the raw output tag (`<%-`) with your include to avoid
-double-escaping the HTML output.
-
-```html
-
-```
-
-Includes are inserted at runtime, so you can use variables for the path in the
-`include` call (for example `<%- include(somePath) %>`). Variables in your
-top-level data object are available to all your includes, but local variables
-need to be passed down.
-
-NOTE: Include preprocessor directives (`<% include user/show %>`) are
-still supported.
-
-## Custom delimiters
-
-Custom delimiters can be applied on a per-template basis, or globally:
-
-```javascript
-var ejs = require('ejs'),
- users = ['geddy', 'neil', 'alex'];
-
-// Just one template
-ejs.render('= users.join(" | "); ?>', {users: users}, {delimiter: '?'});
-// => 'geddy | neil | alex'
-
-// Or globally
-ejs.delimiter = '$';
-ejs.render('<$= users.join(" | "); $>', {users: users});
-// => 'geddy | neil | alex'
-```
-
-## Caching
-
-EJS ships with a basic in-process cache for caching the intermediate JavaScript
-functions used to render templates. It's easy to plug in LRU caching using
-Node's `lru-cache` library:
-
-```javascript
-var ejs = require('ejs')
- , LRU = require('lru-cache');
-ejs.cache = LRU(100); // LRU cache with 100-item limit
-```
-
-If you want to clear the EJS cache, call `ejs.clearCache`. If you're using the
-LRU cache and need a different limit, simple reset `ejs.cache` to a new instance
-of the LRU.
-
-## Layouts
-
-EJS does not specifically support blocks, but layouts can be implemented by
-including headers and footers, like so:
-
-
-```html
-<%- include('header') -%>
-
- Title
-
-
- My page
-
-<%- include('footer') -%>
-```
-
-## Client-side support
-
-Go to the [Latest Release](https://github.com/mde/ejs/releases/latest), download
-`./ejs.js` or `./ejs.min.js`.
-
-Include one of these on your page, and `ejs.render(str)`.
-
-## Related projects
-
-There are a number of implementations of EJS:
-
- * TJ's implementation, the v1 of this library: https://github.com/tj/ejs
- * Jupiter Consulting's EJS: http://www.embeddedjs.com/
- * EJS Embedded JavaScript Framework on Google Code: https://code.google.com/p/embeddedjavascript/
- * Sam Stephenson's Ruby implementation: https://rubygems.org/gems/ejs
- * Erubis, an ERB implementation which also runs JavaScript: http://www.kuwata-lab.com/erubis/users-guide.04.html#lang-javascript
-
-## License
-
-Licensed under the Apache License, Version 2.0
-()
-
-- - -
-EJS Embedded JavaScript templates copyright 2112
-mde@fleegix.org.
-
-
diff --git a/nodejs/node_modules/ejs/ejs.js b/nodejs/node_modules/ejs/ejs.js
deleted file mode 100644
index 620f553..0000000
--- a/nodejs/node_modules/ejs/ejs.js
+++ /dev/null
@@ -1,1201 +0,0 @@
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o
- * @author Tiancheng "Timothy" Gu
- * @project EJS
- * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
- */
-
-/**
- * EJS internal functions.
- *
- * Technically this "module" lies in the same file as {@link module:ejs}, for
- * the sake of organization all the private functions re grouped into this
- * module.
- *
- * @module ejs-internal
- * @private
- */
-
-/**
- * Embedded JavaScript templating engine.
- *
- * @module ejs
- * @public
- */
-
-var fs = require('fs')
- , utils = require('./utils')
- , scopeOptionWarned = false
- , _VERSION_STRING = require('../package.json').version
- , _DEFAULT_DELIMITER = '%'
- , _DEFAULT_LOCALS_NAME = 'locals'
- , _REGEX_STRING = '(<%%|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)'
- , _OPTS = [ 'cache', 'filename', 'delimiter', 'scope', 'context'
- , 'debug', 'compileDebug', 'client', '_with', 'rmWhitespace'
- ]
- , _TRAILING_SEMCOL = /;\s*$/
- , _BOM = /^\uFEFF/;
-
-/**
- * EJS template function cache. This can be a LRU object from lru-cache NPM
- * module. By default, it is {@link module:utils.cache}, a simple in-process
- * cache that grows continuously.
- *
- * @type {Cache}
- */
-
-exports.cache = utils.cache;
-
-/**
- * Name of the object containing the locals.
- *
- * This variable is overriden by {@link Options}`.localsName` if it is not
- * `undefined`.
- *
- * @type {String}
- * @public
- */
-
-exports.localsName = _DEFAULT_LOCALS_NAME;
-
-/**
- * Get the path to the included file from the parent file path and the
- * specified path.
- *
- * @param {String} name specified path
- * @param {String} filename parent file path
- * @return {String}
- */
-
-exports.resolveInclude = function(name, filename) {
- var path = require('path')
- , dirname = path.dirname
- , extname = path.extname
- , resolve = path.resolve
- , includePath = resolve(dirname(filename), name)
- , ext = extname(name);
- if (!ext) {
- includePath += '.ejs';
- }
- return includePath;
-};
-
-/**
- * Get the template from a string or a file, either compiled on-the-fly or
- * read from cache (if enabled), and cache the template if needed.
- *
- * If `template` is not set, the file specified in `options.filename` will be
- * read.
- *
- * If `options.cache` is true, this function reads the file from
- * `options.filename` so it must be set prior to calling this function.
- *
- * @memberof module:ejs-internal
- * @param {Options} options compilation options
- * @param {String} [template] template source
- * @return {(TemplateFunction|ClientFunction)}
- * Depending on the value of `options.client`, either type might be returned.
- * @static
- */
-
-function handleCache(options, template) {
- var fn
- , path = options.filename
- , hasTemplate = arguments.length > 1;
-
- if (options.cache) {
- if (!path) {
- throw new Error('cache option requires a filename');
- }
- fn = exports.cache.get(path);
- if (fn) {
- return fn;
- }
- if (!hasTemplate) {
- template = fs.readFileSync(path).toString().replace(_BOM, '');
- }
- }
- else if (!hasTemplate) {
- // istanbul ignore if: should not happen at all
- if (!path) {
- throw new Error('Internal EJS error: no file name or template '
- + 'provided');
- }
- template = fs.readFileSync(path).toString().replace(_BOM, '');
- }
- fn = exports.compile(template, options);
- if (options.cache) {
- exports.cache.set(path, fn);
- }
- return fn;
-}
-
-/**
- * Get the template function.
- *
- * If `options.cache` is `true`, then the template is cached.
- *
- * @memberof module:ejs-internal
- * @param {String} path path for the specified file
- * @param {Options} options compilation options
- * @return {(TemplateFunction|ClientFunction)}
- * Depending on the value of `options.client`, either type might be returned
- * @static
- */
-
-function includeFile(path, options) {
- var opts = utils.shallowCopy({}, options);
- if (!opts.filename) {
- throw new Error('`include` requires the \'filename\' option.');
- }
- opts.filename = exports.resolveInclude(path, opts.filename);
- return handleCache(opts);
-}
-
-/**
- * Get the JavaScript source of an included file.
- *
- * @memberof module:ejs-internal
- * @param {String} path path for the specified file
- * @param {Options} options compilation options
- * @return {String}
- * @static
- */
-
-function includeSource(path, options) {
- var opts = utils.shallowCopy({}, options)
- , includePath
- , template;
- if (!opts.filename) {
- throw new Error('`include` requires the \'filename\' option.');
- }
- includePath = exports.resolveInclude(path, opts.filename);
- template = fs.readFileSync(includePath).toString().replace(_BOM, '');
-
- opts.filename = includePath;
- var templ = new Template(template, opts);
- templ.generateSource();
- return templ.source;
-}
-
-/**
- * Re-throw the given `err` in context to the `str` of ejs, `filename`, and
- * `lineno`.
- *
- * @implements RethrowCallback
- * @memberof module:ejs-internal
- * @param {Error} err Error object
- * @param {String} str EJS source
- * @param {String} filename file name of the EJS file
- * @param {String} lineno line number of the error
- * @static
- */
-
-function rethrow(err, str, filename, lineno){
- var lines = str.split('\n')
- , start = Math.max(lineno - 3, 0)
- , end = Math.min(lines.length, lineno + 3);
-
- // Error context
- var context = lines.slice(start, end).map(function (line, i){
- var curr = i + start + 1;
- return (curr == lineno ? ' >> ' : ' ')
- + curr
- + '| '
- + line;
- }).join('\n');
-
- // Alter exception message
- err.path = filename;
- err.message = (filename || 'ejs') + ':'
- + lineno + '\n'
- + context + '\n\n'
- + err.message;
-
- throw err;
-}
-
-/**
- * Copy properties in data object that are recognized as options to an
- * options object.
- *
- * This is used for compatibility with earlier versions of EJS and Express.js.
- *
- * @memberof module:ejs-internal
- * @param {Object} data data object
- * @param {Options} opts options object
- * @static
- */
-
-function cpOptsInData(data, opts) {
- _OPTS.forEach(function (p) {
- if (typeof data[p] != 'undefined') {
- opts[p] = data[p];
- }
- });
-}
-
-/**
- * Compile the given `str` of ejs into a template function.
- *
- * @param {String} template EJS template
- *
- * @param {Options} opts compilation options
- *
- * @return {(TemplateFunction|ClientFunction)}
- * Depending on the value of `opts.client`, either type might be returned.
- * @public
- */
-
-exports.compile = function compile(template, opts) {
- var templ;
-
- // v1 compat
- // 'scope' is 'context'
- // FIXME: Remove this in a future version
- if (opts && opts.scope) {
- if (!scopeOptionWarned){
- console.warn('`scope` option is deprecated and will be removed in EJS 3');
- scopeOptionWarned = true;
- }
- if (!opts.context) {
- opts.context = opts.scope;
- }
- delete opts.scope;
- }
- templ = new Template(template, opts);
- return templ.compile();
-};
-
-/**
- * Render the given `template` of ejs.
- *
- * If you would like to include options but not data, you need to explicitly
- * call this function with `data` being an empty object or `null`.
- *
- * @param {String} template EJS template
- * @param {Object} [data={}] template data
- * @param {Options} [opts={}] compilation and rendering options
- * @return {String}
- * @public
- */
-
-exports.render = function (template, data, opts) {
- data = data || {};
- opts = opts || {};
- var fn;
-
- // No options object -- if there are optiony names
- // in the data, copy them to options
- if (arguments.length == 2) {
- cpOptsInData(data, opts);
- }
-
- return handleCache(opts, template)(data);
-};
-
-/**
- * Render an EJS file at the given `path` and callback `cb(err, str)`.
- *
- * If you would like to include options but not data, you need to explicitly
- * call this function with `data` being an empty object or `null`.
- *
- * @param {String} path path to the EJS file
- * @param {Object} [data={}] template data
- * @param {Options} [opts={}] compilation and rendering options
- * @param {RenderFileCallback} cb callback
- * @public
- */
-
-exports.renderFile = function () {
- var args = Array.prototype.slice.call(arguments)
- , path = args.shift()
- , cb = args.pop()
- , data = args.shift() || {}
- , opts = args.pop() || {}
- , result;
-
- // Don't pollute passed in opts obj with new vals
- opts = utils.shallowCopy({}, opts);
-
- // No options object -- if there are optiony names
- // in the data, copy them to options
- if (arguments.length == 3) {
- cpOptsInData(data, opts);
- }
- opts.filename = path;
-
- try {
- result = handleCache(opts)(data);
- }
- catch(err) {
- return cb(err);
- }
- return cb(null, result);
-};
-
-/**
- * Clear intermediate JavaScript cache. Calls {@link Cache#reset}.
- * @public
- */
-
-exports.clearCache = function () {
- exports.cache.reset();
-};
-
-function Template(text, opts) {
- opts = opts || {};
- var options = {};
- this.templateText = text;
- this.mode = null;
- this.truncate = false;
- this.currentLine = 1;
- this.source = '';
- this.dependencies = [];
- options.client = opts.client || false;
- options.escapeFunction = opts.escape || utils.escapeXML;
- options.compileDebug = opts.compileDebug !== false;
- options.debug = !!opts.debug;
- options.filename = opts.filename;
- options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;
- options._with = typeof opts._with != 'undefined' ? opts._with : true;
- options.context = opts.context;
- options.cache = opts.cache || false;
- options.rmWhitespace = opts.rmWhitespace;
- this.opts = options;
-
- this.regex = this.createRegex();
-}
-
-Template.modes = {
- EVAL: 'eval'
-, ESCAPED: 'escaped'
-, RAW: 'raw'
-, COMMENT: 'comment'
-, LITERAL: 'literal'
-};
-
-Template.prototype = {
- createRegex: function () {
- var str = _REGEX_STRING
- , delim = utils.escapeRegExpChars(this.opts.delimiter);
- str = str.replace(/%/g, delim);
- return new RegExp(str);
- }
-
-, compile: function () {
- var src
- , fn
- , opts = this.opts
- , prepended = ''
- , appended = ''
- , escape = opts.escapeFunction;
-
- if (opts.rmWhitespace) {
- // Have to use two separate replace here as `^` and `$` operators don't
- // work well with `\r`.
- this.templateText =
- this.templateText.replace(/\r/g, '').replace(/^\s+|\s+$/gm, '');
- }
-
- // Slurp spaces and tabs before <%_ and after _%>
- this.templateText =
- this.templateText.replace(/[ \t]*<%_/gm, '<%_').replace(/_%>[ \t]*/gm, '_%>');
-
- if (!this.source) {
- this.generateSource();
- prepended += ' var __output = [], __append = __output.push.bind(__output);' + '\n';
- if (opts._with !== false) {
- prepended += ' with (' + exports.localsName + ' || {}) {' + '\n';
- appended += ' }' + '\n';
- }
- appended += ' return __output.join("");' + '\n';
- this.source = prepended + this.source + appended;
- }
-
- if (opts.compileDebug) {
- src = 'var __line = 1' + '\n'
- + ' , __lines = ' + JSON.stringify(this.templateText) + '\n'
- + ' , __filename = ' + (opts.filename ?
- JSON.stringify(opts.filename) : 'undefined') + ';' + '\n'
- + 'try {' + '\n'
- + this.source
- + '} catch (e) {' + '\n'
- + ' rethrow(e, __lines, __filename, __line);' + '\n'
- + '}' + '\n';
- }
- else {
- src = this.source;
- }
-
- if (opts.debug) {
- console.log(src);
- }
-
- if (opts.client) {
- src = 'escape = escape || ' + escape.toString() + ';' + '\n' + src;
- if (opts.compileDebug) {
- src = 'rethrow = rethrow || ' + rethrow.toString() + ';' + '\n' + src;
- }
- }
-
- try {
- fn = new Function(exports.localsName + ', escape, include, rethrow', src);
- }
- catch(e) {
- // istanbul ignore else
- if (e instanceof SyntaxError) {
- if (opts.filename) {
- e.message += ' in ' + opts.filename;
- }
- e.message += ' while compiling ejs';
- }
- throw e;
- }
-
- if (opts.client) {
- fn.dependencies = this.dependencies;
- return fn;
- }
-
- // Return a callable function which will execute the function
- // created by the source-code, with the passed data as locals
- // Adds a local `include` function which allows full recursive include
- var returnedFn = function (data) {
- var include = function (path, includeData) {
- var d = utils.shallowCopy({}, data);
- if (includeData) {
- d = utils.shallowCopy(d, includeData);
- }
- return includeFile(path, opts)(d);
- };
- return fn.apply(opts.context, [data || {}, escape, include, rethrow]);
- };
- returnedFn.dependencies = this.dependencies;
- return returnedFn;
- }
-
-, generateSource: function () {
- var self = this
- , matches = this.parseTemplateText()
- , d = this.opts.delimiter;
-
- if (matches && matches.length) {
- matches.forEach(function (line, index) {
- var opening
- , closing
- , include
- , includeOpts
- , includeSrc;
- // If this is an opening tag, check for closing tags
- // FIXME: May end up with some false positives here
- // Better to store modes as k/v with '<' + delimiter as key
- // Then this can simply check against the map
- if ( line.indexOf('<' + d) === 0 // If it is a tag
- && line.indexOf('<' + d + d) !== 0) { // and is not escaped
- closing = matches[index + 2];
- if (!(closing == d + '>' || closing == '-' + d + '>' || closing == '_' + d + '>')) {
- throw new Error('Could not find matching close tag for "' + line + '".');
- }
- }
- // HACK: backward-compat `include` preprocessor directives
- if ((include = line.match(/^\s*include\s+(\S+)/))) {
- opening = matches[index - 1];
- // Must be in EVAL or RAW mode
- if (opening && (opening == '<' + d || opening == '<' + d + '-' || opening == '<' + d + '_')) {
- includeOpts = utils.shallowCopy({}, self.opts);
- includeSrc = includeSource(include[1], includeOpts);
- includeSrc = ' ; (function(){' + '\n' + includeSrc +
- ' ; })()' + '\n';
- self.source += includeSrc;
- self.dependencies.push(exports.resolveInclude(include[1],
- includeOpts.filename));
- return;
- }
- }
- self.scanLine(line);
- });
- }
-
- }
-
-, parseTemplateText: function () {
- var str = this.templateText
- , pat = this.regex
- , result = pat.exec(str)
- , arr = []
- , firstPos
- , lastPos;
-
- while (result) {
- firstPos = result.index;
- lastPos = pat.lastIndex;
-
- if (firstPos !== 0) {
- arr.push(str.substring(0, firstPos));
- str = str.slice(firstPos);
- }
-
- arr.push(result[0]);
- str = str.slice(result[0].length);
- result = pat.exec(str);
- }
-
- if (str) {
- arr.push(str);
- }
-
- return arr;
- }
-
-, scanLine: function (line) {
- var self = this
- , d = this.opts.delimiter
- , newLineCount = 0;
-
- function _addOutput() {
- if (self.truncate) {
- line = line.replace('\n', '');
- self.truncate = false;
- }
- else if (self.opts.rmWhitespace) {
- // Gotta me more careful here.
- // .replace(/^(\s*)\n/, '$1') might be more appropriate here but as
- // rmWhitespace already removes trailing spaces anyway so meh.
- line = line.replace(/^\n/, '');
- }
- if (!line) {
- return;
- }
-
- // Preserve literal slashes
- line = line.replace(/\\/g, '\\\\');
-
- // Convert linebreaks
- line = line.replace(/\n/g, '\\n');
- line = line.replace(/\r/g, '\\r');
-
- // Escape double-quotes
- // - this will be the delimiter during execution
- line = line.replace(/"/g, '\\"');
- self.source += ' ; __append("' + line + '")' + '\n';
- }
-
- newLineCount = (line.split('\n').length - 1);
-
- switch (line) {
- case '<' + d:
- case '<' + d + '_':
- this.mode = Template.modes.EVAL;
- break;
- case '<' + d + '=':
- this.mode = Template.modes.ESCAPED;
- break;
- case '<' + d + '-':
- this.mode = Template.modes.RAW;
- break;
- case '<' + d + '#':
- this.mode = Template.modes.COMMENT;
- break;
- case '<' + d + d:
- this.mode = Template.modes.LITERAL;
- this.source += ' ; __append("' + line.replace('<' + d + d, '<' + d) + '")' + '\n';
- break;
- case d + '>':
- case '-' + d + '>':
- case '_' + d + '>':
- if (this.mode == Template.modes.LITERAL) {
- _addOutput();
- }
-
- this.mode = null;
- this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0;
- break;
- default:
- // In script mode, depends on type of tag
- if (this.mode) {
- // If '//' is found without a line break, add a line break.
- switch (this.mode) {
- case Template.modes.EVAL:
- case Template.modes.ESCAPED:
- case Template.modes.RAW:
- if (line.lastIndexOf('//') > line.lastIndexOf('\n')) {
- line += '\n';
- }
- }
- switch (this.mode) {
- // Just executing code
- case Template.modes.EVAL:
- this.source += ' ; ' + line + '\n';
- break;
- // Exec, esc, and output
- case Template.modes.ESCAPED:
- this.source += ' ; __append(escape(' +
- line.replace(_TRAILING_SEMCOL, '').trim() + '))' + '\n';
- break;
- // Exec and output
- case Template.modes.RAW:
- this.source += ' ; __append(' +
- line.replace(_TRAILING_SEMCOL, '').trim() + ')' + '\n';
- break;
- case Template.modes.COMMENT:
- // Do nothing
- break;
- // Literal <%% mode, append as raw output
- case Template.modes.LITERAL:
- _addOutput();
- break;
- }
- }
- // In string mode, just add the output
- else {
- _addOutput();
- }
- }
-
- if (self.opts.compileDebug && newLineCount) {
- this.currentLine += newLineCount;
- this.source += ' ; __line = ' + this.currentLine + '\n';
- }
- }
-};
-
-/**
- * Express.js support.
- *
- * This is an alias for {@link module:ejs.renderFile}, in order to support
- * Express.js out-of-the-box.
- *
- * @func
- */
-
-exports.__express = exports.renderFile;
-
-// Add require support
-/* istanbul ignore else */
-if (require.extensions) {
- require.extensions['.ejs'] = function (module, filename) {
- filename = filename || /* istanbul ignore next */ module.filename;
- var options = {
- filename: filename
- , client: true
- }
- , template = fs.readFileSync(filename).toString()
- , fn = exports.compile(template, options);
- module._compile('module.exports = ' + fn.toString() + ';', filename);
- };
-}
-
-/**
- * Version of EJS.
- *
- * @readonly
- * @type {String}
- * @public
- */
-
-exports.VERSION = _VERSION_STRING;
-
-/* istanbul ignore if */
-if (typeof window != 'undefined') {
- window.ejs = exports;
-}
-
-},{"../package.json":6,"./utils":2,"fs":3,"path":4}],2:[function(require,module,exports){
-/*
- * EJS Embedded JavaScript templates
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
-*/
-
-/**
- * Private utility functions
- * @module utils
- * @private
- */
-
-'use strict';
-
-var regExpChars = /[|\\{}()[\]^$+*?.]/g;
-
-/**
- * Escape characters reserved in regular expressions.
- *
- * If `string` is `undefined` or `null`, the empty string is returned.
- *
- * @param {String} string Input string
- * @return {String} Escaped string
- * @static
- * @private
- */
-exports.escapeRegExpChars = function (string) {
- // istanbul ignore if
- if (!string) {
- return '';
- }
- return String(string).replace(regExpChars, '\\$&');
-};
-
-var _ENCODE_HTML_RULES = {
- '&': '&'
- , '<': '<'
- , '>': '>'
- , '"': '"'
- , "'": '''
- }
- , _MATCH_HTML = /[&<>\'"]/g;
-
-function encode_char(c) {
- return _ENCODE_HTML_RULES[c] || c;
-};
-
-/**
- * Stringified version of constants used by {@link module:utils.escapeXML}.
- *
- * It is used in the process of generating {@link ClientFunction}s.
- *
- * @readonly
- * @type {String}
- */
-
-var escapeFuncStr =
- 'var _ENCODE_HTML_RULES = {\n'
-+ ' "&": "&"\n'
-+ ' , "<": "<"\n'
-+ ' , ">": ">"\n'
-+ ' , \'"\': """\n'
-+ ' , "\'": "'"\n'
-+ ' }\n'
-+ ' , _MATCH_HTML = /[&<>\'"]/g;\n'
-+ 'function encode_char(c) {\n'
-+ ' return _ENCODE_HTML_RULES[c] || c;\n'
-+ '};\n';
-
-/**
- * Escape characters reserved in XML.
- *
- * If `markup` is `undefined` or `null`, the empty string is returned.
- *
- * @implements {EscapeCallback}
- * @param {String} markup Input string
- * @return {String} Escaped string
- * @static
- * @private
- */
-
-exports.escapeXML = function (markup) {
- return markup == undefined
- ? ''
- : String(markup)
- .replace(_MATCH_HTML, encode_char);
-};
-exports.escapeXML.toString = function () {
- return Function.prototype.toString.call(this) + ';\n' + escapeFuncStr
-};
-
-/**
- * Copy all properties from one object to another, in a shallow fashion.
- *
- * @param {Object} to Destination object
- * @param {Object} from Source object
- * @return {Object} Destination object
- * @static
- * @private
- */
-exports.shallowCopy = function (to, from) {
- from = from || {};
- for (var p in from) {
- to[p] = from[p];
- }
- return to;
-};
-
-/**
- * Simple in-process cache implementation. Does not implement limits of any
- * sort.
- *
- * @implements Cache
- * @static
- * @private
- */
-exports.cache = {
- _data: {},
- set: function (key, val) {
- this._data[key] = val;
- },
- get: function (key) {
- return this._data[key];
- },
- reset: function () {
- this._data = {};
- }
-};
-
-
-},{}],3:[function(require,module,exports){
-
-},{}],4:[function(require,module,exports){
-(function (process){
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// 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.
-
-// resolves . and .. elements in a path array with directory names there
-// must be no slashes, empty elements, or device names (c:\) in the array
-// (so also no leading and trailing slashes - it does not distinguish
-// relative and absolute paths)
-function normalizeArray(parts, allowAboveRoot) {
- // if the path tries to go above the root, `up` ends up > 0
- var up = 0;
- for (var i = parts.length - 1; i >= 0; i--) {
- var last = parts[i];
- if (last === '.') {
- parts.splice(i, 1);
- } else if (last === '..') {
- parts.splice(i, 1);
- up++;
- } else if (up) {
- parts.splice(i, 1);
- up--;
- }
- }
-
- // if the path is allowed to go above the root, restore leading ..s
- if (allowAboveRoot) {
- for (; up--; up) {
- parts.unshift('..');
- }
- }
-
- return parts;
-}
-
-// Split a filename into [root, dir, basename, ext], unix version
-// 'root' is just a slash, or nothing.
-var splitPathRe =
- /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
-var splitPath = function(filename) {
- return splitPathRe.exec(filename).slice(1);
-};
-
-// path.resolve([from ...], to)
-// posix version
-exports.resolve = function() {
- var resolvedPath = '',
- resolvedAbsolute = false;
-
- for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
- var path = (i >= 0) ? arguments[i] : process.cwd();
-
- // Skip empty and invalid entries
- if (typeof path !== 'string') {
- throw new TypeError('Arguments to path.resolve must be strings');
- } else if (!path) {
- continue;
- }
-
- resolvedPath = path + '/' + resolvedPath;
- resolvedAbsolute = path.charAt(0) === '/';
- }
-
- // At this point the path should be resolved to a full absolute path, but
- // handle relative paths to be safe (might happen when process.cwd() fails)
-
- // Normalize the path
- resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
- return !!p;
- }), !resolvedAbsolute).join('/');
-
- return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
-};
-
-// path.normalize(path)
-// posix version
-exports.normalize = function(path) {
- var isAbsolute = exports.isAbsolute(path),
- trailingSlash = substr(path, -1) === '/';
-
- // Normalize the path
- path = normalizeArray(filter(path.split('/'), function(p) {
- return !!p;
- }), !isAbsolute).join('/');
-
- if (!path && !isAbsolute) {
- path = '.';
- }
- if (path && trailingSlash) {
- path += '/';
- }
-
- return (isAbsolute ? '/' : '') + path;
-};
-
-// posix version
-exports.isAbsolute = function(path) {
- return path.charAt(0) === '/';
-};
-
-// posix version
-exports.join = function() {
- var paths = Array.prototype.slice.call(arguments, 0);
- return exports.normalize(filter(paths, function(p, index) {
- if (typeof p !== 'string') {
- throw new TypeError('Arguments to path.join must be strings');
- }
- return p;
- }).join('/'));
-};
-
-
-// path.relative(from, to)
-// posix version
-exports.relative = function(from, to) {
- from = exports.resolve(from).substr(1);
- to = exports.resolve(to).substr(1);
-
- function trim(arr) {
- var start = 0;
- for (; start < arr.length; start++) {
- if (arr[start] !== '') break;
- }
-
- var end = arr.length - 1;
- for (; end >= 0; end--) {
- if (arr[end] !== '') break;
- }
-
- if (start > end) return [];
- return arr.slice(start, end - start + 1);
- }
-
- var fromParts = trim(from.split('/'));
- var toParts = trim(to.split('/'));
-
- var length = Math.min(fromParts.length, toParts.length);
- var samePartsLength = length;
- for (var i = 0; i < length; i++) {
- if (fromParts[i] !== toParts[i]) {
- samePartsLength = i;
- break;
- }
- }
-
- var outputParts = [];
- for (var i = samePartsLength; i < fromParts.length; i++) {
- outputParts.push('..');
- }
-
- outputParts = outputParts.concat(toParts.slice(samePartsLength));
-
- return outputParts.join('/');
-};
-
-exports.sep = '/';
-exports.delimiter = ':';
-
-exports.dirname = function(path) {
- var result = splitPath(path),
- root = result[0],
- dir = result[1];
-
- if (!root && !dir) {
- // No dirname whatsoever
- return '.';
- }
-
- if (dir) {
- // It has a dirname, strip trailing slash
- dir = dir.substr(0, dir.length - 1);
- }
-
- return root + dir;
-};
-
-
-exports.basename = function(path, ext) {
- var f = splitPath(path)[2];
- // TODO: make this comparison case-insensitive on windows?
- if (ext && f.substr(-1 * ext.length) === ext) {
- f = f.substr(0, f.length - ext.length);
- }
- return f;
-};
-
-
-exports.extname = function(path) {
- return splitPath(path)[3];
-};
-
-function filter (xs, f) {
- if (xs.filter) return xs.filter(f);
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- if (f(xs[i], i, xs)) res.push(xs[i]);
- }
- return res;
-}
-
-// String.prototype.substr - negative index don't work in IE8
-var substr = 'ab'.substr(-1) === 'b'
- ? function (str, start, len) { return str.substr(start, len) }
- : function (str, start, len) {
- if (start < 0) start = str.length + start;
- return str.substr(start, len);
- }
-;
-
-}).call(this,require('_process'))
-},{"_process":5}],5:[function(require,module,exports){
-// shim for using process in browser
-
-var process = module.exports = {};
-var queue = [];
-var draining = false;
-
-function drainQueue() {
- if (draining) {
- return;
- }
- draining = true;
- var currentQueue;
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- var i = -1;
- while (++i < len) {
- currentQueue[i]();
- }
- len = queue.length;
- }
- draining = false;
-}
-process.nextTick = function (fun) {
- queue.push(fun);
- if (!draining) {
- setTimeout(drainQueue, 0);
- }
-};
-
-process.title = 'browser';
-process.browser = true;
-process.env = {};
-process.argv = [];
-process.version = ''; // empty string to avoid regexp issues
-
-function noop() {}
-
-process.on = noop;
-process.addListener = noop;
-process.once = noop;
-process.off = noop;
-process.removeListener = noop;
-process.removeAllListeners = noop;
-process.emit = noop;
-
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-};
-
-// TODO(shtylman)
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-process.umask = function() { return 0; };
-
-},{}],6:[function(require,module,exports){
-module.exports={
- "name": "ejs",
- "description": "Embedded JavaScript templates",
- "keywords": [
- "template",
- "engine",
- "ejs"
- ],
- "version": "2.3.3",
- "author": "Matthew Eernisse (http://fleegix.org)",
- "contributors": [
- "Timothy Gu (https://timothygu.github.io)"
- ],
- "license": "Apache-2.0",
- "main": "./lib/ejs.js",
- "repository": {
- "type": "git",
- "url": "git://github.com/mde/ejs.git"
- },
- "bugs": "https://github.com/mde/ejs/issues",
- "homepage": "https://github.com/mde/ejs",
- "dependencies": {},
- "devDependencies": {
- "browserify": "^8.0.3",
- "istanbul": "~0.3.5",
- "jake": "^8.0.0",
- "jsdoc": "^3.3.0-beta1",
- "lru-cache": "^2.5.0",
- "mocha": "^2.1.0",
- "rimraf": "^2.2.8",
- "uglify-js": "^2.4.16"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha",
- "coverage": "istanbul cover node_modules/mocha/bin/_mocha",
- "doc": "rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*",
- "devdoc": "rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*"
- }
-}
-},{}]},{},[1]);
diff --git a/nodejs/node_modules/ejs/ejs.min.js b/nodejs/node_modules/ejs/ejs.min.js
deleted file mode 100644
index 98b7d92..0000000
--- a/nodejs/node_modules/ejs/ejs.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o|-%>|_%>)",_OPTS=["cache","filename","delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace"],_TRAILING_SEMCOL=/;\s*$/,_BOM=/^\uFEFF/;exports.cache=utils.cache;exports.localsName=_DEFAULT_LOCALS_NAME;exports.resolveInclude=function(name,filename){var path=require("path"),dirname=path.dirname,extname=path.extname,resolve=path.resolve,includePath=resolve(dirname(filename),name),ext=extname(name);if(!ext){includePath+=".ejs"}return includePath};function handleCache(options,template){var fn,path=options.filename,hasTemplate=arguments.length>1;if(options.cache){if(!path){throw new Error("cache option requires a filename")}fn=exports.cache.get(path);if(fn){return fn}if(!hasTemplate){template=fs.readFileSync(path).toString().replace(_BOM,"")}}else if(!hasTemplate){if(!path){throw new Error("Internal EJS error: no file name or template "+"provided")}template=fs.readFileSync(path).toString().replace(_BOM,"")}fn=exports.compile(template,options);if(options.cache){exports.cache.set(path,fn)}return fn}function includeFile(path,options){var opts=utils.shallowCopy({},options);if(!opts.filename){throw new Error("`include` requires the 'filename' option.")}opts.filename=exports.resolveInclude(path,opts.filename);return handleCache(opts)}function includeSource(path,options){var opts=utils.shallowCopy({},options),includePath,template;if(!opts.filename){throw new Error("`include` requires the 'filename' option.")}includePath=exports.resolveInclude(path,opts.filename);template=fs.readFileSync(includePath).toString().replace(_BOM,"");opts.filename=includePath;var templ=new Template(template,opts);templ.generateSource();return templ.source}function rethrow(err,str,filename,lineno){var lines=str.split("\n"),start=Math.max(lineno-3,0),end=Math.min(lines.length,lineno+3);var context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" >> ":" ")+curr+"| "+line}).join("\n");err.path=filename;err.message=(filename||"ejs")+":"+lineno+"\n"+context+"\n\n"+err.message;throw err}function cpOptsInData(data,opts){_OPTS.forEach(function(p){if(typeof data[p]!="undefined"){opts[p]=data[p]}})}exports.compile=function compile(template,opts){var templ;if(opts&&opts.scope){if(!scopeOptionWarned){console.warn("`scope` option is deprecated and will be removed in EJS 3");scopeOptionWarned=true}if(!opts.context){opts.context=opts.scope}delete opts.scope}templ=new Template(template,opts);return templ.compile()};exports.render=function(template,data,opts){data=data||{};opts=opts||{};var fn;if(arguments.length==2){cpOptsInData(data,opts)}return handleCache(opts,template)(data)};exports.renderFile=function(){var args=Array.prototype.slice.call(arguments),path=args.shift(),cb=args.pop(),data=args.shift()||{},opts=args.pop()||{},result;opts=utils.shallowCopy({},opts);if(arguments.length==3){cpOptsInData(data,opts)}opts.filename=path;try{result=handleCache(opts)(data)}catch(err){return cb(err)}return cb(null,result)};exports.clearCache=function(){exports.cache.reset()};function Template(text,opts){opts=opts||{};var options={};this.templateText=text;this.mode=null;this.truncate=false;this.currentLine=1;this.source="";this.dependencies=[];options.client=opts.client||false;options.escapeFunction=opts.escape||utils.escapeXML;options.compileDebug=opts.compileDebug!==false;options.debug=!!opts.debug;options.filename=opts.filename;options.delimiter=opts.delimiter||exports.delimiter||_DEFAULT_DELIMITER;options._with=typeof opts._with!="undefined"?opts._with:true;options.context=opts.context;options.cache=opts.cache||false;options.rmWhitespace=opts.rmWhitespace;this.opts=options;this.regex=this.createRegex()}Template.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};Template.prototype={createRegex:function(){var str=_REGEX_STRING,delim=utils.escapeRegExpChars(this.opts.delimiter);str=str.replace(/%/g,delim);return new RegExp(str)},compile:function(){var src,fn,opts=this.opts,prepended="",appended="",escape=opts.escapeFunction;if(opts.rmWhitespace){this.templateText=this.templateText.replace(/\r/g,"").replace(/^\s+|\s+$/gm,"")}this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");if(!this.source){this.generateSource();prepended+=" var __output = [], __append = __output.push.bind(__output);"+"\n";if(opts._with!==false){prepended+=" with ("+exports.localsName+" || {}) {"+"\n";appended+=" }"+"\n"}appended+=' return __output.join("");'+"\n";this.source=prepended+this.source+appended}if(opts.compileDebug){src="var __line = 1"+"\n"+" , __lines = "+JSON.stringify(this.templateText)+"\n"+" , __filename = "+(opts.filename?JSON.stringify(opts.filename):"undefined")+";"+"\n"+"try {"+"\n"+this.source+"} catch (e) {"+"\n"+" rethrow(e, __lines, __filename, __line);"+"\n"+"}"+"\n"}else{src=this.source}if(opts.debug){console.log(src)}if(opts.client){src="escape = escape || "+escape.toString()+";"+"\n"+src;if(opts.compileDebug){src="rethrow = rethrow || "+rethrow.toString()+";"+"\n"+src}}try{fn=new Function(exports.localsName+", escape, include, rethrow",src)}catch(e){if(e instanceof SyntaxError){if(opts.filename){e.message+=" in "+opts.filename}e.message+=" while compiling ejs"}throw e}if(opts.client){fn.dependencies=this.dependencies;return fn}var returnedFn=function(data){var include=function(path,includeData){var d=utils.shallowCopy({},data);if(includeData){d=utils.shallowCopy(d,includeData)}return includeFile(path,opts)(d)};return fn.apply(opts.context,[data||{},escape,include,rethrow])};returnedFn.dependencies=this.dependencies;return returnedFn},generateSource:function(){var self=this,matches=this.parseTemplateText(),d=this.opts.delimiter;if(matches&&matches.length){matches.forEach(function(line,index){var opening,closing,include,includeOpts,includeSrc;if(line.indexOf("<"+d)===0&&line.indexOf("<"+d+d)!==0){closing=matches[index+2];if(!(closing==d+">"||closing=="-"+d+">"||closing=="_"+d+">")){throw new Error('Could not find matching close tag for "'+line+'".')}}if(include=line.match(/^\s*include\s+(\S+)/)){opening=matches[index-1];if(opening&&(opening=="<"+d||opening=="<"+d+"-"||opening=="<"+d+"_")){includeOpts=utils.shallowCopy({},self.opts);includeSrc=includeSource(include[1],includeOpts);includeSrc=" ; (function(){"+"\n"+includeSrc+" ; })()"+"\n";self.source+=includeSrc;self.dependencies.push(exports.resolveInclude(include[1],includeOpts.filename));return}}self.scanLine(line)})}},parseTemplateText:function(){var str=this.templateText,pat=this.regex,result=pat.exec(str),arr=[],firstPos,lastPos;while(result){firstPos=result.index;lastPos=pat.lastIndex;if(firstPos!==0){arr.push(str.substring(0,firstPos));str=str.slice(firstPos)}arr.push(result[0]);str=str.slice(result[0].length);result=pat.exec(str)}if(str){arr.push(str)}return arr},scanLine:function(line){var self=this,d=this.opts.delimiter,newLineCount=0;function _addOutput(){if(self.truncate){line=line.replace("\n","");self.truncate=false}else if(self.opts.rmWhitespace){line=line.replace(/^\n/,"")}if(!line){return}line=line.replace(/\\/g,"\\\\");line=line.replace(/\n/g,"\\n");line=line.replace(/\r/g,"\\r");line=line.replace(/"/g,'\\"');self.source+=' ; __append("'+line+'")'+"\n"}newLineCount=line.split("\n").length-1;switch(line){case"<"+d:case"<"+d+"_":this.mode=Template.modes.EVAL;break;case"<"+d+"=":this.mode=Template.modes.ESCAPED;break;case"<"+d+"-":this.mode=Template.modes.RAW;break;case"<"+d+"#":this.mode=Template.modes.COMMENT;break;case"<"+d+d:this.mode=Template.modes.LITERAL;this.source+=' ; __append("'+line.replace("<"+d+d,"<"+d)+'")'+"\n";break;case d+">":case"-"+d+">":case"_"+d+">":if(this.mode==Template.modes.LITERAL){_addOutput()}this.mode=null;this.truncate=line.indexOf("-")===0||line.indexOf("_")===0;break;default:if(this.mode){switch(this.mode){case Template.modes.EVAL:case Template.modes.ESCAPED:case Template.modes.RAW:if(line.lastIndexOf("//")>line.lastIndexOf("\n")){line+="\n"}}switch(this.mode){case Template.modes.EVAL:this.source+=" ; "+line+"\n";break;case Template.modes.ESCAPED:this.source+=" ; __append(escape("+line.replace(_TRAILING_SEMCOL,"").trim()+"))"+"\n";break;case Template.modes.RAW:this.source+=" ; __append("+line.replace(_TRAILING_SEMCOL,"").trim()+")"+"\n";break;case Template.modes.COMMENT:break;case Template.modes.LITERAL:_addOutput();break}}else{_addOutput()}}if(self.opts.compileDebug&&newLineCount){this.currentLine+=newLineCount;this.source+=" ; __line = "+this.currentLine+"\n"}}};exports.__express=exports.renderFile;if(require.extensions){require.extensions[".ejs"]=function(module,filename){filename=filename||module.filename;var options={filename:filename,client:true},template=fs.readFileSync(filename).toString(),fn=exports.compile(template,options);module._compile("module.exports = "+fn.toString()+";",filename)}}exports.VERSION=_VERSION_STRING;if(typeof window!="undefined"){window.ejs=exports}},{"../package.json":6,"./utils":2,fs:3,path:4}],2:[function(require,module,exports){"use strict";var regExpChars=/[|\\{}()[\]^$+*?.]/g;exports.escapeRegExpChars=function(string){if(!string){return""}return String(string).replace(regExpChars,"\\$&")};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>\'"]/g;function encode_char(c){return _ENCODE_HTML_RULES[c]||c}var escapeFuncStr="var _ENCODE_HTML_RULES = {\n"+' "&": "&"\n'+' , "<": "<"\n'+' , ">": ">"\n'+' , \'"\': """\n'+' , "\'": "'"\n'+" }\n"+" , _MATCH_HTML = /[&<>'\"]/g;\n"+"function encode_char(c) {\n"+" return _ENCODE_HTML_RULES[c] || c;\n"+"};\n";exports.escapeXML=function(markup){return markup==undefined?"":String(markup).replace(_MATCH_HTML,encode_char)};exports.escapeXML.toString=function(){return Function.prototype.toString.call(this)+";\n"+escapeFuncStr};exports.shallowCopy=function(to,from){from=from||{};for(var p in from){to[p]=from[p]}return to};exports.cache={_data:{},set:function(key,val){this._data[key]=val},get:function(key){return this._data[key]},reset:function(){this._data={}}}},{}],3:[function(require,module,exports){},{}],4:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i (http://fleegix.org)",contributors:["Timothy Gu (https://timothygu.github.io)"],license:"Apache-2.0",main:"./lib/ejs.js",repository:{type:"git",url:"git://github.com/mde/ejs.git"},bugs:"https://github.com/mde/ejs/issues",homepage:"https://github.com/mde/ejs",dependencies:{},devDependencies:{browserify:"^8.0.3",istanbul:"~0.3.5",jake:"^8.0.0",jsdoc:"^3.3.0-beta1","lru-cache":"^2.5.0",mocha:"^2.1.0",rimraf:"^2.2.8","uglify-js":"^2.4.16"},engines:{node:">=0.10.0"},scripts:{test:"mocha",coverage:"istanbul cover node_modules/mocha/bin/_mocha",doc:"rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*",devdoc:"rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*"}}},{}]},{},[1]);
\ No newline at end of file
diff --git a/nodejs/node_modules/ejs/lib/ejs.js b/nodejs/node_modules/ejs/lib/ejs.js
deleted file mode 100644
index bbd97ba..0000000
--- a/nodejs/node_modules/ejs/lib/ejs.js
+++ /dev/null
@@ -1,723 +0,0 @@
-/*
- * EJS Embedded JavaScript templates
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
-*/
-
-'use strict';
-
-/**
- * @file Embedded JavaScript templating engine.
- * @author Matthew Eernisse
- * @author Tiancheng "Timothy" Gu
- * @project EJS
- * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
- */
-
-/**
- * EJS internal functions.
- *
- * Technically this "module" lies in the same file as {@link module:ejs}, for
- * the sake of organization all the private functions re grouped into this
- * module.
- *
- * @module ejs-internal
- * @private
- */
-
-/**
- * Embedded JavaScript templating engine.
- *
- * @module ejs
- * @public
- */
-
-var fs = require('fs')
- , utils = require('./utils')
- , scopeOptionWarned = false
- , _VERSION_STRING = require('../package.json').version
- , _DEFAULT_DELIMITER = '%'
- , _DEFAULT_LOCALS_NAME = 'locals'
- , _REGEX_STRING = '(<%%|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)'
- , _OPTS = [ 'cache', 'filename', 'delimiter', 'scope', 'context'
- , 'debug', 'compileDebug', 'client', '_with', 'rmWhitespace'
- ]
- , _TRAILING_SEMCOL = /;\s*$/
- , _BOM = /^\uFEFF/;
-
-/**
- * EJS template function cache. This can be a LRU object from lru-cache NPM
- * module. By default, it is {@link module:utils.cache}, a simple in-process
- * cache that grows continuously.
- *
- * @type {Cache}
- */
-
-exports.cache = utils.cache;
-
-/**
- * Name of the object containing the locals.
- *
- * This variable is overriden by {@link Options}`.localsName` if it is not
- * `undefined`.
- *
- * @type {String}
- * @public
- */
-
-exports.localsName = _DEFAULT_LOCALS_NAME;
-
-/**
- * Get the path to the included file from the parent file path and the
- * specified path.
- *
- * @param {String} name specified path
- * @param {String} filename parent file path
- * @return {String}
- */
-
-exports.resolveInclude = function(name, filename) {
- var path = require('path')
- , dirname = path.dirname
- , extname = path.extname
- , resolve = path.resolve
- , includePath = resolve(dirname(filename), name)
- , ext = extname(name);
- if (!ext) {
- includePath += '.ejs';
- }
- return includePath;
-};
-
-/**
- * Get the template from a string or a file, either compiled on-the-fly or
- * read from cache (if enabled), and cache the template if needed.
- *
- * If `template` is not set, the file specified in `options.filename` will be
- * read.
- *
- * If `options.cache` is true, this function reads the file from
- * `options.filename` so it must be set prior to calling this function.
- *
- * @memberof module:ejs-internal
- * @param {Options} options compilation options
- * @param {String} [template] template source
- * @return {(TemplateFunction|ClientFunction)}
- * Depending on the value of `options.client`, either type might be returned.
- * @static
- */
-
-function handleCache(options, template) {
- var fn
- , path = options.filename
- , hasTemplate = arguments.length > 1;
-
- if (options.cache) {
- if (!path) {
- throw new Error('cache option requires a filename');
- }
- fn = exports.cache.get(path);
- if (fn) {
- return fn;
- }
- if (!hasTemplate) {
- template = fs.readFileSync(path).toString().replace(_BOM, '');
- }
- }
- else if (!hasTemplate) {
- // istanbul ignore if: should not happen at all
- if (!path) {
- throw new Error('Internal EJS error: no file name or template '
- + 'provided');
- }
- template = fs.readFileSync(path).toString().replace(_BOM, '');
- }
- fn = exports.compile(template, options);
- if (options.cache) {
- exports.cache.set(path, fn);
- }
- return fn;
-}
-
-/**
- * Get the template function.
- *
- * If `options.cache` is `true`, then the template is cached.
- *
- * @memberof module:ejs-internal
- * @param {String} path path for the specified file
- * @param {Options} options compilation options
- * @return {(TemplateFunction|ClientFunction)}
- * Depending on the value of `options.client`, either type might be returned
- * @static
- */
-
-function includeFile(path, options) {
- var opts = utils.shallowCopy({}, options);
- if (!opts.filename) {
- throw new Error('`include` requires the \'filename\' option.');
- }
- opts.filename = exports.resolveInclude(path, opts.filename);
- return handleCache(opts);
-}
-
-/**
- * Get the JavaScript source of an included file.
- *
- * @memberof module:ejs-internal
- * @param {String} path path for the specified file
- * @param {Options} options compilation options
- * @return {String}
- * @static
- */
-
-function includeSource(path, options) {
- var opts = utils.shallowCopy({}, options)
- , includePath
- , template;
- if (!opts.filename) {
- throw new Error('`include` requires the \'filename\' option.');
- }
- includePath = exports.resolveInclude(path, opts.filename);
- template = fs.readFileSync(includePath).toString().replace(_BOM, '');
-
- opts.filename = includePath;
- var templ = new Template(template, opts);
- templ.generateSource();
- return templ.source;
-}
-
-/**
- * Re-throw the given `err` in context to the `str` of ejs, `filename`, and
- * `lineno`.
- *
- * @implements RethrowCallback
- * @memberof module:ejs-internal
- * @param {Error} err Error object
- * @param {String} str EJS source
- * @param {String} filename file name of the EJS file
- * @param {String} lineno line number of the error
- * @static
- */
-
-function rethrow(err, str, filename, lineno){
- var lines = str.split('\n')
- , start = Math.max(lineno - 3, 0)
- , end = Math.min(lines.length, lineno + 3);
-
- // Error context
- var context = lines.slice(start, end).map(function (line, i){
- var curr = i + start + 1;
- return (curr == lineno ? ' >> ' : ' ')
- + curr
- + '| '
- + line;
- }).join('\n');
-
- // Alter exception message
- err.path = filename;
- err.message = (filename || 'ejs') + ':'
- + lineno + '\n'
- + context + '\n\n'
- + err.message;
-
- throw err;
-}
-
-/**
- * Copy properties in data object that are recognized as options to an
- * options object.
- *
- * This is used for compatibility with earlier versions of EJS and Express.js.
- *
- * @memberof module:ejs-internal
- * @param {Object} data data object
- * @param {Options} opts options object
- * @static
- */
-
-function cpOptsInData(data, opts) {
- _OPTS.forEach(function (p) {
- if (typeof data[p] != 'undefined') {
- opts[p] = data[p];
- }
- });
-}
-
-/**
- * Compile the given `str` of ejs into a template function.
- *
- * @param {String} template EJS template
- *
- * @param {Options} opts compilation options
- *
- * @return {(TemplateFunction|ClientFunction)}
- * Depending on the value of `opts.client`, either type might be returned.
- * @public
- */
-
-exports.compile = function compile(template, opts) {
- var templ;
-
- // v1 compat
- // 'scope' is 'context'
- // FIXME: Remove this in a future version
- if (opts && opts.scope) {
- if (!scopeOptionWarned){
- console.warn('`scope` option is deprecated and will be removed in EJS 3');
- scopeOptionWarned = true;
- }
- if (!opts.context) {
- opts.context = opts.scope;
- }
- delete opts.scope;
- }
- templ = new Template(template, opts);
- return templ.compile();
-};
-
-/**
- * Render the given `template` of ejs.
- *
- * If you would like to include options but not data, you need to explicitly
- * call this function with `data` being an empty object or `null`.
- *
- * @param {String} template EJS template
- * @param {Object} [data={}] template data
- * @param {Options} [opts={}] compilation and rendering options
- * @return {String}
- * @public
- */
-
-exports.render = function (template, data, opts) {
- data = data || {};
- opts = opts || {};
- var fn;
-
- // No options object -- if there are optiony names
- // in the data, copy them to options
- if (arguments.length == 2) {
- cpOptsInData(data, opts);
- }
-
- return handleCache(opts, template)(data);
-};
-
-/**
- * Render an EJS file at the given `path` and callback `cb(err, str)`.
- *
- * If you would like to include options but not data, you need to explicitly
- * call this function with `data` being an empty object or `null`.
- *
- * @param {String} path path to the EJS file
- * @param {Object} [data={}] template data
- * @param {Options} [opts={}] compilation and rendering options
- * @param {RenderFileCallback} cb callback
- * @public
- */
-
-exports.renderFile = function () {
- var args = Array.prototype.slice.call(arguments)
- , path = args.shift()
- , cb = args.pop()
- , data = args.shift() || {}
- , opts = args.pop() || {}
- , result;
-
- // Don't pollute passed in opts obj with new vals
- opts = utils.shallowCopy({}, opts);
-
- // No options object -- if there are optiony names
- // in the data, copy them to options
- if (arguments.length == 3) {
- cpOptsInData(data, opts);
- }
- opts.filename = path;
-
- try {
- result = handleCache(opts)(data);
- }
- catch(err) {
- return cb(err);
- }
- return cb(null, result);
-};
-
-/**
- * Clear intermediate JavaScript cache. Calls {@link Cache#reset}.
- * @public
- */
-
-exports.clearCache = function () {
- exports.cache.reset();
-};
-
-function Template(text, opts) {
- opts = opts || {};
- var options = {};
- this.templateText = text;
- this.mode = null;
- this.truncate = false;
- this.currentLine = 1;
- this.source = '';
- this.dependencies = [];
- options.client = opts.client || false;
- options.escapeFunction = opts.escape || utils.escapeXML;
- options.compileDebug = opts.compileDebug !== false;
- options.debug = !!opts.debug;
- options.filename = opts.filename;
- options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;
- options._with = typeof opts._with != 'undefined' ? opts._with : true;
- options.context = opts.context;
- options.cache = opts.cache || false;
- options.rmWhitespace = opts.rmWhitespace;
- this.opts = options;
-
- this.regex = this.createRegex();
-}
-
-Template.modes = {
- EVAL: 'eval'
-, ESCAPED: 'escaped'
-, RAW: 'raw'
-, COMMENT: 'comment'
-, LITERAL: 'literal'
-};
-
-Template.prototype = {
- createRegex: function () {
- var str = _REGEX_STRING
- , delim = utils.escapeRegExpChars(this.opts.delimiter);
- str = str.replace(/%/g, delim);
- return new RegExp(str);
- }
-
-, compile: function () {
- var src
- , fn
- , opts = this.opts
- , prepended = ''
- , appended = ''
- , escape = opts.escapeFunction;
-
- if (opts.rmWhitespace) {
- // Have to use two separate replace here as `^` and `$` operators don't
- // work well with `\r`.
- this.templateText =
- this.templateText.replace(/\r/g, '').replace(/^\s+|\s+$/gm, '');
- }
-
- // Slurp spaces and tabs before <%_ and after _%>
- this.templateText =
- this.templateText.replace(/[ \t]*<%_/gm, '<%_').replace(/_%>[ \t]*/gm, '_%>');
-
- if (!this.source) {
- this.generateSource();
- prepended += ' var __output = [], __append = __output.push.bind(__output);' + '\n';
- if (opts._with !== false) {
- prepended += ' with (' + exports.localsName + ' || {}) {' + '\n';
- appended += ' }' + '\n';
- }
- appended += ' return __output.join("");' + '\n';
- this.source = prepended + this.source + appended;
- }
-
- if (opts.compileDebug) {
- src = 'var __line = 1' + '\n'
- + ' , __lines = ' + JSON.stringify(this.templateText) + '\n'
- + ' , __filename = ' + (opts.filename ?
- JSON.stringify(opts.filename) : 'undefined') + ';' + '\n'
- + 'try {' + '\n'
- + this.source
- + '} catch (e) {' + '\n'
- + ' rethrow(e, __lines, __filename, __line);' + '\n'
- + '}' + '\n';
- }
- else {
- src = this.source;
- }
-
- if (opts.debug) {
- console.log(src);
- }
-
- if (opts.client) {
- src = 'escape = escape || ' + escape.toString() + ';' + '\n' + src;
- if (opts.compileDebug) {
- src = 'rethrow = rethrow || ' + rethrow.toString() + ';' + '\n' + src;
- }
- }
-
- try {
- fn = new Function(exports.localsName + ', escape, include, rethrow', src);
- }
- catch(e) {
- // istanbul ignore else
- if (e instanceof SyntaxError) {
- if (opts.filename) {
- e.message += ' in ' + opts.filename;
- }
- e.message += ' while compiling ejs';
- }
- throw e;
- }
-
- if (opts.client) {
- fn.dependencies = this.dependencies;
- return fn;
- }
-
- // Return a callable function which will execute the function
- // created by the source-code, with the passed data as locals
- // Adds a local `include` function which allows full recursive include
- var returnedFn = function (data) {
- var include = function (path, includeData) {
- var d = utils.shallowCopy({}, data);
- if (includeData) {
- d = utils.shallowCopy(d, includeData);
- }
- return includeFile(path, opts)(d);
- };
- return fn.apply(opts.context, [data || {}, escape, include, rethrow]);
- };
- returnedFn.dependencies = this.dependencies;
- return returnedFn;
- }
-
-, generateSource: function () {
- var self = this
- , matches = this.parseTemplateText()
- , d = this.opts.delimiter;
-
- if (matches && matches.length) {
- matches.forEach(function (line, index) {
- var opening
- , closing
- , include
- , includeOpts
- , includeSrc;
- // If this is an opening tag, check for closing tags
- // FIXME: May end up with some false positives here
- // Better to store modes as k/v with '<' + delimiter as key
- // Then this can simply check against the map
- if ( line.indexOf('<' + d) === 0 // If it is a tag
- && line.indexOf('<' + d + d) !== 0) { // and is not escaped
- closing = matches[index + 2];
- if (!(closing == d + '>' || closing == '-' + d + '>' || closing == '_' + d + '>')) {
- throw new Error('Could not find matching close tag for "' + line + '".');
- }
- }
- // HACK: backward-compat `include` preprocessor directives
- if ((include = line.match(/^\s*include\s+(\S+)/))) {
- opening = matches[index - 1];
- // Must be in EVAL or RAW mode
- if (opening && (opening == '<' + d || opening == '<' + d + '-' || opening == '<' + d + '_')) {
- includeOpts = utils.shallowCopy({}, self.opts);
- includeSrc = includeSource(include[1], includeOpts);
- includeSrc = ' ; (function(){' + '\n' + includeSrc +
- ' ; })()' + '\n';
- self.source += includeSrc;
- self.dependencies.push(exports.resolveInclude(include[1],
- includeOpts.filename));
- return;
- }
- }
- self.scanLine(line);
- });
- }
-
- }
-
-, parseTemplateText: function () {
- var str = this.templateText
- , pat = this.regex
- , result = pat.exec(str)
- , arr = []
- , firstPos
- , lastPos;
-
- while (result) {
- firstPos = result.index;
- lastPos = pat.lastIndex;
-
- if (firstPos !== 0) {
- arr.push(str.substring(0, firstPos));
- str = str.slice(firstPos);
- }
-
- arr.push(result[0]);
- str = str.slice(result[0].length);
- result = pat.exec(str);
- }
-
- if (str) {
- arr.push(str);
- }
-
- return arr;
- }
-
-, scanLine: function (line) {
- var self = this
- , d = this.opts.delimiter
- , newLineCount = 0;
-
- function _addOutput() {
- if (self.truncate) {
- line = line.replace('\n', '');
- self.truncate = false;
- }
- else if (self.opts.rmWhitespace) {
- // Gotta me more careful here.
- // .replace(/^(\s*)\n/, '$1') might be more appropriate here but as
- // rmWhitespace already removes trailing spaces anyway so meh.
- line = line.replace(/^\n/, '');
- }
- if (!line) {
- return;
- }
-
- // Preserve literal slashes
- line = line.replace(/\\/g, '\\\\');
-
- // Convert linebreaks
- line = line.replace(/\n/g, '\\n');
- line = line.replace(/\r/g, '\\r');
-
- // Escape double-quotes
- // - this will be the delimiter during execution
- line = line.replace(/"/g, '\\"');
- self.source += ' ; __append("' + line + '")' + '\n';
- }
-
- newLineCount = (line.split('\n').length - 1);
-
- switch (line) {
- case '<' + d:
- case '<' + d + '_':
- this.mode = Template.modes.EVAL;
- break;
- case '<' + d + '=':
- this.mode = Template.modes.ESCAPED;
- break;
- case '<' + d + '-':
- this.mode = Template.modes.RAW;
- break;
- case '<' + d + '#':
- this.mode = Template.modes.COMMENT;
- break;
- case '<' + d + d:
- this.mode = Template.modes.LITERAL;
- this.source += ' ; __append("' + line.replace('<' + d + d, '<' + d) + '")' + '\n';
- break;
- case d + '>':
- case '-' + d + '>':
- case '_' + d + '>':
- if (this.mode == Template.modes.LITERAL) {
- _addOutput();
- }
-
- this.mode = null;
- this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0;
- break;
- default:
- // In script mode, depends on type of tag
- if (this.mode) {
- // If '//' is found without a line break, add a line break.
- switch (this.mode) {
- case Template.modes.EVAL:
- case Template.modes.ESCAPED:
- case Template.modes.RAW:
- if (line.lastIndexOf('//') > line.lastIndexOf('\n')) {
- line += '\n';
- }
- }
- switch (this.mode) {
- // Just executing code
- case Template.modes.EVAL:
- this.source += ' ; ' + line + '\n';
- break;
- // Exec, esc, and output
- case Template.modes.ESCAPED:
- this.source += ' ; __append(escape(' +
- line.replace(_TRAILING_SEMCOL, '').trim() + '))' + '\n';
- break;
- // Exec and output
- case Template.modes.RAW:
- this.source += ' ; __append(' +
- line.replace(_TRAILING_SEMCOL, '').trim() + ')' + '\n';
- break;
- case Template.modes.COMMENT:
- // Do nothing
- break;
- // Literal <%% mode, append as raw output
- case Template.modes.LITERAL:
- _addOutput();
- break;
- }
- }
- // In string mode, just add the output
- else {
- _addOutput();
- }
- }
-
- if (self.opts.compileDebug && newLineCount) {
- this.currentLine += newLineCount;
- this.source += ' ; __line = ' + this.currentLine + '\n';
- }
- }
-};
-
-/**
- * Express.js support.
- *
- * This is an alias for {@link module:ejs.renderFile}, in order to support
- * Express.js out-of-the-box.
- *
- * @func
- */
-
-exports.__express = exports.renderFile;
-
-// Add require support
-/* istanbul ignore else */
-if (require.extensions) {
- require.extensions['.ejs'] = function (module, filename) {
- filename = filename || /* istanbul ignore next */ module.filename;
- var options = {
- filename: filename
- , client: true
- }
- , template = fs.readFileSync(filename).toString()
- , fn = exports.compile(template, options);
- module._compile('module.exports = ' + fn.toString() + ';', filename);
- };
-}
-
-/**
- * Version of EJS.
- *
- * @readonly
- * @type {String}
- * @public
- */
-
-exports.VERSION = _VERSION_STRING;
-
-/* istanbul ignore if */
-if (typeof window != 'undefined') {
- window.ejs = exports;
-}
diff --git a/nodejs/node_modules/ejs/lib/utils.js b/nodejs/node_modules/ejs/lib/utils.js
deleted file mode 100644
index 9e2c1d0..0000000
--- a/nodejs/node_modules/ejs/lib/utils.js
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * EJS Embedded JavaScript templates
- * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
-*/
-
-/**
- * Private utility functions
- * @module utils
- * @private
- */
-
-'use strict';
-
-var regExpChars = /[|\\{}()[\]^$+*?.]/g;
-
-/**
- * Escape characters reserved in regular expressions.
- *
- * If `string` is `undefined` or `null`, the empty string is returned.
- *
- * @param {String} string Input string
- * @return {String} Escaped string
- * @static
- * @private
- */
-exports.escapeRegExpChars = function (string) {
- // istanbul ignore if
- if (!string) {
- return '';
- }
- return String(string).replace(regExpChars, '\\$&');
-};
-
-var _ENCODE_HTML_RULES = {
- '&': '&'
- , '<': '<'
- , '>': '>'
- , '"': '"'
- , "'": '''
- }
- , _MATCH_HTML = /[&<>\'"]/g;
-
-function encode_char(c) {
- return _ENCODE_HTML_RULES[c] || c;
-};
-
-/**
- * Stringified version of constants used by {@link module:utils.escapeXML}.
- *
- * It is used in the process of generating {@link ClientFunction}s.
- *
- * @readonly
- * @type {String}
- */
-
-var escapeFuncStr =
- 'var _ENCODE_HTML_RULES = {\n'
-+ ' "&": "&"\n'
-+ ' , "<": "<"\n'
-+ ' , ">": ">"\n'
-+ ' , \'"\': """\n'
-+ ' , "\'": "'"\n'
-+ ' }\n'
-+ ' , _MATCH_HTML = /[&<>\'"]/g;\n'
-+ 'function encode_char(c) {\n'
-+ ' return _ENCODE_HTML_RULES[c] || c;\n'
-+ '};\n';
-
-/**
- * Escape characters reserved in XML.
- *
- * If `markup` is `undefined` or `null`, the empty string is returned.
- *
- * @implements {EscapeCallback}
- * @param {String} markup Input string
- * @return {String} Escaped string
- * @static
- * @private
- */
-
-exports.escapeXML = function (markup) {
- return markup == undefined
- ? ''
- : String(markup)
- .replace(_MATCH_HTML, encode_char);
-};
-exports.escapeXML.toString = function () {
- return Function.prototype.toString.call(this) + ';\n' + escapeFuncStr
-};
-
-/**
- * Copy all properties from one object to another, in a shallow fashion.
- *
- * @param {Object} to Destination object
- * @param {Object} from Source object
- * @return {Object} Destination object
- * @static
- * @private
- */
-exports.shallowCopy = function (to, from) {
- from = from || {};
- for (var p in from) {
- to[p] = from[p];
- }
- return to;
-};
-
-/**
- * Simple in-process cache implementation. Does not implement limits of any
- * sort.
- *
- * @implements Cache
- * @static
- * @private
- */
-exports.cache = {
- _data: {},
- set: function (key, val) {
- this._data[key] = val;
- },
- get: function (key) {
- return this._data[key];
- },
- reset: function () {
- this._data = {};
- }
-};
-
diff --git a/nodejs/node_modules/ejs/package.json b/nodejs/node_modules/ejs/package.json
deleted file mode 100644
index 23a12bb..0000000
--- a/nodejs/node_modules/ejs/package.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "name": "ejs",
- "description": "Embedded JavaScript templates",
- "keywords": [
- "template",
- "engine",
- "ejs"
- ],
- "version": "2.3.4",
- "author": {
- "name": "Matthew Eernisse",
- "email": "mde@fleegix.org",
- "url": "http://fleegix.org"
- },
- "contributors": [
- {
- "name": "Timothy Gu",
- "email": "timothygu99@gmail.com",
- "url": "https://timothygu.github.io"
- }
- ],
- "license": "Apache-2.0",
- "main": "./lib/ejs.js",
- "repository": {
- "type": "git",
- "url": "git://github.com/mde/ejs.git"
- },
- "bugs": {
- "url": "https://github.com/mde/ejs/issues"
- },
- "homepage": "https://github.com/mde/ejs",
- "dependencies": {},
- "devDependencies": {
- "browserify": "^8.0.3",
- "istanbul": "~0.3.5",
- "jake": "^8.0.0",
- "jsdoc": "^3.3.0-beta1",
- "lru-cache": "^2.5.0",
- "mocha": "^2.1.0",
- "rimraf": "^2.2.8",
- "uglify-js": "^2.4.16"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha",
- "coverage": "istanbul cover node_modules/mocha/bin/_mocha",
- "doc": "rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*",
- "devdoc": "rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*"
- },
- "readme": "# EJS\n\nEmbedded JavaScript templates\n\n[](https://travis-ci.org/mde/ejs)\n[](https://david-dm.org/mde/ejs#info=devDependencies)\n\n## Installation\n\n```bash\n$ npm install ejs\n```\n\n## Features\n\n * Control flow with `<% %>`\n * Escaped output with `<%= %>`\n * Unescaped raw output with `<%- %>`\n * Trim-mode ('newline slurping') with `-%>` ending tag\n * Custom delimiters (e.g., use ' ?>' instead of '<% %>')\n * Includes\n * Client-side support\n * Static caching of intermediate JavaScript\n * Static caching of templates\n * Complies with the [Express](http://expressjs.com) view system\n\n## Example\n\n```html\n<% if (user) { %>\n
<%= user.name %>
\n<% } %>\n```\n\n## Usage\n\n```javascript\nvar template = ejs.compile(str, options);\ntemplate(data);\n// => Rendered HTML string\n\nejs.render(str, data, options);\n// => Rendered HTML string\n```\n\nYou can also use the shortcut `ejs.render(dataAndOptions);` where you pass\neverything in a single object. In that case, you'll end up with local variables\nfor all the passed options.\n\n## Options\n\n - `cache` Compiled functions are cached, requires `filename`\n - `filename` Used by `cache` to key caches, and for includes\n - `context` Function execution context\n - `compileDebug` When `false` no debug instrumentation is compiled\n - `client` Returns standalone compiled function\n - `delimiter` Character to use with angle brackets for open/close\n - `debug` Output generated function body\n - `_with` Whether or not to use `with() {}` constructs. If `false` then the locals will be stored in the `locals` object.\n - `rmWhitespace` Remove all safe-to-remove whitespace, including leading\n and trailing whitespace. It also enables a safer version of `-%>` line\n slurping for all scriptlet tags (it does not strip new lines of tags in\n the middle of a line).\n\n## Tags\n\n - `<%` 'Scriptlet' tag, for control-flow, no output\n - `<%=` Outputs the value into the template (HTML escaped)\n - `<%-` Outputs the unescaped value into the template\n - `<%#` Comment tag, no execution, no output\n - `<%%` Outputs a literal '<%'\n - `%>` Plain ending tag\n - `-%>` Trim-mode ('newline slurp') tag, trims following newline\n\n## Includes\n\nIncludes either have to be an absolute path, or, if not, are assumed as\nrelative to the template with the `include` call. (This requires the\n`filename` option.) For example if you are including `./views/user/show.ejs`\nfrom `./views/users.ejs` you would use `<%- include('user/show') %>`.\n\nYou'll likely want to use the raw output tag (`<%-`) with your include to avoid\ndouble-escaping the HTML output.\n\n```html\n
\n```\n\nIncludes are inserted at runtime, so you can use variables for the path in the\n`include` call (for example `<%- include(somePath) %>`). Variables in your\ntop-level data object are available to all your includes, but local variables\nneed to be passed down.\n\nNOTE: Include preprocessor directives (`<% include user/show %>`) are\nstill supported.\n\n## Custom delimiters\n\nCustom delimiters can be applied on a per-template basis, or globally:\n\n```javascript\nvar ejs = require('ejs'),\n users = ['geddy', 'neil', 'alex'];\n\n// Just one template\nejs.render('= users.join(\" | \"); ?>', {users: users}, {delimiter: '?'});\n// => 'geddy | neil | alex'\n\n// Or globally\nejs.delimiter = '$';\nejs.render('<$= users.join(\" | \"); $>', {users: users});\n// => 'geddy | neil | alex'\n```\n\n## Caching\n\nEJS ships with a basic in-process cache for caching the intermediate JavaScript\nfunctions used to render templates. It's easy to plug in LRU caching using\nNode's `lru-cache` library:\n\n```javascript\nvar ejs = require('ejs')\n , LRU = require('lru-cache');\nejs.cache = LRU(100); // LRU cache with 100-item limit\n```\n\nIf you want to clear the EJS cache, call `ejs.clearCache`. If you're using the\nLRU cache and need a different limit, simple reset `ejs.cache` to a new instance\nof the LRU.\n\n## Layouts\n\nEJS does not specifically support blocks, but layouts can be implemented by\nincluding headers and footers, like so:\n\n\n```html\n<%- include('header') -%>\n
\n Title\n
\n
\n My page\n
\n<%- include('footer') -%>\n```\n\n## Client-side support\n\nGo to the [Latest Release](https://github.com/mde/ejs/releases/latest), download\n`./ejs.js` or `./ejs.min.js`.\n\nInclude one of these on your page, and `ejs.render(str)`.\n\n## Related projects\n\nThere are a number of implementations of EJS:\n\n * TJ's implementation, the v1 of this library: https://github.com/tj/ejs\n * Jupiter Consulting's EJS: http://www.embeddedjs.com/\n * EJS Embedded JavaScript Framework on Google Code: https://code.google.com/p/embeddedjavascript/\n * Sam Stephenson's Ruby implementation: https://rubygems.org/gems/ejs\n * Erubis, an ERB implementation which also runs JavaScript: http://www.kuwata-lab.com/erubis/users-guide.04.html#lang-javascript\n\n## License\n\nLicensed under the Apache License, Version 2.0\n()\n\n- - -\nEJS Embedded JavaScript templates copyright 2112\nmde@fleegix.org.\n\n\n",
- "readmeFilename": "README.md",
- "_id": "ejs@2.3.4",
- "dist": {
- "shasum": "f23675dcdcda36d7337cfada2e2303d01e596238"
- },
- "_from": "ejs@>= 0.0.1",
- "_resolved": "https://registry.npmjs.org/ejs/-/ejs-2.3.4.tgz"
-}
diff --git a/nodejs/node_modules/ejs/test/ejs.js b/nodejs/node_modules/ejs/test/ejs.js
deleted file mode 100644
index 0759b10..0000000
--- a/nodejs/node_modules/ejs/test/ejs.js
+++ /dev/null
@@ -1,866 +0,0 @@
-/* jshint mocha: true */
-
-/**
- * Module dependencies.
- */
-
-var ejs = require('..')
- , fs = require('fs')
- , read = fs.readFileSync
- , assert = require('assert')
- , path = require('path')
- , LRU = require('lru-cache');
-
-try {
- fs.mkdirSync(__dirname + '/tmp');
-} catch (ex) {
- if (ex.code !== 'EEXIST') {
- throw ex;
- }
-}
-
-// From https://gist.github.com/pguillory/729616
-function hook_stdio(stream, callback) {
- var old_write = stream.write;
-
- stream.write = (function() {
- return function(string, encoding, fd) {
- callback(string, encoding, fd);
- };
- })(stream.write);
-
- return function() {
- stream.write = old_write;
- };
-}
-
-/**
- * Load fixture `name`.
- */
-
-function fixture(name) {
- return read('test/fixtures/' + name, 'utf8');
-}
-
-/**
- * User fixtures.
- */
-
-var users = [];
-users.push({name: 'geddy'});
-users.push({name: 'neil'});
-users.push({name: 'alex'});
-
-suite('ejs.compile(str, options)', function () {
- test('compile to a function', function () {
- var fn = ejs.compile('
yay
');
- assert.equal(fn(), '
yay
');
- });
-
- test('empty input works', function () {
- var fn = ejs.compile('');
- assert.equal(fn(), '');
- });
-
- test('throw if there are syntax errors', function () {
- try {
- ejs.compile(fixture('fail.ejs'));
- }
- catch (err) {
- assert.ok(err.message.indexOf('compiling ejs') > -1);
-
- try {
- ejs.compile(fixture('fail.ejs'), {filename: 'fail.ejs'});
- }
- catch (err) {
- assert.ok(err.message.indexOf('fail.ejs') > -1);
- return;
- }
- }
- throw new Error('no error reported when there should be');
- });
-
- test('allow customizing delimiter local var', function () {
- var fn;
- fn = ejs.compile('
');
- }
- });
-
- test('not include rethrow() in client mode if compileDebug is false', function () {
- var fn = ejs.compile('
<%= "foo" %>
', {
- client: true
- , compileDebug: false
- });
- // There could be a `rethrow` in the function declaration
- assert((fn.toString().match(/rethrow/g) || []).length <= 1);
- });
-});
-
-suite('ejs.render(str, data, opts)', function () {
- test('render the template', function () {
- assert.equal(ejs.render('
';
- assert.equal(out, expected);
-
- // Same filename, different template, but output
- // should be the same because cache
- file = __dirname + '/tmp/render1.ejs';
- options = {cache: true, filename: file};
- out = ejs.render('
ChangedFile1
', {}, options);
- expected = '
File1
';
- assert.equal(out, expected);
-
- // Different filiename -- output should be different,
- // and previous cache-entry should be evicted
- file = __dirname + '/tmp/render2.ejs';
- options = {cache: true, filename: file};
- out = ejs.render('
File2
', {}, options);
- expected = '
File2
';
- assert.equal(out, expected);
-
- // Entry with first filename should now be out of cache,
- // results should be different
- file = __dirname + '/tmp/render1.ejs';
- options = {cache: true, filename: file};
- out = ejs.render('