This package contains shared utilities, functions, constants, and configuration files that can be used across multiple projects in the monorepo.
-
Shared Utilities: Functions in this package should be reusable across different applications and projects.
-
Common Constants: This package contains constant values that can be shared across projects, promoting consistency across the codebase.
-
Shared Configuration: Configuration utilities stored here can be used by any application in the monorepo.
-
Generic Utilities: Utility functions that are useful across multiple projects are kept in this package.
- Keep functions simple, focused, and well-documented
- Use TypeScript for strong typing of function inputs and outputs
- Document each function with clear JSDoc comments
- Ensure utilities are generic enough to be useful across different projects
- Avoid project-specific implementations
- Regularly review and update the contents to ensure they remain relevant and maintainable
- Version the package appropriately when making breaking changes
The package currently includes:
- Async utilities (sleep, runAsyncFnWithoutBlocking)
- Currency formatting helpers
- Nanoid string generation
- Common TypeScript types
To use this package in your project:
- Install the package in your project:
pnpm install @repo/lib
- Import the desired utilities from the package:
import { sleep } from '@repo/lib'
- Use the imported utilities in your project:
const result = await sleep(1000)