New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bleed-believer/commander

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bleed-believer/commander

A package to create CLI applications.

  • 0.0.5
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
decreased by-4.35%
Maintainers
1
Weekly downloads
 
Created
Source

@bleed-believer/commander

A package to create CLI applications.

Creating a command

A command is a class that will be instanciated by the Commander instance when the arguments passed to the execution matches with the pattern declaren in the key "main". If this class is found by the Commander instance, then an instance of the command class will be created, and the method this.start(...) will be called.

import { Command, Executable, Argv, ArgvData } from '@bleed-believer/commander';

@Command({
    // The arguments pattern of this command.
    main: 'test',

    // A friendly name for this command.
    name: 'Test Project'
})
export class TestCommand implements Executable {
    // If this command is found, this method will be launched
    start(argv: Argv, data: ArgvData): void {
        console.log('This is the test command!');
    }
}

Command templates

To declare a command, do you need to define its main template. The template is a string that the library try to match with the arguments given by the user. For example:

# Template
test command

# Valid user input examples
node ./dist test command

Wildcard ":"

Use this for receive any value, for example:

# Template
cp :input :output

# Valid user input examples
node ./dist cp ./file-a.txt ./file-b.txt
node ./dist cp ./aaaa.mp3 ./bbbb.mp3

Keywords

FAQs

Package last updated on 08 Feb 2022

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