Skip to content

cravler/x-commander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

x-commander

Extended version of commander.js

Installation

npm install x-commander

Usage

const { program } = require('x-commander');

// defaults
program.configureHelp({
    labels: {
        usage: 'Usage:',
        description: undefined,
        arguments: 'Arguments:',
        options: 'Options:',
        commands: 'Commands:',
    },
    styles: {
        label: str => str,
        usage: str => str,
        description: str => str,
        term: str => str,
        termDescription: str => str,
    },
    formatParams: {
        newLineUsage: false,
        indentDescription: false,
        baseIndentWidth: 0,
        itemIndentWidth: 2,
        itemSeparatorWidth: 2,
        minColumnWidthForWrap: 40,
    },
    formatHelp(cmd, helper) {
        return helper.renderHelpTemplate(cmd, helper);
    }
});

License

MIT

About

node.js command-line interfaces made easy

Resources

License

Stars

Watchers

Forks

Packages

No packages published