https://github.com/honestjs/honest
HonestJS - a modern web framework built on top of Hono
https://github.com/honestjs/honest
bun deno framework honest honestjs hono javascript nest node nodejs typescript web-framework
Last synced: 17 days ago
JSON representation
HonestJS - a modern web framework built on top of Hono
- Host: GitHub
- URL: https://github.com/honestjs/honest
- Owner: honestjs
- License: mit
- Created: 2025-04-14T18:05:52.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2026-03-27T23:51:20.000Z (22 days ago)
- Last Synced: 2026-03-28T02:22:56.314Z (22 days ago)
- Topics: bun, deno, framework, honest, honestjs, hono, javascript, nest, node, nodejs, typescript, web-framework
- Language: TypeScript
- Homepage: https://honestjs.dev
- Size: 284 KB
- Stars: 85
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
A modern, TypeScript-first web framework built on top of Hono, designed for building scalable and
maintainable web applications. Honest combines the elegance and architecture of Nest with the
ultra-fast performance of Hono, giving you the best of both worlds.
middleware
|
guards
|
pipes
|
filters
[](https://github.com/honestjs/honest/blob/main/LICENSE)
[](https://www.npmjs.com/package/honestjs)
[](https://www.npmjs.com/package/honestjs)
[](https://bundlephobia.com/result?p=honestjs)
[](https://bundlephobia.com/result?p=honestjs)
[](https://github.com/honestjs/honest/pulse)
[](https://github.com/honestjs/honest/commits/main)
[](https://discord.gg/g3TUeXbeq)
## Cursor / Agent skills
Install the Honest skill so your editor agent (e.g. Cursor) can use Honest-specific guidance:
```bash
bunx skills add https://github.com/honestjs/skills --skill honest
```
See [honestjs/skills](https://github.com/honestjs/skills) for details.
> π¨ **Early Development Warning** π¨
>
> Honest is currently in early development (pre-v1.0.0). Please be aware that:
>
> - The API is not stable and may change frequently
> - Breaking changes can occur between minor versions
> - Some features might be incomplete or missing
> - Documentation may not always be up to date
>
> We recommend not using it in production until v1.0.0 is released.
> β οΈ **Documentation is not yet complete** β οΈ
>
> If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. See
> [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for community
> guidelines.
## Quick Start
```bash
bun add -g @honestjs/cli
honestjs new my-project # alias: honest, hnjs
cd my-project
bun dev
```
This creates a new project with a standard structure and config. Use the [website](https://github.com/honestjs/website)
for full docs.
## Features
- **π High performance** β Built on Hono for maximum speed and minimal overhead.
- **ποΈ Familiar architecture** β Decorator-based API inspired by NestJS; TypeScript-first.
- **π Dependency injection** β Built-in DI container for clean, testable code and automatic wiring.
- **π Plugin system** β Extend the app with custom plugins, middleware, pipes, and filters. Plugins run in
`options.plugins` order; wrapped entries may attach `preProcessors` / `postProcessors` and optional `name` for
diagnostics.
- **π£οΈ Advanced routing** β Prefixes, API versioning, and nested route organization.
- **π‘οΈ Request pipeline** β Middleware, guards, pipes, and filters at app, controller, or handler level.
- **π§ͺ Lightweight testing harness** β Helpers for application, controller, and service-level tests.
- **π§ Startup guide mode** β Actionable diagnostics hints for startup failures.
- **π TypeScript-first** β Strong typing and great IDE support out of the box.
- **π₯οΈ MVC & SSR** β Full-stack apps with Hono JSX views; use the `mvc` template or the docs.
### In code
```typescript
import 'reflect-metadata'
import { Application, Controller, Get, Module, Service } from 'honestjs'
import { LoggerMiddleware } from '@honestjs/middleware'
import { AuthGuard } from '@honestjs/guards'
import { ValidationPipe } from '@honestjs/pipes'
import { HttpExceptionFilter } from '@honestjs/filters'
import { ApiDocsPlugin } from '@honestjs/api-docs-plugin'
@Service()
class AppService {
hello(): string {
return 'Hello, Honest!'
}
}
@Controller()
class AppController {
constructor(private readonly appService: AppService) {}
@Get()
hello() {
return this.appService.hello()
}
}
@Module({
controllers: [AppController],
services: [AppService]
})
class AppModule {}
const { app, hono } = await Application.create(AppModule, {
startupGuide: { verbose: true },
debug: {
routes: true,
plugins: true,
pipeline: true,
di: true,
startup: true
},
logger: myLogger,
strict: { requireRoutes: true },
deprecations: { printPreV1Warning: true },
container: myContainer,
hono: {
strict: true,
router: customRouter
},
routing: {
prefix: 'api',
version: 1
},
// Components: use class (e.g. AuthGuard) or instance (e.g. new LoggerMiddleware()) to pass options
components: {
middleware: [new LoggerMiddleware()],
guards: [AuthGuard],
pipes: [ValidationPipe],
filters: [HttpExceptionFilter]
},
plugins: [
new RPCPlugin(),
new ApiDocsPlugin(),
{
plugin: MyPlugin,
name: 'core',
preProcessors: [pre],
postProcessors: [post]
},
{ plugin: MetricsPlugin, name: 'metrics' }
],
onError: (err, c) => c.json({ error: err.message }, 500),
notFound: (c) => c.json({ error: 'Not found' }, 404)
})
export default hono
```
Controllers, services, and modules are wired by decorators; use **guards** for auth, **pipes** for validation, and
**filters** for error handling. See the [documentation](https://github.com/honestjs/website) for details.
## Runtime Metadata Isolation
Decorator metadata is still collected globally, but each application instance now runs on an immutable metadata snapshot
captured during startup. This prevents metadata mutations made after bootstrap from changing behavior in already-running
applications.
## Plugin order
Plugins run in the order they appear in `options.plugins`. Put producer plugins (for example RPC) before consumers (for
example API docs) when one plugin depends on anotherβs app-context output.
## Testing harness
Honest exports lightweight helpers for common test setups.
```typescript
import { createControllerTestApplication, createServiceTestContainer, createTestApplication } from 'honestjs'
const app = await createTestApplication({
controllers: [UsersController],
services: [UsersService]
})
const response = await app.request('/users')
const controllerApp = await createControllerTestApplication({
controller: UsersController
})
const services = createServiceTestContainer({
preload: [UsersService],
overrides: [{ provide: UsersService, useValue: mockUsersService }]
})
```
### Running tests in this package
This repo uses [Bun's test runner](https://bun.sh/docs/cli/test). From the package root:
- `bun test` β run all tests once
- `bun test --watch` β watch mode
- `bun test ` β limit to matching file or test names (for example `bun test application.bootstrap`)
- `bun run test:coverage` β same suite with coverage (summary in the terminal and `coverage/lcov.info`)
Co-locate tests as `*.test.ts` next to sources. Import `reflect-metadata` first in any file that loads decorated
classes, same as in application code.
Integration-style cases use `*.integration.test.ts` where the whole `Application` stack is exercised (for example the
request pipeline). Shared HTTP fixtures for application tests live under `src/testing/fixtures/` as **factory
functions** so each test gets fresh decorator metadata after `MetadataRegistry.clear()` in `afterEach`.
## Startup diagnostics guide mode
Enable startup guidance to get actionable remediation hints when initialization fails.
```typescript
await Application.create(AppModule, {
startupGuide: true
})
await Application.create(AppModule, {
startupGuide: { verbose: true }
})
```
Guide mode emits startup diagnostics hints for common issues such as missing decorators, strict no-routes startup, and
metadata issues.
## License
MIT Β© [Orkhan Karimov](https://github.com/kerimovok)
