adonisjs-modules
v1.1.0
Published
Modular architecture for AdonisJS using the HMVC pattern, inspired by Laravel module system.
Downloads
5
Maintainers
Readme
AdonisJS Modules
This package provides a module-based architecture for AdonisJS, inspired by the popular Laravel modules package. It enables developers to structure their AdonisJS applications using a modular approach, organizing features into individual modules.
Installation
To install the package, run the following command:
npm install adonisjs-modulesConfiguration
After installing the package, configure it by running:
node ace configure adonisjs-modulesThis will set up the necessary files and make the commands available to you.
Creating a Module
To create a new module, run:
node ace module:make <module_name>Replace <module_name> with the actual name of the module you want to create.
Using a Module
If you want to set a module as the default module, run:
node ace module:use <module_name>If you don’t set a default module, you will be required to pass the --module=<module_name> flag with each command you execute.
Available Commands
Once the package is configured, you can use the following commands to generate various module components. To see the list of available commands, run:
node ace module:make <component> [--module=<module_name>]Where <component> can be one of the following:
To see the full list you should run
node ace list moduleExample
To create a new controller inside a specific module:
node ace module:make-controller user --module=blogIf you have already set blog as the default module, you can simply run:
node ace module:make-controller userInspired by Laravel Modules
This package is inspired by the Laravel Modules package, which offers a similar approach for structuring Laravel applications.
Like the Package? Star It! ⭐
If you find this package useful, please consider giving it a star on GitHub. It helps others discover it and motivates continued development.
