Initial commit

This commit is contained in:
Patrick Marsceill
2017-03-09 13:16:08 -05:00
commit b7b0d0d7bf
4147 changed files with 401224 additions and 0 deletions

10
node_modules/yargs/example/bool.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env node
var util = require('util');
var argv = require('yargs').argv;
if (argv.s) {
util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');
}
console.log(
(argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')
);

7
node_modules/yargs/example/boolean_double.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env node
var argv = require('yargs')
.boolean(['x','y','z'])
.argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);

7
node_modules/yargs/example/boolean_single.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env node
var argv = require('yargs')
.boolean('v')
.argv
;
console.dir(argv.v);
console.dir(argv._);

15
node_modules/yargs/example/count.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env node
var argv = require('yargs')
.count('verbose')
.alias('v', 'verbose')
.argv;
VERBOSE_LEVEL = argv.verbose;
function WARN() { VERBOSE_LEVEL >= 0 && console.log.apply(console, arguments); }
function INFO() { VERBOSE_LEVEL >= 1 && console.log.apply(console, arguments); }
function DEBUG() { VERBOSE_LEVEL >= 2 && console.log.apply(console, arguments); }
WARN("Showing only important stuff");
INFO("Showing semi-important stuff too");
DEBUG("Extra chatty mode");

8
node_modules/yargs/example/default_hash.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env node
var argv = require('yargs')
.default({ x : 10, y : 10 })
.argv
;
console.log(argv.x + argv.y);

7
node_modules/yargs/example/default_singles.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env node
var argv = require('yargs')
.default('x', 10)
.default('y', 10)
.argv
;
console.log(argv.x + argv.y);

5
node_modules/yargs/example/demand_count.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env node
var argv = require('yargs')
.demand(2)
.argv;
console.dir(argv)

8
node_modules/yargs/example/divide.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env node
var argv = require('yargs')
.usage('Usage: $0 -x [num] -y [num]')
.demand(['x','y'])
.argv;
console.log(argv.x / argv.y);

27
node_modules/yargs/example/help.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
var yargs = require('../index');
var argv = yargs
.usage('This is my awesome program\n\nUsage: $0 [options]')
.help('help').alias('help', 'h')
.version('1.0.1', 'version').alias('version', 'V')
.options({
input: {
alias: 'i',
description: "<filename> Input file name",
requiresArg: true,
required: true
},
output: {
alias: 'o',
description: "<filename> output file name",
requiresArg: true,
required: true
}
})
.argv;
console.log('Inspecting options');
console.dir(argv);
console.log("input:", argv.input);
console.log("output:", argv.output);

10
node_modules/yargs/example/implies.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env node
var argv = require('yargs')
.usage('Usage: $0 -x [num] -y [num]')
.implies('x', 'y')
.argv;
if (argv.x) {
console.log(argv.x / argv.y);
}

26
node_modules/yargs/example/implies_hash.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env node
var argv = require('yargs')
.usage('Usage: $0 -x [num] -y [num] -w [msg] -h [msg]')
.implies({
x: 'y',
w: '--no-h',
1: 'h'
})
.argv;
if (argv.x) {
console.log('x / y : ' + (argv.x / argv.y));
}
if (argv.y) {
console.log('y: ' + argv.y);
}
if (argv.w) {
console.log('w: ' +argv.w);
}
if (argv.h) {
console.log('h: ' +argv.h);
}

20
node_modules/yargs/example/line_count.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env node
var argv = require('yargs')
.usage('Count the lines in a file.\nUsage: $0')
.demand('f')
.alias('f', 'file')
.describe('f', 'Load a file')
.argv
;
var fs = require('fs');
var s = fs.createReadStream(argv.file);
var lines = 0;
s.on('data', function (buf) {
lines += buf.toString().match(/\n/g).length;
});
s.on('end', function () {
console.log(lines);
});

29
node_modules/yargs/example/line_count_options.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env node
var argv = require('yargs')
.usage('Count the lines in a file.\nUsage: $0')
.options({
file : {
demand : true,
alias : 'f',
description : 'Load a file'
},
base : {
alias : 'b',
description : 'Numeric base to use for output',
default : 10,
},
})
.argv
;
var fs = require('fs');
var s = fs.createReadStream(argv.file);
var lines = 0;
s.on('data', function (buf) {
lines += buf.toString().match(/\n/g).length;
});
s.on('end', function () {
console.log(lines.toString(argv.base));
});

29
node_modules/yargs/example/line_count_wrap.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env node
var argv = require('yargs')
.usage('Count the lines in a file.\nUsage: $0')
.wrap(80)
.demand('f')
.alias('f', [ 'file', 'filename' ])
.describe('f',
"Load a file. It's pretty important."
+ " Required even. So you'd better specify it."
)
.alias('b', 'base')
.describe('b', 'Numeric base to display the number of lines in')
.default('b', 10)
.describe('x', 'Super-secret optional parameter which is secret')
.default('x', '')
.argv
;
var fs = require('fs');
var s = fs.createReadStream(argv.file);
var lines = 0;
s.on('data', function (buf) {
lines += buf.toString().match(/\n/g).length;
});
s.on('end', function () {
console.log(lines.toString(argv.base));
});

4
node_modules/yargs/example/nonopt.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
var argv = require('yargs').argv;
console.log('(%d,%d)', argv.x, argv.y);
console.log(argv._);

19
node_modules/yargs/example/requires_arg.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
var yargs = require('yargs');
var argv = yargs.usage('This is my awesome program', {
'input': {
description: 'Input file name',
requiresArg: true,
short: 'i',
},
'output': {
description: 'Output file name',
requiresArg: true,
short: 'o'
}
}).argv;
yargs.showHelp();
console.log('\n\nInspecting options');
console.dir(argv);

3
node_modules/yargs/example/short.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
var argv = require('yargs').argv;
console.log('(%d,%d)', argv.x, argv.y);

19
node_modules/yargs/example/strict.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
var yargs = require('yargs');
var argv = yargs.usage('This is my awesome program', {
'about': {
description: 'Provide some details about the author of this program',
boolean: true,
short: 'a',
},
'info': {
description: 'Provide some information about this program',
boolean: true,
short: 'i'
}
}).strict().argv;
yargs.showHelp();
console.log('\n\nInspecting options');
console.dir(argv);

11
node_modules/yargs/example/string.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env node
var argv = require('yargs')
.string('x', 'y')
.argv
;
console.dir([ argv.x, argv.y ]);
/* Turns off numeric coercion:
./node string.js -x 000123 -y 9876
[ '000123', '9876' ]
*/

19
node_modules/yargs/example/usage-options.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
var yargs = require('yargs');
var argv = yargs.usage('This is my awesome program', {
'about': {
description: 'Provide some details about the author of this program',
required: true,
alias: 'a',
},
'info': {
description: 'Provide some information about the node.js agains!!!!!!',
boolean: true,
alias: 'i'
}
}).argv;
yargs.showHelp();
console.log('\n\nInspecting options');
console.dir(argv);

9
node_modules/yargs/example/xup.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env node
var argv = require('yargs').argv;
if (argv.rif - 5 * argv.xup > 7.138) {
console.log('Buy more riffiwobbles');
}
else {
console.log('Sell the xupptumblers');
}