qhttpx 1.9.3 → 1.9.4

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.9.4] - 2026-01-20
6
+ **"The Silent Performance Update"**
7
+
8
+ ### Changed
9
+ - **Performance**: Disabled logging by default in standard presets to reduce I/O overhead and improve throughput in production environments.
10
+
5
11
  ## [1.9.3] - 2026-01-20
6
12
  **"The Distribution Fix"**
7
13
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qhttpx",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "gypfile": false,
5
5
  "description": "The Ultra-Fast HTTP Framework for Node.js",
6
6
  "main": "dist/src/index.js",
@@ -151,6 +151,30 @@ export type QHTTPXOptions = {
151
151
  rateLimit?: RateLimitOptions;
152
152
  cors?: CorsOptions | boolean;
153
153
  compression?: CompressionOptions | boolean;
154
+ logging?: LoggerOptions | boolean;
155
+ security?: SecureDefaultsOptions;
156
+ };
157
+ export type LogEntry = {
158
+ method: string;
159
+ path: string;
160
+ status: number;
161
+ durationMs: number;
162
+ requestId?: string;
163
+ };
164
+ export type LoggerOptions = {
165
+ sink?: (entry: LogEntry, ctx: QHTTPXContext) => void;
166
+ };
167
+ export type SecurityHeadersOptions = {
168
+ contentSecurityPolicy?: string | null;
169
+ referrerPolicy?: string | null;
170
+ xFrameOptions?: 'DENY' | 'SAMEORIGIN' | null;
171
+ xContentTypeOptions?: 'nosniff' | null;
172
+ xXssProtection?: '0' | '1; mode=block' | null;
173
+ strictTransportSecurity?: string | null;
174
+ };
175
+ export type SecureDefaultsOptions = {
176
+ cors?: CorsOptions;
177
+ securityHeaders?: SecurityHeadersOptions;
154
178
  };
155
179
  export type CorsOrigin = string | string[] | ((origin: string | undefined) => string | null | undefined);
156
180
  export type CorsOptions = {
package/dist/src/index.js CHANGED
@@ -66,6 +66,8 @@ function createHttpApp(options = {}) {
66
66
  rateLimit: options.rateLimit,
67
67
  cors: options.cors,
68
68
  compression: options.compression,
69
+ logging: options.logging,
70
+ security: options.security,
69
71
  });
70
72
  middlewares.forEach((mw) => app.use(mw));
71
73
  }
@@ -1,6 +1,5 @@
1
- import { QHTTPXMiddleware, RateLimitOptions, CorsOptions, CompressionOptions } from '../core/types';
1
+ import { QHTTPXMiddleware, RateLimitOptions, CorsOptions, CompressionOptions, LoggerOptions } from '../core/types';
2
2
  import { SecureDefaultsOptions } from './security';
3
- import { LoggerOptions } from '../utils/logger';
4
3
  import { StaticOptions } from './static';
5
4
  export type ApiPresetOptions = {
6
5
  security?: SecureDefaultsOptions;
@@ -25,7 +25,7 @@ function createApiPreset(options = {}) {
25
25
  middlewares.push((0, compression_1.createCompressionMiddleware)(opts));
26
26
  }
27
27
  // 4. Logging
28
- if (options.logging !== false) {
28
+ if (options.logging) {
29
29
  const loggerOptions = typeof options.logging === 'object' ? options.logging : {};
30
30
  middlewares.push((0, logger_1.createLoggerMiddleware)(loggerOptions));
31
31
  }
@@ -1,17 +1,6 @@
1
- import { QHTTPXContext, QHTTPXMiddleware, CorsOptions } from '../core/types';
2
- export type SecurityHeadersOptions = {
3
- contentSecurityPolicy?: string | null;
4
- referrerPolicy?: string | null;
5
- xFrameOptions?: 'DENY' | 'SAMEORIGIN' | null;
6
- xContentTypeOptions?: 'nosniff' | null;
7
- xXssProtection?: '0' | '1; mode=block' | null;
8
- strictTransportSecurity?: string | null;
9
- };
1
+ import { QHTTPXContext, QHTTPXMiddleware, SecurityHeadersOptions, SecureDefaultsOptions } from '../core/types';
2
+ export { SecurityHeadersOptions, SecureDefaultsOptions };
10
3
  export declare function createSecurityHeadersMiddleware(options?: SecurityHeadersOptions): QHTTPXMiddleware;
11
- export type SecureDefaultsOptions = {
12
- cors?: CorsOptions;
13
- securityHeaders?: SecurityHeadersOptions;
14
- };
15
4
  export declare function createSecureDefaults(options?: SecureDefaultsOptions): QHTTPXMiddleware[];
16
5
  export type RateLimitOptions = {
17
6
  maxRequests: number;
@@ -1,12 +1,2 @@
1
- import { QHTTPXContext, QHTTPXMiddleware } from '../core/types';
2
- export type LogEntry = {
3
- method: string;
4
- path: string;
5
- status: number;
6
- durationMs: number;
7
- requestId?: string;
8
- };
9
- export type LoggerOptions = {
10
- sink?: (entry: LogEntry, ctx: QHTTPXContext) => void;
11
- };
1
+ import { QHTTPXMiddleware, LoggerOptions } from '../core/types';
12
2
  export declare function createLoggerMiddleware(options?: LoggerOptions): QHTTPXMiddleware;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qhttpx",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "gypfile": false,
5
5
  "description": "The Ultra-Fast HTTP Framework for Node.js",
6
6
  "main": "dist/src/index.js",
Binary file
Binary file