Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cowmand

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cowmand - npm Package Compare versions

Comparing version 0.4.11 to 0.4.12

85

dist/cowmand.d.ts

@@ -1,5 +0,84 @@

declare function createProgram(): import("./program").Program;
export { Context, NextFunction } from './Layer';
export { Terminal } from './Terminal';
declare function createProgram(): Program;
export interface Params {
command: string;
subCommands: string[];
flags: Map<string, string | number | boolean>;
}
export interface Context {
params: Params;
session: {
[key: string]: any;
};
}
export declare type NextFunctionError = (error?: Error) => void;
export declare type NextFunctionSuccess = () => void;
export declare type NextFunction = NextFunctionSuccess | NextFunctionError;
export declare type CommandFunction = (context: Context, terminal: Terminal, nextFunction: NextFunction) => void | Promise<void>;
export declare type CommandErrorFunction = (context: Context, terminal: Terminal, nextFunction: NextFunctionError, error: Error) => void;
export interface OptionsLayer {
subCommands: string[];
notInCommands: string[];
}
export interface ILayer {
match(command: string): boolean;
}
/**
* To Create Layer
* @param handle (function)
* @param next (function)
* @param notInCommandList (boolean)
* @param command (function)
` */
declare class Layer implements ILayer {
private readonly name;
handle?: CommandFunction;
handleError?: CommandErrorFunction;
private command;
private notInCommand;
private baseMathSetting;
constructor(command: string | undefined, options: OptionsLayer, executor: CommandFunction | CommandErrorFunction);
match(command: string): boolean;
}
export { Layer };
export { createProgram };
export default createProgram;
export interface OptionsAsk {
hidden: boolean;
}
interface Terminal {
log(...args: unknown[]): Terminal;
error(title: string, lines: string[]): Terminal;
table(...args: unknown[]): Terminal;
ask(question: string, optionsAsk?: OptionsAsk): Promise<string>;
loading(text: string): {
changeText(textChange: string): void;
stop(): void;
changeColor(color: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray'): void;
succeed(textSuccess: string): void;
fail(textFail: string): void;
};
end(): void;
}
declare const terminal: Terminal;
export { terminal, Terminal };
export interface Program {
session: {
[key: string]: unknown;
};
params: Params;
stack: Layer[];
parseArguments(args: string[]): void;
lazyStack(promises: Promise<unknown>[]): Generator<unknown, void>;
init(): void;
start(): void;
start(callback: () => void): void;
use(...fn: (CommandFunction | CommandErrorFunction)[]): void;
use(command: string, ...fn: (CommandFunction | CommandErrorFunction)[]): void;
use(commands: string[], ...fn: (CommandFunction | CommandErrorFunction)[]): void;
use(command: {
notIn: string[];
}, ...fn: (CommandFunction | CommandErrorFunction)[]): void;
}
declare const program: Program;
export { program };

2

package.json
{
"name": "cowmand",
"version": "0.4.11",
"version": "0.4.12",
"description": "Fast helper to create a cli",

@@ -5,0 +5,0 @@ "tags": [

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