Registry / web-framework / typed-framework

typed-framework

JSON →
library0.8.12jsnpmunverified

TypeScript-first, Express-based MVC framework with dependency injection, decorators, and Spring-like patterns. Current version: 1.1.7. Release cadence: irregular, pre-1.0.0 status indicated. Differentiator: full decorator support for controllers, services, filters, middleware, and parameter injection without runtime config files – all via TypeScript decorators (experimentalDecorators required).

npm install typed-framework
INSTALL
IMPORT
SIG · TYPED-FRAMEWORK
T
typed-framework
web-frameworkjavascriptv0.8.12
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ApplicationLoader
import { ApplicationLoader } from 'typed-framework'
const { ApplicationLoader } = require('typed-framework')
Requires TypeScript and 'experimentalDecorators': true. Default export also available: import TypedFramework from 'typed-framework'.
RestController
import { RestController } from 'typed-framework'
import { RestController } from 'typed-framework/dist'
All decorators are in the main package barrel. Do not import from subpaths.
Service
import { Service } from 'typed-framework'
import { Service } from 'typed-framework/lib'
Use top-level import. No separate module paths.

Shows minimal setup with ApplicationLoader, Service, RestController, and Get endpoint. Requires reflect-metadata import first.

import 'reflect-metadata'; import { ApplicationLoader, ApplicationSettings, RestController, Get, Data, Res, Service } from 'typed-framework'; import express from 'express'; @Service() class UserService { public getUser() { return { id: 1, name: 'John' }; } } @RestController('/api') class UserController { constructor(private userService: UserService) {} @Get('/user') public indexAction(@Data() data: any, @Res() res: express.Response) { res.json(this.userService.getUser()); } } @ApplicationSettings({ rootDir: __dirname }) class App extends ApplicationLoader {} App.initialize().catch(console.error);
Debug
Known issues
breakingTypeScript version compatibility: requiring experimentalDecorators and emitDecoratorMetadata in tsconfig.json. Fails silently without them.
fix
Set 'experimentalDecorators': true and 'emitDecoratorMetadata': true in tsconfig.json.
affects: >=0.0.0
gotchaApplicationSettings must specify rootDir as absolute path; relative paths cause runtime errors looking for srcDir, publicDir etc.
fix
Use path.resolve() or __dirname to pass absolute path to rootDir.
affects: >=0.0.0
deprecatedThe package README states 'pre-1.0.0', but versions 1.1.x exist. API stability not guaranteed; breaking changes possible in minor versions.
fix
Pin exact version in package.json and test upgrades carefully.
affects: <=1.1.7
gotchaConnectionFactory.getConnection() and LogFactory.getLogger() are singleton factories that require prior configuration. If called before setup, they return undefined causing crashes.
fix
Initialize database and logger in ApplicationLoader subclass before any service uses them.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot read property 'getUser' of undefined
Constructor injection not working because UserService not registered properly or decorators missing.
fix
Ensure UserService has @Service() decorator and @RestController() is applied. Also check tsconfig.json for experimentalDecorators and emitDecoratorMetadata.
Error: No metadata for 'type' found on property 'indexAction'
emitDecoratorMetadata not enabled in tsconfig.json.
fix
Add 'emitDecoratorMetadata': true under compilerOptions in tsconfig.json.
Class extends value undefined is not a constructor or null
ApplicationLoader is not imported correctly or reflect-metadata not imported first.
fix
Ensure reflect-metadata is imported at the top of the entry file: import 'reflect-metadata';
Upgrade
Version history
0.8.12latest on npm
Audit
Dependencies
expressrequiredCore HTTP server framework
reflect-metadatarequiredRequired by decorators and dependency injection
knexoptionalOptional database connection via ConnectionFactory
winstonoptionalOptional logger via LogFactory
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
typed-framework — npm install typed-framework · libregistry