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

0.0.7 • Public • Published

CLI Handler

import { parse, Directive, Handler } from 'cli-handler';

const generateServiceHandler: Handler = (value, flags) => {
  console.log({
    value,
    flags,
  });
};

const DIRECTIVES: Directive[] = [
  {
    path: 'g|generate',
    description: 'Generate a new project',
    children: [
      {
        input: true,
        path: 'c|component',
        description: 'Template to use',
      },
      {
        input: true,
        path: 's|service',
        description: 'Template to use',
        flags: ['flat', 'tests'],
        handler: generateServiceHandler,
      },
    ],
  },
];
parse(DIRECTIVES);

/cli-handler/

    Package Sidebar

    Install

    npm i cli-handler

    Weekly Downloads

    2

    Version

    0.0.7

    License

    MIT

    Unpacked Size

    3.34 kB

    Total Files

    4

    Last publish

    Collaborators

    • carlos-burelo