Home Reference Source Repository
import EgoJSCli from 'egojs/src/egojs-cli.js'
public class | version 1.0.0 | source

EgoJSCli

Creates a CLI interface to work with EgoJS.

Constructor Summary

Public Constructor
public

Create a new instance of the CLI interface and use commander to defined all the possible commands.

Method Summary

Public Methods
public

Use the prompt to add a new package.

public

Show the settings prompt in order to enter the new settings.

public

Use the prompt to edit an existing package.

public

List all the package stats on the terminal.

public

Clear the cache and show the table again.

public

Use the prompt to remove an existing package.

Public Constructors

public constructor source

Create a new instance of the CLI interface and use commander to defined all the possible commands.

Public Methods

public addPackage(): Promise<null, Error> source

Use the prompt to add a new package.

Return:

Promise<null, Error>

In case of success, the promise will be resolved with no arguments

public configure(): Promise<null, Error> source

Show the settings prompt in order to enter the new settings.

Return:

Promise<null, Error>

In case of success, the promise will be resolved with no arguments

public editPackage(id: Number): Promise<null, Error> source

Use the prompt to edit an existing package.

Params:

NameTypeAttributeDescription
id Number

The package unique id.

Return:

Promise<null, Error>

In case of success, the promise will be resolved with no arguments

public listPackages(): Promise<null, Error> source

List all the package stats on the terminal.

Return:

Promise<null, Error>

In case of success, the promise will be resolved with no arguments

public refresh(): Promise<null, Error> source

Clear the cache and show the table again.

Return:

Promise<null, Error>

In case of success, the promise will be resolved with no arguments

public removePackage(id: Number): Promise<null, Error> source

Use the prompt to remove an existing package.

Params:

NameTypeAttributeDescription
id Number

The package unique id.

Return:

Promise<null, Error>

In case of success, the promise will be resolved with no arguments