This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@whook/cli
TypeScript icon, indicating that this package has built-in type declarations

11.0.1 • Public • Published

@whook/cli

The Whook server CLI

GitHub license

This is the Whook server CLI tool. Its goal is to allow you to create commands right in your project instead of in external tools. By doing so, it provides you a convenient way to reuse your Whook's project configuration, services and handlers easily in you day to day command line programs.

To create new commands, you simply have to create new files in the src/commands folder of your Whook project and let the autoloader detect it ;).

By setting @whook/cli in the WHOOK_PLUGINS constant, you will benefit of the commands provided by this module:

  // (...)
  // Setup your own whook plugins or avoid whook defaults by leaving it empty
-  $.register(constant('WHOOK_PLUGINS', ['@whook/whook']));
+  $.register(constant('WHOOK_PLUGINS', ['@whook/cli', '@whook/whook']));
  // (...)

See the Whook example server commands for simple examples on creating your own commands in a whook project.

You can also create a new command by running:

npx whook create --type commands

Dev

To test the CLI script, go to a project (in this repo @whook/example):

npm run build
cd ../whook-example

# Debugging compiled commands
node ../whook-cli/bin/whook.js ls

# Debugging source commands
PROJECT_SRC="$PWD/src" NODE_ENV=${NODE_ENV:-development} npm run cli -- ts-node --esm --files -- ../whook-cli/bin/whook.js ls

API

Authors

License

MIT

Package Sidebar

Install

npm i @whook/cli

Weekly Downloads

19

Version

11.0.1

License

MIT

Unpacked Size

375 kB

Total Files

106

Last publish

Collaborators

  • nfroidure