https://github.com/xieyuheng/coupler
Simple tools for doing dependency injection through constructors.
https://github.com/xieyuheng/coupler
coupler coupling dependency-injection
Last synced: about 1 year ago
JSON representation
Simple tools for doing dependency injection through constructors.
- Host: GitHub
- URL: https://github.com/xieyuheng/coupler
- Owner: xieyuheng
- License: gpl-3.0
- Created: 2022-05-17T10:21:47.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-26T19:59:45.000Z (almost 4 years ago)
- Last Synced: 2025-03-10T21:04:39.408Z (about 1 year ago)
- Topics: coupler, coupling, dependency-injection
- Language: TypeScript
- Homepage:
- Size: 130 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE-OF-CONDUCT.md
Awesome Lists containing this project
README
# Coupler
Simple tools for doing [dependency injection through constructors](https://martinfowler.com/articles/injection.html#FormsOfDependencyInjection).
The main class of this package is called `Coupler`,
because it can depend on everything,
so everything do **NOT** need to depend on each other.
Thus a coupler should only be used at the **outmost parts of your application**,
and often we should only use one coupler for one application.
Notes:
- This pattern is also called ["Service Container"](https://laravel.com/docs) in Laravel.
## Installation
```
npm install @xieyuheng/coupler
```
## Development
```
npm install // Install dependencies
npm run build // Compile `src/` to `lib/`
npm run watch // Watch the compilation
npm run test // Run test
```
## Contributions
> Be polite, do not bring negative emotion to others.
- [TODO.md](TODO.md)
- [STYLE-GUIDE.md](STYLE-GUIDE.md)
- [CODE-OF-CONDUCT.md](CODE-OF-CONDUCT.md)
- When contributing, add yourself to [AUTHORS](AUTHORS)
## License
- [GPLv3](LICENSE)