🎉 Hyperse Wizard has been published.
Hyperse Wizard

Custom Plugin

How to create a custom plugin

How to create a custom plugin

A plugin is a function that accepts a Wizard instance and returns a Wizard instance.

Usage

// @filename: @hyperse/wizard/dist/index.d.ts
import { ,  } from '@hyperse/wizard';

export const  = () => {
  return ({
    // locale message key
    : 'plugins.newPlugin.name',
    : versionMessages,
    : () => {
      let  = .(
        defineCommand('print', {
          // locale message key
          : 'plugins.newPlugin.command.description',
        }).process(() => {
          process.stdout.write('hello world');
        })
      );
      return ;
    },
  });
};

// use plugin
const  = ({
  : 'hps_cli',
  // locale message key
  : 'cli.versionCli.description',
  : () => {
    // locale message key
    return ('cli.versionCli.version', { : '1.0.0' });
  },
  : versionCliMessages,
  : () => {
    .('CLI errorHandler \n', );
  },
})
  .(())
  .();

// execute command
// node ./cli.js print

On this page