@arkstack/common
v0.3.16
Published
Common package for Arkstack providing common implementations of core Arkstack features such as routing, middleware, and database integration.
Maintainers
Readme
@arkstack/common
Common utilities and helpers shared across Arkstack kits, including:
- Logging utilities
- Configuration management
ErrorHandlerand shared exception classes- Hashing and encryption helpers
- Typed model resolution with
getModel() - Pagination helpers
Model Resolution
import { getModel } from '@arkstack/common';
import type User from './src/app/models/User';
const UserModel = await getModel<typeof User>('User');Apps can augment ModelRegistry for typed model names:
declare module '@arkstack/common' {
interface ModelRegistry {
User: typeof User;
}
}Error Handling
import { ErrorHandler } from '@arkstack/common';
const payload = ErrorHandler.createErrorPayload(error);