Socket
Socket
Sign inDemoInstall

commander-jsx

Package Overview
Dependencies
202
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    commander-jsx

Command-line Arguments Parser with JSX support


Version published
Weekly downloads
9
decreased by-30.77%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

CommanderJSX

Command-line Arguments Parser with JSX support

NPM Dependency CI & CD

NPM

Example

index.tsx

import { Command, createCommand } from 'commander-jsx';

Command.execute(
    <Command
        name="git"
        version="2.10.0"
        parameters="[command] [options]"
        description="Distributed Version Control system"
    >
        <Command
            name="remote"
            description='Manage the set of repositories ("remotes") whose branches you track'
        >
            <Command
                name="add"
                description="Adds a remote named <name> for the repository at <url>"
                options={{
                    tree: {
                        shortcut: 't',
                        parameters: '<branch>',
                        pattern: /^\w+$/,
                        description: 'Branch tree'
                    }
                }}
                executor={({ tree }, name, url) => console.log(tree, name, url)}
            />
        </Command>
    </Command>,
    process.argv.slice(2)
);

tsconfig.json

{
    "compilerOptions": {
        "module": "CommonJS",
        "moduleResolution": "Node",
        "jsx": "react",
        "jsxFactory": "createCommand",
        "target": "ES2017",
        "outDir": "dist/"
    }
}

Then, run git help in your terminal, it'll outputs:

git [command] [options]

Distributed Version Control system

Options:
  -h, --help       show Help information
  -v, --version    show Version number

Commands:
  help    [command]  show Help information
  remote             Manage the set of repositories ("remotes") whose branches you track

Keywords

FAQs

Last updated on 17 Aug 2023

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