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.6.1 to 0.6.2

pnpm-lock.yaml

18

dist/Commands/Layer.d.ts

@@ -14,7 +14,7 @@ import { Terminal } from '../Terminal';

}
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 type NextFunctionError = (error?: Error) => void;
export type NextFunctionSuccess = () => void;
export type NextFunction = NextFunctionSuccess | NextFunctionError;
export type CommandFunction = (context: Context, terminal: Terminal, nextFunction: NextFunction) => void | Promise<void>;
export type CommandErrorFunction = (context: Context, terminal: Terminal, nextFunction: NextFunctionError, error: Error) => void;
export interface OptionsLayer {

@@ -39,5 +39,7 @@ subCommands: string[];

handleError?: CommandErrorFunction;
private command;
private notInCommand;
private baseMathSetting;
command: string;
notInCommand: string[];
baseMathSetting: {
isRoot: boolean;
};
isRouter: boolean;

@@ -44,0 +46,0 @@ route?: IRoute;

@@ -55,2 +55,3 @@ "use strict";

const next = (error) => {
var _a;
if (error)

@@ -64,3 +65,3 @@ console.log(error);

layerStack = this.stack[index];
match = layerStack.match(this.params.command);
match = layerStack.match(this.params.command || '');
index++;

@@ -80,3 +81,3 @@ if (!match) {

};
layerStack.route.start(this.session, internalParams);
(_a = layerStack.route) === null || _a === void 0 ? void 0 : _a.start(this.session, internalParams);
}

@@ -86,3 +87,4 @@ if (error && layerStack.handleError) {

}
layerStack.handle({ session: this.session, params: this.params }, Terminal_1.terminal, next);
if (layerStack.handle)
layerStack.handle({ session: this.session, params: this.params }, Terminal_1.terminal, next);
return;

@@ -89,0 +91,0 @@ }

export interface OptionsAsk {
hidden: boolean;
}
declare const ask: (question: string, optionsAsk?: OptionsAsk | undefined) => Promise<string>;
declare const ask: (question: string, optionsAsk?: OptionsAsk) => Promise<string>;
export { ask };
{
"name": "cowmand",
"version": "0.6.1",
"version": "0.6.2",
"description": "Fast helper to create a cli",

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

![Cowmand][cowmand-logo]
# _🐮 Cowmand - _BETA_
# _🐮 Cowmand - \_BETA_
## Introduction
This lib get beginning of express to create a cli. It's a simple way to create a cli.
## Installation

@@ -14,9 +15,11 @@

Use npm:
```
$ npm install cowmmand
$ npm install cowmand
```
Use yarn:
```
$ yarn add cowmmand
$ yarn add cowmand
```

@@ -26,4 +29,4 @@

Using middleware in global, but with rules to notIn `["login"]`.
Using middleware in global, but with rules to notIn `["login"]`.
```typescript

@@ -41,5 +44,3 @@ import Cowmand from 'cowmand';

program.command(['me'], (context, terminal) => {
terminal
.log(`Hello, ${context.session.user?.name}!`)
.end();
terminal.log(`Hello, ${context.session.user?.name}!`).end();
});

@@ -50,4 +51,4 @@

Using middleware before command handle:
Using middleware before command handle:
```typescript

@@ -63,5 +64,3 @@ import Cowmand from 'cowmand';

program.command(['me'], GuardLogin, (context, terminal) => {
terminal
.log(`Hello, ${context.session.user?.name}!`)
.end();
terminal.log(`Hello, ${context.session.user?.name}!`).end();
});

@@ -73,4 +72,5 @@

## Docs
**Terminal** [Docs](/docs/Terminal.md)
**Terminal** [Docs](/docs/Terminal.md)
## New Features

@@ -84,8 +84,10 @@

****
---
This project is under the MIT license. See the [LICENSE][license-link] file for more details.
<!-- Markdown link & img's -->
[license-link]: /LICENSE
[cowmand-logo]: https://i.imgur.com/dWPzX9W.png
[cowmand-npm]: https://www.npmjs.com/package/cowmmand
[cowmand-npm]: https://www.npmjs.com/package/cowmand

Sorry, the diff of this file is not supported yet

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