0.0.2 • Published 7 years ago

cmdfu v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

Command-line options parser for NodeJS functions

Package Information

NPM version GitHub version

Usage

Write flexible scripts that can be called in multiple ways:

const fu = require('cmdfu');
const sh = require('shellcmd');
const myObject = { who: { am: {}}};

myObject.who.am.i = () => {
	console.log('You are:');
	sh('whoami');
};

module.exports = fu.export(
	myObject,
	fu.params()
);

The above example can be run from another script...

require('myScript').who.am.i();

... and it can also be run in the terminal

node myScript.js who am i