npm.io
2.1.0-alpha.0 • Published 4 years ago

@miniu/plugin-command

Licence
—
Version
2.1.0-alpha.0
Deps
2
Size
4 kB
Vulns
0
Weekly
0

@miniu/plugin-command

命令行插件

export namespace ISlotCommand {
  export interface List extends ISlot {
    name: 'command.list';
    val: [
      string,
      string,
      (yargs: Argv) => void,
      (args: { [argName: string]: unknown; _: string[]; $0: string }) => void
    ];
  }
}

示例:

export default ({ add }) => {
  add('command.list', [
    'hellow',
    '😆',
    () => {},
    (argv) => {
      console.log('hello')
    }
  ])
}
$ miniu test // hello