cmdfu

0.0.2 • Public • Published

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

Package Sidebar

Install

npm i cmdfu

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • abbotto