Hostile 99% javascript Download

sails-generate 2.0.3

“Runner script for sails generators”

Basename is uppercase README.mdCaret or XOR operation token in source

Evidence

Markdown references a remote image README.md · lines 1–32
1# sails-generate
2
3Master of ceremonies for generators in the Sails CLI.
4This is a built-in module within the Sails framework, used by the `sails` command-line interface. It is installed automatically when you run `npm install sails -g`.
5For customization options, see [Extending Sails > Generators](https://sailsjs.com/documentation/concepts/extending-sails/generators).
6
7
8## Help
9
10If you have further questions or are having trouble, click [here](https://sailsjs.com/support).
11
12
⋯5 lines
18## Contributing
19
20Please observe the guidelines and conventions laid out in the [Sails project contribution guide](https://sailsjs.com/documentation/contributing) when opening issues or submitting pull requests.
21
22[![NPM](https://nodei.co/npm/sails-generate.png?downloads=true)](http://npmjs.com/package/sails-generate)
23
24
⋯8 lines
Reads Node.js version through process.version IS_CURRENT_NODE_VERSION_CAPABLE_OF_AWAIT.js · lines 1–11
1/**
2 * IS_CURRENT_NODE_VERSION_CAPABLE_OF_AWAIT()
3 *
4 * @type {Boolean}
5 */
6
7var RX_NODE_MAJOR_DOT_MINOR = /^v([^.]+)\.([^.]+)\./;
8var major = +(process.version.match(RX_NODE_MAJOR_DOT_MINOR)[1]);
9var minor = +(process.version.match(RX_NODE_MAJOR_DOT_MINOR)[2]);
10module.exports = (major >= 8) || (major >= 7 && minor >= 9);
11
imports fs-extra index.js · lines 1–48
1/**
2 * Module dependencies
3 */
4
5var path = require('path');
6var _ = require('@sailshq/lodash');
7var fsx = require('fs-extra');
8var reportback = require('reportback')();
9
10
11
12/**
13 * Copy file from one place to another.
14 *
15 * @required {String} rootPath
16 * The absolute path of the destination for the copied file.
17 *
18 * @required {String} templatePath
⋯12 lines
31 */
32
33module.exports = function(options, sb) {
34 sb = reportback.extend(sb, {
35 alreadyExists: 'error',
36 invalid: 'error'
37 });
38
39 // Validate options and provide defaults.
40 if (_.isUndefined(options.templatePath)) {
41 return sb.invalid(new Error('Consistency violation: `templatePath` is required'));
⋯7 lines
Joins values with a dot separator index.js · lines 88–95
88:78… re recombining.
89 // (We'll unwind this later for most of the things.)
90 scope.actionName = _.map(scope.actionName.split('.'), function (segment){
91 return _.camelCase(segment);
92 }).join('.');
93
94 // After transformation, the actionName must contain only letters, numbers, and dots--
95 // and start with a lowercased …
Literal JavaScript filename extension index.js · lines 112–124
112:52… rd; }
113 return _.kebabCase(word);
114 }).join('-');
115 }).join('/');
116 // (And of course, finally, we tack on `.js` at the end-- we're not barbarians after all.)
117 scope.relPath += '.js';
118
119 // Grab the filename for potential use in our template.
120 scope.filename = path.basename(scope.relPath);
121
122
123 // Identify the action "stem" for use below.
124 // (e.g. "view-stuff-and …

Showing the top 5 files — 8 more files (97 regions) not shown.

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.