{"id":18702,"library":"rajt","title":"Rajt – Serverless Bundler Layer for AWS Lambda & Cloudflare Workers","description":"Rajt (v0.0.106, pre-1.0) is a TypeScript-native, fully typed serverless framework (not a runtime) that acts as a bundler layer for AWS Lambda (Node.js ≥18, LLRT) and Cloudflare Workers. It provides a router, middleware, and type-safe request/response handling with zero external runtime dependencies. Its key differentiators: single interface across Lambda and Workers, tree-shakable bundler integration, and strict typing that catches misconfigurations at compile time. Active development with frequent releases; not stable yet. Consider alternatives like @aws-lambda-powertools, Hono, or Itty Router for production.","status":"active","version":"0.0.106","language":"javascript","source_language":"en","source_url":"git://github.com/attla/rajt","tags":["javascript","rajt","aws","lambda","llrt","app","http","application","framework"],"install":[{"cmd":"npm install rajt","lang":"bash","label":"npm"},{"cmd":"yarn add rajt","lang":"bash","label":"yarn"},{"cmd":"pnpm add rajt","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Rajt is ESM-only; CJS require() throws. Named export, not default.","wrong":"const Rajt = require('rajt')","symbol":"Rajt","correct":"import { Rajt } from 'rajt'"},{"note":"Router is a named export, not default. Common mistake due to other frameworks.","wrong":"import Router from 'rajt'","symbol":"Router","correct":"import { Router } from 'rajt'"},{"note":"Subpath exports not defined; 'rajt' only.","wrong":"import { defineConfig } from 'rajt/config'","symbol":"defineConfig","correct":"import { defineConfig } from 'rajt'"}],"quickstart":{"code":"import { Rajt, Router } from 'rajt';\n\nconst router = new Router();\nrouter.get('/hello', async (req) => {\n  return new Response('Hello, World!');\n});\n\nconst app = new Rajt();\napp.use(router);\n\nexport const handler = app.handle;\n","lang":"typescript","description":"Creates a basic HTTP server using Rajt's router and exports the handler for AWS Lambda or Cloudflare Workers."},"warnings":[{"fix":"Lock version and watch changelog. Do not use for production-critical applications.","message":"Rajt v0.0.106 is pre-1.0 with frequent breaking changes. API surface may change without major version bump.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Call app.use(router) instead of router.use(middleware).","message":"The Router instance does not support middleware attached directly to it; must use Rajt instance's use() method.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Import types: import { LambdaContext } from 'rajt/types/aws';","message":"Environment-specific features (e.g., AWS Lambda context) require explicit types from 'rajt/types/aws' or 'rajt/types/cloudflare'.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Test thoroughly on LLRT; file issues if missing features.","message":"LLRT support is experimental and may not cover full Lambda API.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Return a standard Response object, e.g., new Response(body, { status: 200 }).","message":"Response objects must follow Web API Response interface; do not use AWS Lambda-style callbacks.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure package.json has 'type': 'module' and use import syntax. Node.js >=18 required.","cause":"ESM-only package; using require() or misconfigured bundler/Node.js ES modules.","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'rajt' imported from ..."},{"fix":"Use app.use(router) on the Rajt instance.","cause":"Calling router.use() instead of app.use(router).","error":"TypeError: (intermediate value).use is not a function"},{"fix":"Import and use types from 'rajt/types/aws' as type assertion.","cause":"Accessing Lambda-specific properties without type augmentation.","error":"TS2339: Property 'requestContext' does not exist on type 'Request'"},{"fix":"Switch to ESM syntax: import { Rajt } from 'rajt'.","cause":"Importing rajt using CJS require() or in a CJS context.","error":"SyntaxError: Unexpected identifier 'Rajt'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}