open-index/open-npm huggingface dataset:
npm package: @nl-framework/platform
Description: Unified application factory for nl-framework combining HTTP and GraphQL servers with shared dependency injection context.
Latest version: 0.3.5

# @nl-framework/platform

Platform adapters and bootstrap utilities that host Nael Framework modules for HTTP, GraphQL, and microservice workloads.

## Installation

```bash
bun add @nl-framework/platform
```

## Highlights

- **Unified bootstrap** – launch HTTP servers, GraphQL gateways, and microservices with a consistent API surface.
- **Testing harness** – spin up lightweight application instances for integration or contract testing.
- **Adapter interfaces** – plug in custom transports (Fastify, Express, Dapr, etc.) without changing controller logic.

## Quick start

```ts
import { NaelFactory } from '@nl-framework/platform';
import { AppModule } from './app.module';

const application = await NaelFactory.create(AppModule, {
  http: {
    port: 3000,
  },
  graphql: {
    path: '/api/graphql',
  },
});

const { http, graphql } = await application.listen({ http: 3000 });

console.log('HTTP server running on port', http?.port);
console.log('GraphQL mounted at', graphql?.url);
```

To shut everything down gracefully later on:

```ts
await application.close();
```

## API surface

- `NaelFactory.create(Module, options)` – boots the dependency graph and returns a `NaelApplication` facade.
- `NaelApplication.listen(options)` – starts HTTP, GraphQL, and federation gateway servers and returns active handles.
- `NaelApplication.getHttpApplication()` / `getGraphqlApplication()` / `getGatewayApplication()` – access the underlying adapters when you need lower-level control.
- `NaelApplication.get(token)` / `getConfig()` / `getLogger()` – resolve services from the shared application context.
- Types such as `NaelFactoryOptions`, `NaelListenOptions`, and `NaelListenResults` document the available configuration hooks.

## Compatibility

| Runtime | Minimum version | Notes |
|---------|-----------------|-------|
| Bun     | 1.1.22          | Primary runtime. CI, CLI scaffolding, and docs target Bun 1.1.22+. |
| Node.js | 20 (experimental) | HTTP adapters run on Node, but Bun remains the recommended build/test environment. |

## License

Apache-2.0
npm package: @nl-framework/scheduler
Description: Task scheduling utilities for nl-framework with cron, interval, and timeout decorators powered by Bun workers.
Latest version: 0.3.5

# @nl-framework/scheduler

Task scheduling utilities for the Nael Framework. Inspired by NestJS Schedule, this package lets you decorate injectable services with cron, interval, and timeout jobs, backed by Bun Workers for accurate timing that won't block your main event loop.

## Features

- `@Cron`, `@Interval`, and `@Timeout` decorators with optional names, `runOnInit`, and `maxRuns` controls
- Central `SchedulerService` with runtime APIs for dynamic jobs
- `SchedulerRegistry` for inspecting and managing registered jobs at runtime
- Bun Worker-based timer execution for better isolation and timing accuracy

## Installation

```bash
bun add @nl-framework/scheduler
```

## Quick start

```ts
import { Injectable, Module } from '@nl-framework/core';
import { SchedulerModule, SchedulerService, Cron } from '@nl-framework/scheduler';

@Injectable()
class ReportService {
  constructor(private readonly scheduler: SchedulerService) {}

  @Cron('0 * * * *', { runOnInit: true })
  async hourlyReport() {
    // ...generate report
  }

  async onModuleInit() {
    await this.scheduler.registerDecoratedTarget(this);
  }
}

@Module({
  imports: [SchedulerModule.forFeature(ReportService)],
})
class ReportingModule {}
```

- Use `SchedulerModule.forFeature(ReportService)` (or pass an array for multiple schedulers) to register your injectable class as a scheduler feature.
- Inject `SchedulerService` and call `registerDecoratedTarget` (usually inside `onModuleInit`) to activate all decorated methods.

## Runtime management

The `SchedulerService` exposes imperative APIs for dynamic scheduling:

```ts
await scheduler.scheduleInterval('cleanup', 60_000, () => cleanup(), { maxRuns: 10 });
await scheduler.cancel('cleanup');
```

`SchedulerRegistry` maintains a snapshot of active jobs and powers the `scheduler.list*()` helpers for observability.

## Testing Helpers

In tests you can mock the worker by providing a custom `SchedulerWorkerFactory` when creating the module, enabling deterministic execution without spinning up a real worker.

## License

Apache-2.0. See the repository root `LICENSE` file for details.