cmdex
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

cmdex (command executor)

a simple framework for executing commands

Usage

import { execute, cmd } from "cmdex";

const incrementHandler = {
  handler: num => cmd('incremented', num + 1);
}

const executor = execute({ handlers: { increment: incrementHandler }})

const myCommand = cmd('increment', 1); // Command

const responses = executor(myCommand); // Response: [{ action: 'incremented', 2 }];
const myIncrementedNumber = pluckAction('incremented')(responses); // 2

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    3
    • latest

Version History

Package Sidebar

Install

npm i cmdex

Weekly Downloads

13

Version

2.0.0

License

MIT

Unpacked Size

22.5 kB

Total Files

34

Last publish

Collaborators

  • delashum
  • hivewire-dev