glim-node
v0.0.14
Published
A TypeScript-first toolkit for building Node.js applications with Hono.js, featuring a powerful CLI for project scaffolding and management.
Readme
Glim Node
A TypeScript-first toolkit for building Node.js applications with Hono.js, featuring a powerful CLI for project scaffolding and management.
Features
- 🚀 Hono.js Integration: A type-safe wrapper around Hono.js with built-in helpers for HTTP operations
- 📝 Type Safety: First-class TypeScript support with comprehensive type definitions
- 🔌 Extensible: Built-in support for common integrations (PostgreSQL, Redis, AWS)
- 🎯 CLI Tool: Interactive CLI for creating and managing Glim Node projects
Installation
pnpm add glim-nodeQuick Start
- Create a new project:
pnpm dlx glim-node create- Start the development server:
cd my-app
docker compose upUsage Examples
Module Setup (src/modules/my-module/index.ts)
import { createModule } from 'glim-node';
import { router } from './router';
// Create a module with integrations
const myModule = await createModule('my-module', {
db: {
type: 'db.postgres',
},
cache: {
type: 'cache.redis',
},
storage: {
type: 'storage.s3',
},
notification: {
type: 'notification.sns',
config: { topics: ['my-topic'] },
},
});
// Load router with type-safe client
const hcWithType = myModule.loadRouter(router);
export const client = hcWithType('http://localhost:3000');
export { myModule };Server Start (src/index.ts)
import { start } from 'glim-node/server';
import { myModule } from './modules/my-module';
// Start the server with your module
start([myModule]);