pronghorn 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ export declare class HttpError extends Error {
2
+ status: number;
3
+ details?: unknown;
4
+ constructor(status: number, message: string, details?: unknown);
5
+ }
6
+ export declare const badRequest: (message: string, details?: unknown) => HttpError;
7
+ export declare const unauthorized: (message?: string) => HttpError;
8
+ export declare const forbidden: (message?: string) => HttpError;
9
+ export declare const notFound: (message?: string) => HttpError;
@@ -0,0 +1,2 @@
1
+ export declare function signToken(secret: string, payload: Record<string, unknown>, expiresIn?: string): Promise<string>;
2
+ export declare function verifyToken(secret: string, token: string): Promise<Record<string, unknown>>;
@@ -0,0 +1,4 @@
1
+ import type { Middleware, MiddlewareScope } from '../core/types';
2
+ export declare const scope: MiddlewareScope;
3
+ declare const cors: Middleware;
4
+ export default cors;
@@ -0,0 +1,4 @@
1
+ import type { Middleware, MiddlewareScope } from '../core/types';
2
+ export declare const scope: MiddlewareScope;
3
+ declare const errorHandler: Middleware;
4
+ export default errorHandler;
@@ -0,0 +1,5 @@
1
+ import type { Middleware } from '../core/types';
2
+ export interface JwtAuthOptions {
3
+ secret: string;
4
+ }
5
+ export declare function createJwtAuth(options: JwtAuthOptions): Middleware;
@@ -0,0 +1,4 @@
1
+ import type { Middleware, MiddlewareScope } from '../core/types';
2
+ export declare const scope: MiddlewareScope;
3
+ declare const logger: Middleware;
4
+ export default logger;
@@ -0,0 +1,2 @@
1
+ import type { Middleware } from '../core/types';
2
+ export declare function rateLimit(limit?: number, windowMs?: number): Middleware;
@@ -0,0 +1,4 @@
1
+ import type { Middleware, MiddlewareScope } from '../core/types';
2
+ export declare const scope: MiddlewareScope;
3
+ declare const requireAuth: Middleware;
4
+ export default requireAuth;
@@ -0,0 +1,6 @@
1
+ import type { Middleware } from '../core/types';
2
+ import { type ZodType } from 'zod';
3
+ export declare function validate(schema: {
4
+ body?: ZodType;
5
+ query?: ZodType;
6
+ }): Middleware;
@@ -0,0 +1,6 @@
1
+ import type { PluginFn } from '../core/types';
2
+ export interface EjsPluginOptions {
3
+ viewsDirectory?: string;
4
+ layout?: string;
5
+ }
6
+ export declare const ejsPlugin: PluginFn;
@@ -0,0 +1,5 @@
1
+ import type { PluginFn } from '../core/types';
2
+ export interface PrismaPluginOptions {
3
+ client: unknown;
4
+ }
5
+ export declare const prismaPlugin: PluginFn;
@@ -0,0 +1,5 @@
1
+ import type { PluginFn } from '../core/types';
2
+ export interface StaticPluginOptions {
3
+ directory?: string;
4
+ }
5
+ export declare const staticPlugin: PluginFn;
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "pronghorn",
3
+ "description": "Pronghorn is a fast, lightweight, TypeScript-first backend framework built for Bun. Like its namesake, it's designed for speed and agility, with a clean API, zero-config setup, and a modular plugin system. Pronghorn brings together the simplicity of Express and the performance-first mindset of Fastify, giving developers a streamlined way to build modern, scalable applications.",
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "engines": {
7
+ "bun": ">=1.3.0"
8
+ },
9
+ "os": ["darwin", "linux", "win32"],
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "types": "./dist/index.d.ts",
17
+ "files": ["dist", "README.md", "LICENSE"],
18
+ "scripts": {
19
+ "build": "bun build ./src/index.ts --outdir dist --target bun && tsc --emitDeclarationOnly --declaration --outDir dist",
20
+ "preinstall": "node -e \"if(!process.env.npm_config_user_agent?.includes('bun/')){console.error('\\n✖ Pronghorn requires Bun.\\nInstall Bun: https://bun.sh\\n');process.exit(1)}\"",
21
+ "prepublishOnly": "bun run build"
22
+ },
23
+ "keywords": ["bun", "framwork", "backend", "http", "pronghorn", "nolly"],
24
+ "license": "WTFPL",
25
+ "dependencies": {
26
+ "ejs": "^6.0.1",
27
+ "jose": "^6.2.3",
28
+ "zod": "^4.4.3"
29
+ },
30
+ "devDependencies": {
31
+ "@types/bun": "^1.3.14",
32
+ "@types/ejs": "^3.1.5",
33
+ "typescript": "^7.0.2"
34
+ }
35
+ }