1.2.20 • Published 3 years ago
n-cli v1.2.20
n-cli
a usefull toolset for node commandline applications
Installation
$ npm install --save n-cli
Usage
#!/usr/bin/env node
"use strict";
var Cli = new require("n-cli");
var cli = new Cli({
silent: false,
handleUncaughtException : true, // beautifies error output to console
handledRejectionPromiseError : true, // beautifyies error output to console
runcom : ".myapprc"
});
cli.on("unicorn", function(){
this.argv.notNull("rainbow");
this.log(this);
});
cli.runcom(function(rc){
this.log(rc);
});
$ your-client-app unicorn --rainbow forever;
# yields :
{
prettyError:
PrettyError { },
init:
{ appname: 'node-cli-example-app-1',
handleUncaughtException: true },
argv: { _: [ 'unicorn' ], rainbow: 'e', notNull: [Function: bound ] },
config:
{ settings: {},
appFolder: 'c:\\git\\n-cli\\examples',
appPackageFilename: 'c:\\git\\n-cli\\examples\\package.json',
appPackage: {},
appName: 'node-cli-example-app-1',
dataFolder: 'C:\\Users\\User\\AppData\\Roaming\\node-cli-example-app-1',
filename: 'C:\\Users\\User\\AppData\\Roaming\\node-cli-example-app-1\\config.json' },
color:
Chalk { },
Error: [Function: NodeCliError],
minimist: [Function]
}
$ your-client-app unicorn --rainbow ;
# yields : missing-parameter-value missing value for parameter rainbow.
Build in functions
ncli adds automatically some methods to your commandline application.
# output your version number
$ your-client-app -v;
Output COMMANDLINE-ARGUMENTS.md in your projects root folder
$ your-client-app help;
API
Demo
https://www.youtube.com/watch?v=m53SlSaP6cs
License
MIT © s-a
1.2.20
3 years ago
1.2.18
4 years ago
1.2.19
4 years ago
1.2.16
7 years ago
1.2.15
7 years ago
1.2.14
7 years ago
1.2.13
7 years ago
1.2.12
7 years ago
1.2.11
7 years ago
1.2.10
7 years ago
1.2.9
7 years ago
1.2.8
7 years ago
1.2.7
8 years ago
1.2.6
8 years ago
1.2.5
8 years ago
1.2.4
8 years ago
1.2.3
8 years ago
1.2.2
8 years ago
1.2.1
8 years ago
1.0.8
8 years ago
1.0.7
8 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago