Skip to content

Matii96/nodiator

Repository files navigation

Nodiator

Flexible mediator pattern implementation for TypeScript.

MIT Licensed NPM version Commitizen friendly codecov Build Status

Table of contents

💡 Idea

When application grows in size it becomes more and more complicated to control dataflow between objects / modules. Modifying one of them may lead to unwanted "shotgun surgery" resulting in breaking other features of the application.

Other problem are extra intermediate actions like logging or caching moved directly to eg. business parts of code effectively preventing us from easily unplugging any of the middle actions from application.

Nodiator aims to address this problem by providing configurable mediator object serving as a communication hub.

Packages

  • Core - project implementation for vanilla typescript
  • Logger - extension supporting explicit logging
  • Nest - nestjs integration

Examples

Local development

Project uses yarn workspaces in combination with lerna. To initialize the project run

yarn

Building packages

As project uses typescript for the package to be seen as other packages dependency they need to be built first.

yarn build

Testing

yarn lint:staged  # linting staged files
yarn test         # running unit tests for packages changed since HEAD
yarn test:cov     # running unit tests for whole repo with coverage report
yarn test:e2e     # running e2e tests for packages changed since HEAD with packages dependent on them
yarn test:all     # combining test and test:e2e

Committing

The project follows Conventional Commits standard. To conveniently create commit message use commitizen by typing

yarn cz

Authors

Mateusz Fonfara

See also the full list of contributors.

License

This project is licensed under the MIT License - see the LICENSE file for details.