Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Flatiron cli plugin to welcome and show status of the command executed
JavaScript
tree: 49d8940c0e

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README.md
index.js
package.json

README.md

flatiron-cli-ok

Encapsulated logic for showing command status in flatiron CLI apps

Installation

npm install flatiron-cli-ok

Usage

At its core flatiron-cli-ok is a broadway-compatible plugin which can be used by any flatiron cli application

var flatiron = require('flatiron')
  , app = flatiron.app;

app.name = 'app.js';

app.use(flatiron.plugins.cli, {
  usage: 'A simple CLI app using flatiron-cli-ok'
});

app.use(require('flatiron-cli-ok'));

app.start();

If you run the above script

➤ node app.js

The output will start with

info:   Welcome to app.js
info:   It worked if it ends with app.js ok

The output will end with

  • If the command executed successfully
info:   app.js ok
  • If the command executed unsuccessfully
info:   app.js not ok

Show the error

You can give the show option to the plugin if you want to print the err.message passed to the callback

app.use('flatiron-cli-ok', { show: true });

So in case of error, the output will end with

error:  Bad credentials
info:   app.js not ok

IMPORTANT

You have to call the callback in the command, if you want this plugin to show the status

If you like this project, please watch this and follow me.

Testing

npm test

Contributors

Here is a list of Contributors

TODO

I accept pull requests and guarantee a reply back within a day

License

MIT/X11

Bug Reports

Report here. Guaranteed reply within a day.

Contact

Pavan Kumar Sunkara (pavan.sss1991@gmail.com)

Follow me on github, twitter

Something went wrong with that request. Please try again.