🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@bleed-believer/command

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@bleed-believer/command

A module for @bleed-believer to make commands routing

unpublished
latest
npmnpm
Version
0.0.4
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@bleed-believer/command

This is a BleedBeliever module to make command routing from arguments passed by the user through the command console.

Installation

First install the @bleed-believer/core package:

npm i --save @bleed-believer/core

Then, install this package:

npm i --save @bleed-believer/command

Usage

First, you must make a Command class using the according decorators:

import { Command, CommandMethod } from '@bleed-believer/command';

@Command({
    main: [ 'start' ],
    title: 'Start command'
})
export class StartCommand {
    @CommandMethod()
    start(): void {
        console.log('Hello World');
    }
}

Then, create a module with your commands:

import { CommandRouter } from '@bleed-believer/command';
import { BleedModule } from '@bleed-believer/core';

import { StartCommand } from './start-command';
import { StopCommand } from './stop-command';

@BleedModule({
    imports: [
        CommandRouter.addToRouter([
            StartCommand,   // The class created above
            StopCommand     // Another command class
        ])
    ]
})
export class AppRouting {}

Finally, Add your AppRouting module as a parameter into the BleedBeliever constructor, and initialize the bleeding process:

import { BleedBeliever } from '@bleed-believer/core';
import { AppRouting } from './app-routing';

const main = new BleedBeliever(AppRouting);
main.bleed();

FAQs

Package last updated on 22 Nov 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