-
Notifications
You must be signed in to change notification settings - Fork 0
/
commandLineRunExample.js
31 lines (28 loc) · 1000 Bytes
/
commandLineRunExample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Command Line execution Example
// Nicola Zordan 6/18/2020
// must install to use this
// npm install commandlinerun
// load nmodule
var commandLineRun=require('commandlinerun');
// execuution
commandLineRun({
null: function () {
console.log('Default execution of app, no parameters or null action: \n',Array.from(arguments));
},
"logExample": console.log,
"log": console.log,
"write": function () { console.log("writing:",Array.from(arguments)); },
"write1": function (first) { console.log("writing1:",first); },
"concat": function () {console.log("contatenating parameters:",Array.from(arguments).join(''))},
"a": {
"log": console.log,
"b": {
"c": function () {console.log('3rd level')},
"log": console.log,
},
"nofunction": null,
"nostring": 'a.nostring',
},
});
// usage from the command line
// node commandLineRunExample.js log "this is an example of" commandLine execution