@temboplus/helpers
v0.7.0
Published
Base helpers for TemboPlus applications and packages
Downloads
279
Readme
temboplus-helpers
Base helpers for TemboPlus applications and packages.
Requirements
Installation
npm install --save @temboplus/helpersor
npm install [email protected]:TemboPlus-Inc/temboplus-helpers.gitUsage
1. Import the HelperModule
The HelperModule is a global NestJS module, you only need to import it once in your root module:
// app.module.ts
import { Module } from '@nestjs/common';
import { HelperModule } from '@temboplus/helpers';
@Module({
imports: [
HelperModule, // Import once here
// ... other modules
],
})
export class AppModule {}2. Inject Helpers into Services or Controllers
You can inject any helper using NestJS Dependency Injection:
import { Injectable } from '@nestjs/common';
import { BooleanHelper, NumberHelper, StringHelper } from '@temboplus/helpers';
@Injectable()
export class ExampleService {
constructor(
private readonly booleanHelper: BooleanHelper,
private readonly numberHelper: NumberHelper,
private readonly stringHelper: StringHelper,
) {}
someMethod(value: unknown): boolean {
return this.booleanHelper.toBoolean(value);
}
// ... other methods
}For a complete reference of all available classes, methods, and modules, see the API Reference section.
Contribute
We welcome contributions! Here's how to get started:
How to Contribute
Open an Issue Start by opening an issue to discuss your proposed changes.
Clone the Repo
git clone [email protected]:TemboPlus-Inc/temboplus-helpers.git cd temboplus-helpersInstall Dependencies
npm installCreate a Feature Branch
git checkout -b feature/<your-feature-name> mainMake Your Changes & Run Checks
npm run checkFor available scripts and automation workflows, see the Tasks guide.
Commit Your Changes
git commit -m "feat(<scope>): <add new feature description>"Push & Submit a Pull Request
git push origin feature/<your-feature-name>Then, open a Pull Request (PR) to the main branch.
Contribution Guidelines
- Follow SOLID principles to write clean, maintainable, and scalable code.
- Follow the GitFlow workflow branching model.
- Follow Conventional Commits (
feat,fix,chore, etc.). - Write meaningful commit messages, PR titles, and code comments.
- Ensure the code passes checks before submitting.
- Keep changes focused and well-scoped.
