open-index/open-npm huggingface dataset:
npm package: @karin-js/config
Description: Type-safe configuration management for Karin
Latest version: 1.1.15

# @karin-js/config

Configuration management plugin for Karin-JS with environment variable loading and validation.

## Installation

```bash
bun add @karin-js/config
```

## Overview

The Config plugin provides:
- ✅ Environment variable loading from `.env` files
- ✅ Schema validation with Zod
- ✅ Type-safe configuration access
- ✅ Required keys validation
- ✅ Custom configuration loaders

## Quick Start

```typescript
import { KarinFactory } from "@karin-js/core";
import { ConfigPlugin } from "@karin-js/config";

const config = new ConfigPlugin({
  requiredKeys: ["DATABASE_URL", "PORT"],
});

const app = await KarinFactory.create(adapter, {
  plugins: [config],
});

// Access config in services
@Service()
class AppService {
  constructor(private config: ConfigService) {}

  getDatabaseUrl() {
    return this.config.get("DATABASE_URL");
  }
}
```

## Features

### Environment Variables

Automatically loads `.env` files:

```env
# .env
DATABASE_URL=mongodb://localhost:27017/mydb
PORT=3000
API_KEY=secret123
```

### Required Keys

Ensure critical configuration is present:

```typescript
const config = new ConfigPlugin({
  requiredKeys: ["DATABASE_URL", "API_KEY"],
});
// Throws error if keys are missing
```

### Schema Validation

Validate configuration with Zod:

```typescript
import { z } from "zod";

const config = new ConfigPlugin({
  schema: z.object({
    PORT: z.string().transform(Number),
    DATABASE_URL: z.string().url(),
    LOG_LEVEL: z.enum(["debug", "info", "warn", "error"]),
  }),
});
```

### Custom Loaders

Load configuration from any source:

```typescript
const config = new ConfigPlugin({
  load: async () => ({
    port: 3000,
    database: await fetchFromVault(),
  }),
});
```

## Usage in Services

```typescript
import { Service } from "@karin-js/core";
import { ConfigService } from "@karin-js/config";

@Service()
export class DatabaseService {
  constructor(private config: ConfigService) {}

  connect() {
    const url = this.config.get("DATABASE_URL");
    // Connect to database
  }

  getAllConfig() {
    return this.config.getAll();
  }
}
```

## Lazy Resolution in Plugins

Use config values in other plugins:

```typescript
const config = new ConfigPlugin({
  requiredKeys: ["MONGO_URI"],
});

const app = await KarinFactory.create(adapter, {
  plugins: [
    config,
    new MongoosePlugin({
      uri: () => config.get("MONGO_URI"), // Lazy resolution
    }),
  ],
});
```

## API

### ConfigPlugin Options

```typescript
interface ConfigPluginOptions {
  // Load from .env file (default: true)
  loadEnv?: boolean;

  // Custom loader function
  load?: () => Record<string, any> | Promise<Record<string, any>>;

  // Zod schema for validation
  schema?: z.ZodSchema;

  // Required configuration keys
  requiredKeys?: string[];
}
```

### ConfigService Methods

```typescript
class ConfigService {
  // Get a configuration value
  get<T = string>(key: string): T;

  // Get all configuration
  getAll(): Record<string, any>;
}
```

## License

MIT
npm package: @karin-js/platform-h3
Description: H3 HTTP adapter for Karin-JS, optimized for maximum performance on Bun.
Latest version: 1.1.15

# @karin-js/platform-h3

H3 HTTP adapter for Karin-JS, optimized for maximum performance on Bun.

## Installation

```bash
bun add @karin-js/core @karin-js/platform-h3
```

## Overview

The H3 adapter provides:
- ✅ Maximum performance
- ✅ Optimized for Bun
- ✅ Minimal overhead
- ✅ Production-ready

## Usage

```typescript
import { KarinFactory } from "@karin-js/core";
import { H3Adapter } from "@karin-js/platform-h3";

const app = await KarinFactory.create(new H3Adapter(), {
  scan: "./src/**/*.ts",
});

app.listen(3000);
```

## Features

- **High Performance**: Optimized for speed
- **Low Overhead**: Minimal abstraction layer
- **Production Ready**: Battle-tested H3 foundation
- **Modern**: Built for modern runtimes

## Performance

H3 adapter provides the best performance among Karin adapters:
- Fastest request handling
- Lowest latency
- Optimized for high-throughput scenarios

## When to Use

Choose H3 adapter when:
- Maximum performance is the priority
- Running on Bun (not Edge)
- Building high-traffic APIs
- You need the fastest possible framework overhead

Choose Hono adapter when:
- Deploying to Edge runtimes
- Portability across runtimes is important
- Building serverless functions

## License

MIT
npm package: @karin-js/platform-hono
Description: Hono HTTP adapter for Karin-JS, optimized for Edge runtimes and serverless deployments.
Latest version: 1.1.15

# @karin-js/platform-hono

Hono HTTP adapter for Karin-JS, optimized for Edge runtimes and serverless deployments.

## Installation

```bash
bun add @karin-js/core @karin-js/platform-hono
```

## Overview

The Hono adapter provides:
- ✅ Edge runtime support (Cloudflare Workers, Deno Deploy)
- ✅ Lightweight and fast
- ✅ Built-in middleware ecosystem
- ✅ Excellent TypeScript support

## Usage

```typescript
import { KarinFactory } from "@karin-js/core";
import { HonoAdapter } from "@karin-js/platform-hono";

const app = await KarinFactory.create(new HonoAdapter(), {
  scan: "./src/**/*.ts",
});

app.listen(3000);
```

## Serverless Deployment

### Cloudflare Workers

```typescript
import { HonoAdapter } from "@karin-js/platform-hono";
import { KarinFactory } from "@karin-js/core";
import { AppController } from "./app.controller";

const app = await KarinFactory.create(new HonoAdapter(), {
  controllers: [AppController],
  scan: false, // Disable file scanning for serverless
});

export default app.getHttpServer();
```

### Deno Deploy

```typescript
import { HonoAdapter } from "npm:@karin-js/platform-hono";
import { KarinFactory } from "npm:@karin-js/core";

const app = await KarinFactory.create(new HonoAdapter(), {
  scan: "./src/**/*.ts",
});

Deno.serve(app.getHttpServer().fetch);
```

## Features

- **Edge-first**: Designed for modern Edge runtimes
- **Lightweight**: Minimal overhead
- **Fast**: Excellent performance characteristics
- **Flexible**: Works in Bun, Deno, and Edge

## Performance

Hono adapter provides excellent performance:
- ~97,000 req/sec (wrk benchmark)
- ~102,000 req/sec (oha benchmark)
- Sub-millisecond average latency

## When to Use

Choose Hono adapter when:
- Deploying to Edge runtimes (Cloudflare Workers, Deno Deploy)
- Building serverless functions
- You need a lightweight, portable solution
- Edge computing is a priority

Choose H3 adapter when:
- Maximum performance is critical
- Running on traditional servers (Bun)
- You don't need Edge runtime support

## License

MIT
npm package: @karina_1101/ownpackage
Description: ## Project setup ``` npm install ```
Latest version: 0.1.0

# ownpackage

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).