1.2.2 • Published 2 months ago

semo-plugin-hello-world v1.2.2

Weekly downloads
3
License
MIT
Repository
github
Last release
2 months ago

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

1.2.2

2 months ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago