barejs 0.1.47 → 0.1.48
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/LICENSE +20 -20
- package/README.md +184 -184
- package/dist/index.js +89 -187
- package/dist/types/security/auth.d.ts +2 -2
- package/package.json +68 -68
- package/src/core/bare.ts +315 -318
- package/src/core/config.ts +31 -31
- package/src/core/context.ts +111 -111
- package/src/core/loader.ts +12 -12
- package/src/core/radix.ts +184 -171
- package/src/core/router.ts +60 -62
- package/src/index.ts +60 -60
- package/src/security/auth.ts +174 -153
- package/src/security/cors.ts +45 -26
- package/src/security/hash.ts +22 -19
- package/src/security/validators.ts +133 -133
- package/src/utils/static.ts +42 -25
|
@@ -5,9 +5,9 @@ import type { Next } from '../core/context';
|
|
|
5
5
|
export declare const createToken: (payload: object, secret: string) => Promise<string>;
|
|
6
6
|
/**
|
|
7
7
|
* 1. BARE TOKEN AUTH (Standard JWT Middleware)
|
|
8
|
-
* High-performance JWT
|
|
8
|
+
* High-performance, constant-time JWT middleware for BareJS
|
|
9
9
|
*/
|
|
10
|
-
export declare const bareAuth: (secret: string) => (ctx: any, next: any) =>
|
|
10
|
+
export declare const bareAuth: (secret: string) => (ctx: any, next: any) => any;
|
|
11
11
|
/**
|
|
12
12
|
* 2. BASIC AUTH
|
|
13
13
|
* Useful for internal tools and simple admin panels
|
package/package.json
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "barejs",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"author": "xarhang",
|
|
5
|
-
"description": "High-performance JIT-specialized web framework for Bun",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/types/index.d.ts",
|
|
9
|
-
"type": "module",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"import": "./dist/index.js",
|
|
13
|
-
"types": "./dist/types/index.d.ts"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"sideEffects": false,
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/xarhang/barejs.git"
|
|
20
|
-
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"test": "bun test",
|
|
23
|
-
"benchs": "bun run benchmarks/index.ts",
|
|
24
|
-
"bench": "bun run benchmarks/head-to-head.ts",
|
|
25
|
-
"dev": "bun --watch example/index.ts",
|
|
26
|
-
"build": "bun ./scripts/build.ts",
|
|
27
|
-
"prepublishOnly": "bun run build",
|
|
28
|
-
"release": "bun run build && npm version patch && npm publish --access public"
|
|
29
|
-
},
|
|
30
|
-
"keywords": [
|
|
31
|
-
"bun",
|
|
32
|
-
"framework",
|
|
33
|
-
"fastest",
|
|
34
|
-
"jit",
|
|
35
|
-
"typebox",
|
|
36
|
-
"zod",
|
|
37
|
-
"barejs",
|
|
38
|
-
"http-server"
|
|
39
|
-
],
|
|
40
|
-
"license": "MIT",
|
|
41
|
-
"peerDependencies": {
|
|
42
|
-
"@sinclair/typebox": "^0.34.46",
|
|
43
|
-
"zod": "^3.0.0"
|
|
44
|
-
},
|
|
45
|
-
"peerDependenciesMeta": {
|
|
46
|
-
"@sinclair/typebox": {
|
|
47
|
-
"optional": true
|
|
48
|
-
},
|
|
49
|
-
"zod": {
|
|
50
|
-
"optional": true
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@sinclair/typebox": "^0.34.47",
|
|
55
|
-
"@types/bun": "^1.3.5",
|
|
56
|
-
"elysia": "latest",
|
|
57
|
-
"hono": "latest",
|
|
58
|
-
"mitata": "^1.0.34",
|
|
59
|
-
"typescript": "latest",
|
|
60
|
-
"zod": "^3.25.76"
|
|
61
|
-
},
|
|
62
|
-
"files": [
|
|
63
|
-
"dist",
|
|
64
|
-
"src",
|
|
65
|
-
"README.md",
|
|
66
|
-
"LICENSE"
|
|
67
|
-
]
|
|
68
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "barejs",
|
|
3
|
+
"version": "0.1.48",
|
|
4
|
+
"author": "xarhang",
|
|
5
|
+
"description": "High-performance JIT-specialized web framework for Bun",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/types/index.d.ts",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/types/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/xarhang/barejs.git"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "bun test",
|
|
23
|
+
"benchs": "bun run benchmarks/index.ts",
|
|
24
|
+
"bench": "bun run benchmarks/head-to-head.ts",
|
|
25
|
+
"dev": "bun --watch example/index.ts",
|
|
26
|
+
"build": "bun ./scripts/build.ts",
|
|
27
|
+
"prepublishOnly": "bun run build",
|
|
28
|
+
"release": "bun run build && npm version patch && npm publish --access public"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"bun",
|
|
32
|
+
"framework",
|
|
33
|
+
"fastest",
|
|
34
|
+
"jit",
|
|
35
|
+
"typebox",
|
|
36
|
+
"zod",
|
|
37
|
+
"barejs",
|
|
38
|
+
"http-server"
|
|
39
|
+
],
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@sinclair/typebox": "^0.34.46",
|
|
43
|
+
"zod": "^3.0.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"@sinclair/typebox": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"zod": {
|
|
50
|
+
"optional": true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@sinclair/typebox": "^0.34.47",
|
|
55
|
+
"@types/bun": "^1.3.5",
|
|
56
|
+
"elysia": "latest",
|
|
57
|
+
"hono": "latest",
|
|
58
|
+
"mitata": "^1.0.34",
|
|
59
|
+
"typescript": "latest",
|
|
60
|
+
"zod": "^3.25.76"
|
|
61
|
+
},
|
|
62
|
+
"files": [
|
|
63
|
+
"dist",
|
|
64
|
+
"src",
|
|
65
|
+
"README.md",
|
|
66
|
+
"LICENSE"
|
|
67
|
+
]
|
|
68
|
+
}
|