Home

Awesome

flatiron-cli-version

Encapsulated commands for version in flatiron CLI apps

Installation

npm install flatiron-cli-version

Usage

At its core flatiron-cli-version is a broadway-compatible plugin which can be used by any flatiron application. This modules uses pkginfo to read package.json to set app.name and app.version

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

// Expose CLI commands using `flatiron-cli-version`
app.use(require('flatiron-cli-version'));

// Configure the Application to be a CLI app with
app.use(flatiron.plugins.cli, {
  usage: 'A simple CLI app using flatiron-cli-version'
});

app.start();

So, you can run the above script as:

➤ appname -v
0.1.0
➤ appname --version
0.1.0

Set options.route to true

app.use(require('flatiron-cli-version'), { route: true });

for the following routes (commands) to work

➤ appname version
info:	appname v0.1.0
➤ appname help version
help:	Display app version
help:
help:	appname version

If you want pkginfo to set more than name and version, use options.keys

app.use(require('flatrion-cli-version'), { keys: ['repository'] });

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