You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@sirian/console

Package Overview
Dependencies
Maintainers
1
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sirian/console

The Console component allows you to create command-line commands

7.1.7
latest
Source
npmnpm
Version published
Weekly downloads
254
71.62%
Maintainers
1
Weekly downloads
 
Created
Source

Console

Npm version LICENSE

Install

npm install @sirian/console

Example

import {Application, Argument, Command, CommandDefinition} from "@sirian/console";

class HelloCommand extends Command {
    static configure(definition: CommandDefinition) {
        definition
            .setDescription("Simple command example")
            .setArguments({
                name: new Argument({
                    defaultValue: "Nobody",
                    required: false,
                }),
            });
    }

    execute() {
        const io = this.io;
        const name = io.input.getArgument("name");
        io.success("Great, you did it!");
        io.writeln(`Hello <info>${name}</info>!`);
    }
}

const app = new Application({
    name: "Example",
    commands: [
        HelloCommand
    ]
});
app.run();

Keywords

console

FAQs

Package last updated on 12 Aug 2021

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