semo-plugin-hello-world
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

semo-plugin-hello-world

This is the hello world plugin for Semo, it is just for fun, and is the showcase of what Semo plugin looks like.

Usage

npm install -g @semo/cli
semo run hello-world

You don't need to download the plugin by using npm install, but semo run helps you to do that.

OK, you can download the plugin by using npm install

npm install -g semo-plugin-hello-world
semo hello-world

Or magically just:

npx @semo/cli run hello-world

Options

  • --lang: For now, it only support en_US and zh_CN.
  • --inspiration-type: For now, it only support en, cn, it, poison, and rule.
  • --clean: No box and no color
  • --simple: Just output inspiration

Extension

Change the default behavior of the command by using semo config -g

semo config set '$plugin.hello-world.lang' zh_CN -g
semo config set '$plugin.hello-world.inpirationType' it -g

You can use hooks to change the command output. The template is:

{{ hi }}
{{ greeting }}
{{ inspiration }}

You can change then using these hooks in your global Semo plugins.

exports.hook_hello_world_hi = async () => {}
exports.hook_hello_world_greeting = async () => {}
exports.hook_hello_world_inspirations = async () => {}

The last inspirations hook need to return an Array of sentences, and than output randomly by the command core.

The inspirations format

In core, we use yml to define inspriation and there are 2 format supported:

- who: somebody
  said: something

or

- something --somebody

The first format may provide more formated output, but now, the last format is easy to use, so if you hook inspirations, you can just return sentences array.

Contribution

There must be typos need to be fixed, and we need more inspiration types and more good inspirations.

If you have any ideas about this plugin, please create issues or push PR to us.

License

MIT

Dependents (0)

Package Sidebar

Install

npm i semo-plugin-hello-world

Weekly Downloads

7

Version

1.2.2

License

MIT

Unpacked Size

40.5 kB

Total Files

22

Last publish

Collaborators

  • vipzhicheng