Socket
Socket
Sign inDemoInstall

cowmand

Package Overview
Dependencies
4
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

cowmand


Version published
Weekly downloads
11
decreased by-62.07%
Maintainers
1
Install size
685 kB
Created
Weekly downloads
 

Readme

Source

TheMath

_🐮 Cowmand - IN DEVELOPMENT

Introduction

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

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();

Esse projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.

FAQs

Last updated on 09 Jan 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc