HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/RImmers2/portal.photomenu.nl/wwwroot/node_modules/repeating/cli.js
#!/usr/bin/env node
'use strict';
var pkg = require('./package.json');
var repeating = require('./');
var argv = process.argv.slice(2);

function help() {
	console.log([
		'',
		'  ' + pkg.description,
		'',
		'  Usage',
		'    $ repeating <string> <count>',
		'',
		'  Example',
		'    $ repeating \'unicorn \' 2',
		'    unicorn unicorn'
	].join('\n'));
}

if (process.argv.indexOf('--help') !== -1) {
	help();
	return;
}

if (process.argv.indexOf('--version') !== -1) {
	console.log(pkg.version);
	return;
}

if (!argv[1]) {
	console.error('You have to define how many times to repeat the string.');
	process.exit(1);
}

console.log(repeating(argv[0], Number(argv[1])));