0.6.1 • Published 3 months ago

cowmand v0.6.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Cowmand

🐮 Cowmand - _BETA

Introduction

This lib get beginning of express to create a cli. It's a simple way to create a cli.

Installation

This is a Node.js module available through the npm registry.

Use npm:

$ npm install cowmmand

Use yarn:

$ yarn add cowmmand

Example Initial

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

import Cowmand from 'cowmand';
import { GuardLogin } from './guardLogin';
import { Login } from './login';

const program = Cowmand();

program.use({ notIn: ['login'] }, GuardLogin);

program.command(['login'], Login);

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

program.start();

Using middleware before command handle:

import Cowmand from 'cowmand';
import { GuardLogin } from './guardLogin';
import { Login } from './login';

const program = Cowmand();

program.command(['login'], Login);

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

program.start();

Docs

Terminal Docs

New Features

  • Commander Routes - Similar with Router of express, for use commands in other file.
  • Validate errors Layers
  • Terminal - Add table console
  • Terminal - Add question on terminal
  • Terminal - Add option to hide a password

This project is under the MIT license. See the LICENSE file for more details.

0.6.1

3 months ago

0.6.0

1 year ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.23

2 years ago

0.4.20

2 years ago

0.4.19

2 years ago

0.4.18

2 years ago

0.4.17

2 years ago

0.4.16

2 years ago

0.4.15

2 years ago

0.4.14

2 years ago

0.4.13

2 years ago

0.4.12

2 years ago

0.4.11

2 years ago

0.4.10

2 years ago

0.4.9

2 years ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.3

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.5

2 years ago

0.0.5-beta.2

2 years ago

0.0.5-beta.1

2 years ago

0.0.5-beta.0

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.3-beta.1

2 years ago

0.0.3-beta.0

2 years ago

0.0.2

2 years ago

0.0.2-beta.0

2 years ago

0.0.1

2 years ago