@augejs/module-core
v1.0.2-rc.4
Published
`@augejs/module-core` is a module framework which support using `dependency injection` way to composite kinds of `Modules` and `Providers` to complex application.
Downloads
64
Readme
augejs
augejs
is a progressive Node.js framework for building applications.
:star2: Star us on GitHub — it helps! :clap:
Table of Contents
- Description
- Features
- Install
- Usage
- Package Dependencies
- Lifecycle
- Related Efforts
- Maintainers
- Contributing
- License
Description
augejs
is a progressive Node.js framework for building applications. It uses modern JavaScript built with TypeScript.
Look at a diagram below:
An application is composite of 3 types of element:
Provider
is an abstract logic unit which can provide for Module
.
Decorator
is an abstract logic unit which can decorate for Module
and Provider
.
Module
is consists of Provider
and Module
.
This is the one of fundamental concept for
augejs
.
Features
:penguin: The core layer is small, simple and extensible.
:baby_chick: Progressive Development.
Install
This project uses node and npm. Go check them out if you don't have them locally installed.
npm install @augejs/module-core
Usage
import { Module, boot } from '@augejs/module-core';
// we use a @Module decorator to define a module
@Module()
class AppModule {
async onInit() {
// the onInit lifecycle method will be called when application boot
console.log('hello augejs');
}
}
(async () => {
// boot the whole application by module.
await boot(AppModule);
})();
Package Dependencies
Lifecycle
There is the lifecycle name for Module
And Provider
.
Please take a look at this link provider-scanner-hook, augejs
is on top of that. augejs
application boot flow is a middleware execute mode.
Cluster Decorator
See examples/cluster
@Cluster({
workers: 2
})
@Module()
class AppModule() {
}
The above code, the program will startup as a master daemon process and the AppModule
will startup as a worker process. If the worker process is exit with an exception or killing by other cases
then the master process will fork a new work process for AppModule
.
If the master process is exit with signal(SIGTERM), the work process will shutdown gracefully.
Document
visit augejs.github.io. :tada:
Examples
see the Examples. :open_book:
Related Efforts
- Art of Readme - 💌 Learn the art of writing quality READMEs.
- open-source-template - A README template to encourage open-source contributions.
Maintainers
Contributing
Feel free to dive in! Open an issue or submit PRs.
augejs
follows the Contributor Covenant Code of Conduct.
Contributors
This project exists thanks to all the people who contribute.
...
License
MIT © augejs