Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

command-line-tool

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

command-line-tool

command-line-tool

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
79K
decreased by-45.9%
Maintainers
1
Weekly downloads
 
Created
Source

view on npm npm module downloads Build Status Dependency Status js-standard-style

command-line-tool

Some conventional operations used in command-line tools.

  • command-line-tool
    • CommandLineTool
      • .stop([message])
      • .printError(message)
      • .halt([err], [options])
      • .getCli(definitions, [usageSections], [argv])object

CommandLineTool ⏏

Kind: Exported class

tool.stop([message])

Print the supplied messages then stop the process (no exit code).

Kind: instance method of CommandLineTool

ParamTypeDescription
[message]string | Array.<string>One or more messages to be written to stderr before exiting. May contain ansi.format markup.

tool.printError(message)

Prints one or more strings in red to stderr.

Kind: instance method of CommandLineTool

ParamTypeDescription
messagestring | Array.<string>input message(s)

tool.halt([err], [options])

Stop the process with an error message.

Kind: instance method of CommandLineTool

ParamTypeDescription
[err]Errorthe error instance
[options]object
[options.exitCode]numberdefaults to 1
[options.stack]booleandefaults to false

tool.getCli(definitions, [usageSections], [argv]) ⇒ object

Parse the command-line options.

Kind: instance method of CommandLineTool

ParamTypeDescription
definitionsArray.<OptionDefinitions>to be passed to command-line-args
[usageSections]Array.<section>to be passed to command-line-usage
[argv]Array.<string>If supplied, this argv array is parsed instead of process.argv.

© 2015-16 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.

FAQs

Package last updated on 23 Jul 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc