@sprout-idws/sprout-base
v1.0.2
Published
Shared base utilities for Sprout (logger config, etc.)
Readme
@sprout-idws/sprout-base
Small shared utilities for Sprout NestJS applications. Today this package focuses on Nest logger level selection from the environment.
Purpose
- Centralize conventions (for example log verbosity) so multiple services behave the same way without duplicating env parsing.
Installation
npm install @sprout-idws/sprout-basePeer dependency: @nestjs/common (v10+).
Functionality
LoggerConfig
Maps process.env.LOG_LEVEL to Nest LogLevel[] for NestFactory.create(..., { logger: ... }) or similar.
| LOG_LEVEL | Behavior |
|-------------|----------|
| (unset) | warn, log, error |
| all | error, warn, log, debug, verbose |
| Comma-separated | Any subset of error, warn, log, debug, verbose (invalid tokens ignored) |
Example:
import { NestFactory } from '@nestjs/core';
import { LoggerConfig } from '@sprout-idws/sprout-base';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
logger: LoggerConfig.getLoggerLevels(),
});
await app.listen(3000);
}
bootstrap();Build
This package ships compiled dist/ output. In this monorepo, npm run build at the repo root runs Turbo and builds all workspaces.
Repository
Published from the sprout-typescript-backend monorepo (packages/sprout-base).
