Socket
Socket
Sign inDemoInstall

protogram-help

Package Overview
Dependencies
7
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    protogram-help

Auto-generate program usage info when using the protogram module


Version published
Weekly downloads
4.3K
decreased by-17.8%
Maintainers
1
Install size
118 kB
Created
Weekly downloads
 

Readme

Source

protogram-help

Build Status

A simple to use, help module to auto generate usage info when using the protogram module for node.js.

Installation

npm install --save protogram-help

Basic Usage

Include with Protogram

var program = require('protogram').create();
var help = require('protogram-help');

Configure Your Help (if you want)

help.set({
    version: '0.0.3',
    name: 'Protogram Help Example',
    handleError: true
});

Add as an Option Flag

program
    .command('*', { includeRoot: true })
    .option('--help', help);

Done.

API

help.set(options)

Sets certain options that will be used to handle the display of usage information.

  • options Object:
    • version String: Your program's version number.
    • name String: The name of your program.
    • handleError Boolean: Output usage information for your program if there is an argument error.
help.set({
    version: '0.0.3',
    name: 'Protogram Help Example',
    handleError: true
});

Or use it directly when setting your --help option:

program
    .command('*', { includeRoot: true })
    .option('--help', help.set({
        version: '0.0.3',
        name: 'Protogram Help Example',
        handleError: true
    }));

help.version

Alternative to help.set({version: xxx })

help.version = '0.0.3';

help.name

Alternative to help.set({name: xxx })

help.name = 'Protogram Help Example';

help.handleError

Alternative to help.set({handleError: xxx })

help.handleError = true;

License

The MIT License (MIT) Copyright (c) 2014 Arjun Mehta

Keywords

FAQs

Last updated on 10 Jan 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc