@oxog/spark 1.1.1 → 1.3.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +656 -315
  2. package/LICENSE +20 -20
  3. package/README.md +288 -241
  4. package/package.json +90 -89
  5. package/src/core/application.js +1068 -956
  6. package/src/core/context.js +1098 -830
  7. package/src/core/middleware.js +303 -217
  8. package/src/index.js +183 -280
  9. package/src/middleware/body-parser.js +482 -526
  10. package/src/middleware/cache.js +177 -170
  11. package/src/middleware/compression.js +177 -182
  12. package/src/middleware/cors.js +176 -95
  13. package/src/middleware/health.js +219 -218
  14. package/src/middleware/logger.js +195 -194
  15. package/src/middleware/metrics.js +339 -327
  16. package/src/middleware/rate-limit.js +367 -319
  17. package/src/middleware/security.js +442 -332
  18. package/src/middleware/session.js +647 -529
  19. package/src/middleware/static.js +404 -299
  20. package/src/router/layer.js +197 -117
  21. package/src/router/route.js +149 -123
  22. package/src/router/router.js +705 -755
  23. package/src/utils/async-handler.js +145 -147
  24. package/src/utils/context-pool.js +83 -82
  25. package/src/utils/regex-validator.js +187 -163
  26. package/src/utils/safe-json.js +110 -0
  27. package/types/index.d.ts +538 -291
  28. package/dist/LICENSE +0 -21
  29. package/dist/README.md +0 -242
  30. package/dist/core/application.js +0 -959
  31. package/dist/core/context.js +0 -833
  32. package/dist/core/middleware.js +0 -220
  33. package/dist/core/request.js +0 -335
  34. package/dist/core/response.js +0 -377
  35. package/dist/index.js +0 -280
  36. package/dist/middleware/body-parser.js +0 -528
  37. package/dist/middleware/cache.js +0 -173
  38. package/dist/middleware/compression.js +0 -185
  39. package/dist/middleware/cors.js +0 -97
  40. package/dist/middleware/health.js +0 -221
  41. package/dist/middleware/index.js +0 -23
  42. package/dist/middleware/logger.js +0 -197
  43. package/dist/middleware/metrics.js +0 -330
  44. package/dist/middleware/rate-limit.js +0 -322
  45. package/dist/middleware/security.js +0 -335
  46. package/dist/middleware/session.js +0 -532
  47. package/dist/middleware/static.js +0 -301
  48. package/dist/package.json +0 -62
  49. package/dist/router/layer.js +0 -119
  50. package/dist/router/route.js +0 -125
  51. package/dist/router/router.js +0 -758
  52. package/dist/types/index.d.ts +0 -291
  53. package/dist/utils/async-handler.js +0 -150
  54. package/dist/utils/cache.js +0 -443
  55. package/dist/utils/context-pool.js +0 -85
  56. package/dist/utils/error-types.js +0 -134
  57. package/dist/utils/http.js +0 -415
  58. package/dist/utils/regex-validator.js +0 -166
  59. package/src/core/request.js +0 -335
  60. package/src/core/response.js +0 -377
  61. package/src/middleware/index.js +0 -23
  62. package/src/utils/cache.js +0 -443
  63. package/src/utils/error-types.js +0 -134
  64. package/src/utils/http.js +0 -415
package/package.json CHANGED
@@ -1,89 +1,90 @@
1
- {
2
- "name": "@oxog/spark",
3
- "version": "1.1.1",
4
- "description": "Ultra-fast, zero-dependency Node.js web framework with security hardening, memory leak protection, and enhanced error handling",
5
- "main": "src/index.js",
6
- "types": "types/index.d.ts",
7
- "engines": {
8
- "node": ">=14.0.0"
9
- },
10
- "scripts": {
11
- "test": "node tests/run-all-tests.js",
12
- "test:integration": "node test-integration.js",
13
- "test:unit": "node tests/unit/run.js",
14
- "test:performance": "node tests/performance/run.js",
15
- "test:security": "node tests/security/run.js",
16
- "test:coverage": "node scripts/test-coverage.js",
17
- "build": "node scripts/build.js",
18
- "build:minify": "node scripts/minify.js",
19
- "benchmark": "node benchmarks/run.js",
20
- "benchmark:express": "node benchmarks/vs-express.js",
21
- "benchmark:fastify": "node benchmarks/vs-fastify.js",
22
- "benchmark:koa": "node benchmarks/vs-koa.js",
23
- "dev": "node examples/basic-api/server.js",
24
- "lint": "node scripts/lint.js",
25
- "format:check": "node scripts/format-check.js",
26
- "docs": "node scripts/generate-docs.js",
27
- "docs:validate": "node scripts/validate-docs.js",
28
- "docs:build": "node scripts/build-docs.js",
29
- "docs:test": "node tests/docs-examples/run-all-tests.js",
30
- "examples:test": "node scripts/test-examples.js",
31
- "validate:all": "node validation/run-all-validations.js",
32
- "validate:core": "node validation/core-functionality.js",
33
- "validate:features": "node validation/features/checklist.js",
34
- "validate:build": "node scripts/validate-build.js",
35
- "validate:package": "node scripts/validate-package.js",
36
- "status": "node scripts/production-summary.js",
37
- "prepublishOnly": "node scripts/final-validation.js",
38
- "start": "node examples/basic-api/server.js"
39
- },
40
- "keywords": [
41
- "spark",
42
- "api",
43
- "framework",
44
- "rest",
45
- "http",
46
- "server",
47
- "web",
48
- "app",
49
- "middleware",
50
- "router",
51
- "zero-dependency",
52
- "fast",
53
- "secure",
54
- "lightweight",
55
- "performance",
56
- "typescript",
57
- "security",
58
- "memory-safe",
59
- "error-handling",
60
- "redos-protection",
61
- "path-traversal-protection",
62
- "header-injection-protection"
63
- ],
64
- "author": "Ersin Koç",
65
- "license": "MIT",
66
- "repository": {
67
- "type": "git",
68
- "url": "https://github.com/ersinkoc/spark.git"
69
- },
70
- "bugs": {
71
- "url": "https://github.com/ersinkoc/spark/issues"
72
- },
73
- "homepage": "https://github.com/ersinkoc/spark#readme",
74
- "files": [
75
- "src/",
76
- "types/",
77
- "dist/",
78
- "README.md",
79
- "LICENSE",
80
- "CHANGELOG.md"
81
- ],
82
- "exports": {
83
- ".": {
84
- "import": "./src/index.js",
85
- "require": "./src/index.js"
86
- },
87
- "./package.json": "./package.json"
88
- }
89
- }
1
+ {
2
+ "name": "@oxog/spark",
3
+ "version": "1.3.0",
4
+ "description": "Zero-dependency Node.js web framework with routing, middleware, body parsing, sessions, CORS, CSRF, rate limiting and security headers",
5
+ "main": "src/index.js",
6
+ "types": "types/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./types/index.d.ts",
10
+ "require": "./src/index.js",
11
+ "import": "./src/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src/",
17
+ "types/",
18
+ "README.md",
19
+ "LICENSE",
20
+ "CHANGELOG.md"
21
+ ],
22
+ "sideEffects": false,
23
+ "engines": {
24
+ "node": ">=18"
25
+ },
26
+ "scripts": {
27
+ "test": "vitest run",
28
+ "test:watch": "vitest",
29
+ "test:coverage": "vitest run --coverage",
30
+ "lint": "eslint src tests --max-warnings=0",
31
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
32
+ "build": "node -e \"require('./src/index.js')\"",
33
+ "test:package": "node scripts/check-package.mjs",
34
+ "check": "npm run lint && npm run typecheck && npm run test:coverage",
35
+ "prepublishOnly": "npm run check && npm run build && npm run test:package",
36
+ "benchmark": "node benchmarks/run.js",
37
+ "dev": "node examples/basic-api/server.js",
38
+ "start": "node examples/basic-api/server.js"
39
+ },
40
+ "keywords": [
41
+ "spark",
42
+ "api",
43
+ "framework",
44
+ "rest",
45
+ "http",
46
+ "server",
47
+ "web",
48
+ "app",
49
+ "middleware",
50
+ "router",
51
+ "zero-dependency",
52
+ "fast",
53
+ "secure",
54
+ "lightweight",
55
+ "performance",
56
+ "typescript",
57
+ "security",
58
+ "memory-safe",
59
+ "error-handling",
60
+ "redos-protection",
61
+ "path-traversal-protection",
62
+ "header-injection-protection"
63
+ ],
64
+ "author": "Ersin Ko\u00e7",
65
+ "license": "MIT",
66
+ "repository": {
67
+ "type": "git",
68
+ "url": "git+https://github.com/ersinkoc/Spark.git"
69
+ },
70
+ "bugs": {
71
+ "url": "https://github.com/ersinkoc/Spark/issues"
72
+ },
73
+ "homepage": "https://github.com/ersinkoc/Spark#readme",
74
+ "devDependencies": {
75
+ "@arethetypeswrong/cli": "^0.18.5",
76
+ "@eslint/js": "^10.0.0",
77
+ "@types/node": "^20.19.43",
78
+ "@vitest/coverage-v8": "^4.1.12",
79
+ "eslint": "^10.0.0",
80
+ "globals": "^17.0.0",
81
+ "publint": "^0.3.25",
82
+ "typescript": "^5.9.3",
83
+ "typescript-eslint": "^8.74.0",
84
+ "vite": "^6.4.6",
85
+ "vitest": "^4.1.12"
86
+ },
87
+ "oxog": {
88
+ "sourcePublishedReason": "Spark is published as its CommonJS sources (src/*.js, no build step) with hand-written types/index.d.ts; ESM consumers use Node's CommonJS named-export detection. A tsup ESM+CJS build would need the sources rewritten as ESM (esbuild cannot derive named ESM exports from CommonJS)."
89
+ }
90
+ }