Giter Site home page Giter Site logo

n-cli's Introduction

n-cli NPM version Build Status Dependency Status Coverage Status Donate

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;

Help Demo

API

Demo

https://www.youtube.com/watch?v=m53SlSaP6cs

License

MIT © s-a

n-cli's People

Contributors

s-a avatar dependabot[bot] avatar

Stargazers

William Falk-Wallace avatar Bhavesh Gohel avatar Mathieu M-Gosselin avatar moro-programmer avatar Murat Bastas avatar Alon Valadji avatar Daniel Blendea avatar Eric Terpstra avatar Chad Adams avatar J. J. Knudsen avatar  avatar

Watchers

James Cloos avatar  avatar moro-programmer avatar  avatar

Forkers

aligurbuz

n-cli's Issues

add plugin support

auto adds commandine arg support for
install <node-packagename>
uninstall <node-packagename>

add runcom support

  • search in parent folders for .Xrc.
  • change current directory to path of .Xrc.
  • load .Xrc and trigger ncli.runcom(rc /* object of .Xrc content */).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.