Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.wrap(100);
if (process.stdin.isTTY) {
// running in TTY mode, get template from non-positional argument
yargs
.usage('Usage: mgeneratejs [template]')
.demand(1, 'must provide a template file or string');
} else {
yargs.usage('Usage: mgeneratejs < [template]');
}
var argv = yargs.argv;
var template;
var stringifyStream = argv.jsonArray
? eJSONStringifyStream('[\n ', ',\n ', '\n]\n')
: eJSONStringifyStream('', '\n', '\n');
function generate() {
es.readable(function(count, callback) {
if (count >= argv.number) {
return this.emit('end');
}
this.emit('data', mgenerate(template));
callback();
})
.pipe(stringifyStream)
.pipe(process.stdout);
}
if (process.stdin.isTTY) {
var str = argv._[0];
template = _.startsWith(str, '{')
.strict()
.wrap(100);
if (process.stdin.isTTY) {
// running in TTY mode, get template from non-positional argument
yargs
.usage('Usage: mgeneratejs [template]')
.demand(1, 'must provide a template file or string');
} else {
yargs.usage('Usage: mgeneratejs < [template]');
}
var argv = yargs.argv;
var template;
var stringifyStream = argv.jsonArray
? eJSONStringifyStream('[\n ', ',\n ', '\n]\n')
: eJSONStringifyStream('', '\n', '\n');
function generate() {
es.readable(function(count, callback) {
if (count >= argv.number) {
return this.emit('end');
}
this.emit('data', mgenerate(template));
callback();
})
.pipe(stringifyStream)
.pipe(process.stdout);
}
if (process.stdin.isTTY) {
var str = argv._[0];