@bunito/bunito
v0.0.27
Published
Convenience entrypoint for bunito application, container, config, and logger APIs.
Maintainers
Readme
@bunito/bunito
Convenience entrypoint for core bunito application APIs.
Use this package for application bootstrap, modules, providers, shared utilities, configuration, and logging APIs that most apps import first.
Installation 📦
bun add @bunito/bunitoUsage ✨
import { App, Logger, LoggerModule, Module, Provider } from '@bunito/bunito';
@Provider({
injects: [Logger],
})
class HelloService {
constructor(private readonly logger: Logger) {}
sayHello(): void {
this.logger.info('Hello from bunito');
}
}
@Module({
imports: [LoggerModule],
providers: [HelloService],
})
class AppModule {}
const app = await App.start(AppModule);
const hello = await app.resolve(HelloService);
hello.sayHello();
await app.shutdown();License
MIT
