Skip to content

abbotto/cmdfu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published