Class serializer
@node-ts/bus-class-serializer leverages class transformer to provide serialization/deserialization to class instances. This means that class based properties of messages like javascript Dates can be consumed directly without having to do additional custom deserialization in each handler.
Installation
Install @node-ts/bus-class-serializer and its dependencies
Configure bus to use the serializer
This package relies on class transformer that requires reflect-metadata to be installed and called at the start of your application before any other imports. Please follow their guides on how to configure your app and contracts to serialize correctly.
Strongly typed messages
Once the @node-ts/bus-class-serializer has been installed and configured, you can consume class transformer notation for object properties of your messages.
For example
Last updated