creational-methods
v1.0.2
Published
A TypeScript module for creational design patterns (Builder Method, With, Auto Setters and Getters)
Downloads
177
Maintainers
Readme
Creational Methods: TypeScript Decorators Module
This module provides a set of TypeScript decorators designed to streamline the creation of classes by automatically adding builder, getter, setter, and method-chaining functionalities. The decorators simplify class management, making code more readable and maintainable.
Features
- Builder Decorator (
Builder
): Enables the creation of abuilder
method that collects properties and builds an instance with consistent public field mappings. - Getter Decorator (
Getter
): Automatically adds getter methods for class properties, simplifying property access. - Setter Decorator (
Setter
): Adds setter methods to enable property mutation in a consistent manner. - With Decorator (
With
): Facilitates method chaining by adding methods prefixed withwith
for easy property assignment.
Installation
Ensure that Node.js is installed, then integrate this module into your TypeScript project.
npm i creational-methods
Contributing
- Fork the repository.
- Create a new branch for your feature.
- Commit your changes and open a pull request.