Skip to content

@forinda/kickjs ​

@forinda/kickjs is the framework package: the DI container and decorators (re-exported from @forinda/kickjs-di), modules, adapters and plugins, the HTTP layer with RequestContext, built-in middleware, query parsing, env/config loading, and the pluggable HTTP runtime — Express by default, or Fastify or h3. The root entry exports everything most apps need; the subpaths below exist for narrower imports, optional engines, and the edge build.

Install ​

bash
pnpm add @forinda/kickjs express

express is the default engine. The other engines and features are optional peers: install fastify + @fastify/middie for the Fastify runtime, h3 (v2) for the h3 runtime or the web entry, multer for uploads on Express, croner for @Cron, zod for env schemas.

Entry points ​

ImportWhat it holds
@forinda/kickjsEverything: core (DI, decorators, modules, adapters, plugins, logger, errors), HTTP (bootstrap, Application, RequestContext, middleware, query parsing, createHandler), config/env, and expressRuntime
@forinda/kickjs/adapterAdapter types only — AppAdapter, AdapterContext, AdapterMiddleware, KickServer
@forinda/kickjs/containerContainer, tokenName and container event types
@forinda/kickjs/decorators@Controller, @Get/@Post/…, @Middleware, @FileUpload, @ApiQueryParams, @Asset, plus the DI decorators
@forinda/kickjs/loggerLogger, createLogger, ConsoleLoggerProvider, LoggerProvider
@forinda/kickjs/errorsHttpException, HttpStatus, ProblemException, Problems, ProblemDetails
@forinda/kickjs/reactivityref, computed, watch, reactive, isRef, unref, toRefs
@forinda/kickjs/configloadEnv, defineEnv, baseEnvSchema, getEnv, reloadEnv, withEnv, ConfigService, createConfigService
@forinda/kickjs/queryparseQuery and the other query-string parsers and types
@forinda/kickjs/middleware/helmethelmet()
@forinda/kickjs/middleware/corscors()
@forinda/kickjs/middleware/csrfcsrf(), csrfGuard()
@forinda/kickjs/middleware/rate-limitrateLimit(), RateLimitStore
@forinda/kickjs/middleware/request-idrequestId(), REQUEST_ID_HEADER
@forinda/kickjs/middleware/request-loggerrequestLogger()
@forinda/kickjs/middleware/allowed-hostsallowedHosts()
@forinda/kickjs/middleware/breach-paddingbreachPadding()
@forinda/kickjs/viewsViewAdapter (template engines)
@forinda/kickjs/spaSpaAdapter (serve a built frontend with index.html fallback)
@forinda/kickjs/fastifyfastifyRuntime(), FastifyRuntimeTypes — needs the fastify and @fastify/middie peers
@forinda/kickjs/h3h3Runtime(), H3RuntimeTypes — needs the h3 v2 peer
@forinda/kickjs/h3-webDeprecated alias: h3WebRuntime (= h3Runtime), kept for one major
@forinda/kickjs/webWeb-standard fetch entry for Cloudflare Workers, Bun and Deno — createWebApp, createFetchHandler; no Node HTTP imports
typescript
import { bootstrap } from '@forinda/kickjs'
import { h3Runtime } from '@forinda/kickjs/h3'
import { modules } from './modules'

await bootstrap({ modules, runtime: h3Runtime() })

Reference ​

  • Core — bootstrap() options, decorators, modules, adapters, plugins, context contributors, route flags, logger, errors
  • HTTP — Application, RequestContext, runtimes, the web entry, middleware, query parsing
  • Dependency injection — the container and DI decorators (@forinda/kickjs-di)
  • Configuration — env schemas, loadEnv, ConfigService, settings

Released under the MIT License. Built with TypeScript — runs on Express, Fastify, or h3.