update to state of the art
This commit is contained in:
6
node_modules/ejs/README.md
generated
vendored
6
node_modules/ejs/README.md
generated
vendored
@@ -259,7 +259,7 @@ See the [examples folder](https://github.com/mde/ejs/tree/master/examples) for m
|
||||
|
||||
## CLI
|
||||
|
||||
EJS ships with a full-featured CLI. Available options are similar to those used in JavaScript code:
|
||||
EJS ships with a full-featured CLI. Options are similar to those used in JavaScript code:
|
||||
|
||||
- `-o / --output-file FILE` Write the rendered output to FILE rather than stdout.
|
||||
- `-f / --data-file FILE` Must be JSON-formatted. Use parsed input from FILE as data for rendering.
|
||||
@@ -290,8 +290,8 @@ There is a variety of ways to pass the CLI data for rendering.
|
||||
Stdin:
|
||||
|
||||
```shell
|
||||
$ ./test/fixtures/user_data.json | ./bin/cli.js ./test/fixtures/user.ejs
|
||||
$ ./bin/cli.js ./test/fixtures/user.ejs < test/fixtures/user_data.json
|
||||
$ ./test/fixtures/user_data.json | ejs ./test/fixtures/user.ejs
|
||||
$ ejs ./test/fixtures/user.ejs < test/fixtures/user_data.json
|
||||
```
|
||||
|
||||
A data file:
|
||||
|
8
node_modules/ejs/bin/cli.js
generated
vendored
8
node_modules/ejs/bin/cli.js
generated
vendored
@@ -23,6 +23,7 @@ delete global.jake; // NO NOT WANT
|
||||
program.setTaskNames = function (n) { this.taskNames = n; };
|
||||
|
||||
let ejs = require('../lib/ejs');
|
||||
let { hyphenToCamel } = require('../lib/utils');
|
||||
let fs = require('fs');
|
||||
let args = process.argv.slice(2);
|
||||
let usage = fs.readFileSync(`${__dirname}/../usage.txt`).toString();
|
||||
@@ -126,7 +127,7 @@ function run() {
|
||||
let pOpts = {};
|
||||
|
||||
for (let p in program.opts) {
|
||||
let name = p.replace(/-[a-z]/g, (match) => { return match[1].toUpperCase(); });
|
||||
let name = hyphenToCamel(p);
|
||||
pOpts[name] = program.opts[p];
|
||||
}
|
||||
|
||||
@@ -135,7 +136,7 @@ function run() {
|
||||
|
||||
// Same-named 'passthrough' opts
|
||||
CLI_OPTS.forEach((opt) => {
|
||||
let optName = opt.full;
|
||||
let optName = hyphenToCamel(opt.full);
|
||||
if (opt.passThrough && typeof pOpts[optName] != 'undefined') {
|
||||
opts[optName] = pOpts[optName];
|
||||
}
|
||||
@@ -148,6 +149,9 @@ function run() {
|
||||
}
|
||||
}
|
||||
|
||||
// Default to having views relative from the current working directory
|
||||
opts.views = ['.'];
|
||||
|
||||
// Ensure there's a template to render
|
||||
if (!templatePath) {
|
||||
throw new Error('Please provide a template path. (Run ejs -h for help)');
|
||||
|
17
node_modules/ejs/ejs.js
generated
vendored
17
node_modules/ejs/ejs.js
generated
vendored
@@ -1107,6 +1107,18 @@ exports.cache = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Transforms hyphen case variable into camel case.
|
||||
*
|
||||
* @param {String} string Hyphen case string
|
||||
* @return {String} Camel case string
|
||||
* @static
|
||||
* @private
|
||||
*/
|
||||
exports.hyphenToCamel = function (str) {
|
||||
return str.replace(/-[a-z]/g, function (match) { return match[1].toUpperCase(); });
|
||||
};
|
||||
|
||||
},{}],3:[function(require,module,exports){
|
||||
|
||||
},{}],4:[function(require,module,exports){
|
||||
@@ -1610,7 +1622,7 @@ module.exports={
|
||||
"engine",
|
||||
"ejs"
|
||||
],
|
||||
"version": "3.1.3",
|
||||
"version": "3.1.5",
|
||||
"author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
@@ -1641,8 +1653,7 @@ module.exports={
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"postinstall": "node --harmony ./postinstall.js"
|
||||
"test": "mocha"
|
||||
}
|
||||
}
|
||||
|
||||
|
2
node_modules/ejs/ejs.min.js
generated
vendored
2
node_modules/ejs/ejs.min.js
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/ejs/jakefile.js
generated
vendored
1
node_modules/ejs/jakefile.js
generated
vendored
@@ -60,7 +60,6 @@ publishTask('ejs', ['build'], function () {
|
||||
'README.md',
|
||||
'LICENSE',
|
||||
'package.json',
|
||||
'postinstall.js',
|
||||
'ejs.js',
|
||||
'ejs.min.js',
|
||||
'lib/**',
|
||||
|
12
node_modules/ejs/lib/utils.js
generated
vendored
12
node_modules/ejs/lib/utils.js
generated
vendored
@@ -165,3 +165,15 @@ exports.cache = {
|
||||
this._data = {};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Transforms hyphen case variable into camel case.
|
||||
*
|
||||
* @param {String} string Hyphen case string
|
||||
* @return {String} Camel case string
|
||||
* @static
|
||||
* @private
|
||||
*/
|
||||
exports.hyphenToCamel = function (str) {
|
||||
return str.replace(/-[a-z]/g, function (match) { return match[1].toUpperCase(); });
|
||||
};
|
||||
|
24
node_modules/ejs/package.json
generated
vendored
24
node_modules/ejs/package.json
generated
vendored
@@ -1,26 +1,27 @@
|
||||
{
|
||||
"_from": "ejs@^3.1.3",
|
||||
"_id": "ejs@3.1.3",
|
||||
"_from": "ejs@latest",
|
||||
"_id": "ejs@3.1.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-wmtrUGyfSC23GC/B1SMv2ogAUgbQEtDmTIhfqielrG5ExIM9TP4UoYdi90jLF1aTcsWCJNEO0UrgKzP0y3nTSg==",
|
||||
"_integrity": "sha512-dldq3ZfFtgVTJMLjOe+/3sROTzALlL9E34V4/sDtUd/KlBSS0s6U1/+WPE1B4sj9CXHJpL1M6rhNJnc9Wbal9w==",
|
||||
"_location": "/ejs",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "ejs@^3.1.3",
|
||||
"raw": "ejs@latest",
|
||||
"name": "ejs",
|
||||
"escapedName": "ejs",
|
||||
"rawSpec": "^3.1.3",
|
||||
"rawSpec": "latest",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.1.3"
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.3.tgz",
|
||||
"_shasum": "514d967a8894084d18d3d47bd169a1c0560f093d",
|
||||
"_spec": "ejs@^3.1.3",
|
||||
"_resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.5.tgz",
|
||||
"_shasum": "aed723844dc20acb4b170cd9ab1017e476a0d93b",
|
||||
"_spec": "ejs@latest",
|
||||
"_where": "D:\\Projects\\vanillajs-seed",
|
||||
"author": {
|
||||
"name": "Matthew Eernisse",
|
||||
@@ -66,9 +67,8 @@
|
||||
"url": "git://github.com/mde/ejs.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node --harmony ./postinstall.js",
|
||||
"test": "mocha"
|
||||
},
|
||||
"unpkg": "ejs.min.js",
|
||||
"version": "3.1.3"
|
||||
"version": "3.1.5"
|
||||
}
|
||||
|
17
node_modules/ejs/postinstall.js
generated
vendored
17
node_modules/ejs/postinstall.js
generated
vendored
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
'use strict';
|
||||
|
||||
function isTrue(value) {
|
||||
return !!value && value !== '0' && value !== 'false';
|
||||
}
|
||||
|
||||
let envDisable = isTrue(process.env.DISABLE_OPENCOLLECTIVE) || isTrue(process.env.CI);
|
||||
let logLevel = process.env.npm_config_loglevel;
|
||||
let logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel) > -1;
|
||||
|
||||
if (!(envDisable || logLevelDisplay)) {
|
||||
console.log('Thank you for installing \u001b[35mEJS\u001b[0m: built with the \u001b[32mJake\u001b[0m JavaScript build tool (\u001b[32mhttps://jakejs.com/\u001b[0m\)\n');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user