@cedvict/http-guardian-plugin-logger 0.0.1-next.10
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 +5 -0
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/index.cjs +52 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cedvict
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# @cedvict/http-guardian-plugin-logger
|
|
2
|
+
|
|
3
|
+
Logger plugin for http-guardian. Adds a guard that logs request / response /
|
|
4
|
+
error events to a `LoggerSink` (defaults to `console`).
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { loggerPlugin } from "@cedvict/http-guardian-plugin-logger";
|
|
10
|
+
import { createHttpClient, createApiParserStructured, bearerAuth } from "@cedvict/http-guardian";
|
|
11
|
+
|
|
12
|
+
const api = createHttpClient({
|
|
13
|
+
baseUrl: "https://api.example.com",
|
|
14
|
+
auth: bearerAuth(() => token),
|
|
15
|
+
parser: createApiParserStructured(),
|
|
16
|
+
plugins: [loggerPlugin({ label: "api" })],
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Custom sink (e.g. pino, winston, browser-side ring buffer):
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
loggerPlugin({
|
|
24
|
+
sink: {
|
|
25
|
+
log: (label, payload) => myStructuredLogger.info({ label, ...payload }),
|
|
26
|
+
error: (label, payload) => myStructuredLogger.error({ label, ...payload }),
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Combining with `correlationIdGuard`
|
|
32
|
+
|
|
33
|
+
When [`correlationIdGuard`](../http-guardian) is active, the resolved
|
|
34
|
+
`correlationId` lives on `ctx.meta.correlationId`. Surface it in your structured
|
|
35
|
+
logs by writing a small wrapper guard that reads `ctx.meta` and forwards
|
|
36
|
+
the field:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { correlationIdGuard, type Guard } from "@cedvict/http-guardian";
|
|
40
|
+
|
|
41
|
+
const correlationLog: Guard = async (ctx, next) => {
|
|
42
|
+
const res = await next(ctx);
|
|
43
|
+
myStructuredLogger.info({
|
|
44
|
+
method: ctx.method,
|
|
45
|
+
url: ctx.url,
|
|
46
|
+
status: res.status,
|
|
47
|
+
correlation_id: ctx.meta?.correlationId,
|
|
48
|
+
trace_id: ctx.meta?.traceId,
|
|
49
|
+
});
|
|
50
|
+
return res;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
createHttpClient({
|
|
54
|
+
// ...
|
|
55
|
+
guards: [correlationIdGuard(), correlationLog],
|
|
56
|
+
plugins: [loggerPlugin()],
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This pattern keeps `loggerPlugin` framework-agnostic while letting you ship the
|
|
61
|
+
correlation/trace fields straight into your structured-log pipeline (Datadog,
|
|
62
|
+
Loki, ELK, etc.).
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
function toSafeUrl(u) {
|
|
5
|
+
return typeof u === "string" ? u : String(u);
|
|
6
|
+
}
|
|
7
|
+
function createLoggerGuard(sink, label) {
|
|
8
|
+
return async (ctx, next) => {
|
|
9
|
+
const t0 = Date.now();
|
|
10
|
+
try {
|
|
11
|
+
sink.log(label, {
|
|
12
|
+
event: "request",
|
|
13
|
+
method: ctx.method,
|
|
14
|
+
url: toSafeUrl(ctx.url)
|
|
15
|
+
});
|
|
16
|
+
const res = await next(ctx);
|
|
17
|
+
sink.log(label, {
|
|
18
|
+
event: "response",
|
|
19
|
+
method: ctx.method,
|
|
20
|
+
url: toSafeUrl(ctx.url),
|
|
21
|
+
status: res.status,
|
|
22
|
+
ms: Date.now() - t0
|
|
23
|
+
});
|
|
24
|
+
return res;
|
|
25
|
+
} catch (err) {
|
|
26
|
+
(sink.error ?? sink.log)(label, {
|
|
27
|
+
event: "error",
|
|
28
|
+
method: ctx.method,
|
|
29
|
+
url: toSafeUrl(ctx.url),
|
|
30
|
+
ms: Date.now() - t0,
|
|
31
|
+
error: err
|
|
32
|
+
});
|
|
33
|
+
throw err;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function loggerPlugin(opts = {}) {
|
|
38
|
+
const sink = opts.sink ?? console;
|
|
39
|
+
const label = opts.label ?? "http-guardian";
|
|
40
|
+
return {
|
|
41
|
+
name: "logger",
|
|
42
|
+
apply(options) {
|
|
43
|
+
options.guards ??= [];
|
|
44
|
+
options.guards.push(createLoggerGuard(sink, label));
|
|
45
|
+
return options;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
exports.loggerPlugin = loggerPlugin;
|
|
51
|
+
//# sourceMappingURL=index.cjs.map
|
|
52
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAeA,SAAS,UAAU,CAAA,EAAyB;AAG1C,EAAA,OAAO,OAAO,CAAA,KAAM,QAAA,GAAW,CAAA,GAAI,OAAO,CAAC,CAAA;AAC7C;AAEA,SAAS,iBAAA,CAAkB,MAAkB,KAAA,EAAsB;AACjE,EAAA,OAAO,OAAO,KAAK,IAAA,KAAS;AAC1B,IAAA,MAAM,EAAA,GAAK,KAAK,GAAA,EAAI;AACpB,IAAA,IAAI;AACF,MAAA,IAAA,CAAK,IAAI,KAAA,EAAO;AAAA,QACd,KAAA,EAAO,SAAA;AAAA,QACP,QAAQ,GAAA,CAAI,MAAA;AAAA,QACZ,GAAA,EAAK,SAAA,CAAU,GAAA,CAAI,GAAG;AAAA,OACvB,CAAA;AAED,MAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,GAAG,CAAA;AAE1B,MAAA,IAAA,CAAK,IAAI,KAAA,EAAO;AAAA,QACd,KAAA,EAAO,UAAA;AAAA,QACP,QAAQ,GAAA,CAAI,MAAA;AAAA,QACZ,GAAA,EAAK,SAAA,CAAU,GAAA,CAAI,GAAG,CAAA;AAAA,QACtB,QAAQ,GAAA,CAAI,MAAA;AAAA,QACZ,EAAA,EAAI,IAAA,CAAK,GAAA,EAAI,GAAI;AAAA,OAClB,CAAA;AAED,MAAA,OAAO,GAAA;AAAA,IACT,SAAS,GAAA,EAAK;AACZ,MAAA,CAAC,IAAA,CAAK,KAAA,IAAS,IAAA,CAAK,GAAA,EAAK,KAAA,EAAO;AAAA,QAC9B,KAAA,EAAO,OAAA;AAAA,QACP,QAAQ,GAAA,CAAI,MAAA;AAAA,QACZ,GAAA,EAAK,SAAA,CAAU,GAAA,CAAI,GAAG,CAAA;AAAA,QACtB,EAAA,EAAI,IAAA,CAAK,GAAA,EAAI,GAAI,EAAA;AAAA,QACjB,KAAA,EAAO;AAAA,OACR,CAAA;AACD,MAAA,MAAM,GAAA;AAAA,IACR;AAAA,EACF,CAAA;AACF;AAKO,SAAS,YAAA,CAAa,IAAA,GAA4B,EAAC,EAAe;AACvE,EAAA,MAAM,IAAA,GAAmB,KAAK,IAAA,IAAQ,OAAA;AACtC,EAAA,MAAM,KAAA,GAAQ,KAAK,KAAA,IAAS,eAAA;AAE5B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,QAAA;AAAA,IACN,MAAM,OAAA,EAAS;AACb,MAAA,OAAA,CAAQ,WAAW,EAAC;AACpB,MAAA,OAAA,CAAQ,MAAA,CAAO,IAAA,CAAK,iBAAA,CAAkB,IAAA,EAAM,KAAK,CAAC,CAAA;AAClD,MAAA,OAAO,OAAA;AAAA,IACT;AAAA,GACF;AACF","file":"index.cjs","sourcesContent":["import type { Guard, HttpPlugin } from \"@cedvict/http-guardian\";\n\nexport type LoggerSink = {\n log: (...args: any[]) => void;\n warn?: (...args: any[]) => void;\n error?: (...args: any[]) => void;\n};\n\nexport type LoggerPluginOptions = {\n /** Where logs are written. Defaults to console. */\n sink?: LoggerSink;\n /** Optional tag/prefix to help identify logs. */\n label?: string;\n};\n\nfunction toSafeUrl(u: string | URL): string {\n // In http-guardian's internal context, `url` may be a string (already resolved)\n // or a URL instance depending on the runtime/fetch implementation.\n return typeof u === \"string\" ? u : String(u);\n}\n\nfunction createLoggerGuard(sink: LoggerSink, label: string): Guard {\n return async (ctx, next) => {\n const t0 = Date.now();\n try {\n sink.log(label, {\n event: \"request\",\n method: ctx.method,\n url: toSafeUrl(ctx.url),\n });\n\n const res = await next(ctx);\n\n sink.log(label, {\n event: \"response\",\n method: ctx.method,\n url: toSafeUrl(ctx.url),\n status: res.status,\n ms: Date.now() - t0,\n });\n\n return res;\n } catch (err) {\n (sink.error ?? sink.log)(label, {\n event: \"error\",\n method: ctx.method,\n url: toSafeUrl(ctx.url),\n ms: Date.now() - t0,\n error: err,\n });\n throw err;\n }\n };\n}\n\n/**\n * Production-friendly logging plugin: adds a guard that logs request/response.\n */\nexport function loggerPlugin(opts: LoggerPluginOptions = {}): HttpPlugin {\n const sink: LoggerSink = opts.sink ?? console;\n const label = opts.label ?? \"http-guardian\";\n\n return {\n name: \"logger\",\n apply(options) {\n options.guards ??= [];\n options.guards.push(createLoggerGuard(sink, label));\n return options;\n },\n };\n}\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HttpPlugin } from '@cedvict/http-guardian';
|
|
2
|
+
|
|
3
|
+
type LoggerSink = {
|
|
4
|
+
log: (...args: any[]) => void;
|
|
5
|
+
warn?: (...args: any[]) => void;
|
|
6
|
+
error?: (...args: any[]) => void;
|
|
7
|
+
};
|
|
8
|
+
type LoggerPluginOptions = {
|
|
9
|
+
/** Where logs are written. Defaults to console. */
|
|
10
|
+
sink?: LoggerSink;
|
|
11
|
+
/** Optional tag/prefix to help identify logs. */
|
|
12
|
+
label?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Production-friendly logging plugin: adds a guard that logs request/response.
|
|
16
|
+
*/
|
|
17
|
+
declare function loggerPlugin(opts?: LoggerPluginOptions): HttpPlugin;
|
|
18
|
+
|
|
19
|
+
export { type LoggerPluginOptions, type LoggerSink, loggerPlugin };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HttpPlugin } from '@cedvict/http-guardian';
|
|
2
|
+
|
|
3
|
+
type LoggerSink = {
|
|
4
|
+
log: (...args: any[]) => void;
|
|
5
|
+
warn?: (...args: any[]) => void;
|
|
6
|
+
error?: (...args: any[]) => void;
|
|
7
|
+
};
|
|
8
|
+
type LoggerPluginOptions = {
|
|
9
|
+
/** Where logs are written. Defaults to console. */
|
|
10
|
+
sink?: LoggerSink;
|
|
11
|
+
/** Optional tag/prefix to help identify logs. */
|
|
12
|
+
label?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Production-friendly logging plugin: adds a guard that logs request/response.
|
|
16
|
+
*/
|
|
17
|
+
declare function loggerPlugin(opts?: LoggerPluginOptions): HttpPlugin;
|
|
18
|
+
|
|
19
|
+
export { type LoggerPluginOptions, type LoggerSink, loggerPlugin };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
function toSafeUrl(u) {
|
|
3
|
+
return typeof u === "string" ? u : String(u);
|
|
4
|
+
}
|
|
5
|
+
function createLoggerGuard(sink, label) {
|
|
6
|
+
return async (ctx, next) => {
|
|
7
|
+
const t0 = Date.now();
|
|
8
|
+
try {
|
|
9
|
+
sink.log(label, {
|
|
10
|
+
event: "request",
|
|
11
|
+
method: ctx.method,
|
|
12
|
+
url: toSafeUrl(ctx.url)
|
|
13
|
+
});
|
|
14
|
+
const res = await next(ctx);
|
|
15
|
+
sink.log(label, {
|
|
16
|
+
event: "response",
|
|
17
|
+
method: ctx.method,
|
|
18
|
+
url: toSafeUrl(ctx.url),
|
|
19
|
+
status: res.status,
|
|
20
|
+
ms: Date.now() - t0
|
|
21
|
+
});
|
|
22
|
+
return res;
|
|
23
|
+
} catch (err) {
|
|
24
|
+
(sink.error ?? sink.log)(label, {
|
|
25
|
+
event: "error",
|
|
26
|
+
method: ctx.method,
|
|
27
|
+
url: toSafeUrl(ctx.url),
|
|
28
|
+
ms: Date.now() - t0,
|
|
29
|
+
error: err
|
|
30
|
+
});
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function loggerPlugin(opts = {}) {
|
|
36
|
+
const sink = opts.sink ?? console;
|
|
37
|
+
const label = opts.label ?? "http-guardian";
|
|
38
|
+
return {
|
|
39
|
+
name: "logger",
|
|
40
|
+
apply(options) {
|
|
41
|
+
options.guards ??= [];
|
|
42
|
+
options.guards.push(createLoggerGuard(sink, label));
|
|
43
|
+
return options;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { loggerPlugin };
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAeA,SAAS,UAAU,CAAA,EAAyB;AAG1C,EAAA,OAAO,OAAO,CAAA,KAAM,QAAA,GAAW,CAAA,GAAI,OAAO,CAAC,CAAA;AAC7C;AAEA,SAAS,iBAAA,CAAkB,MAAkB,KAAA,EAAsB;AACjE,EAAA,OAAO,OAAO,KAAK,IAAA,KAAS;AAC1B,IAAA,MAAM,EAAA,GAAK,KAAK,GAAA,EAAI;AACpB,IAAA,IAAI;AACF,MAAA,IAAA,CAAK,IAAI,KAAA,EAAO;AAAA,QACd,KAAA,EAAO,SAAA;AAAA,QACP,QAAQ,GAAA,CAAI,MAAA;AAAA,QACZ,GAAA,EAAK,SAAA,CAAU,GAAA,CAAI,GAAG;AAAA,OACvB,CAAA;AAED,MAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,GAAG,CAAA;AAE1B,MAAA,IAAA,CAAK,IAAI,KAAA,EAAO;AAAA,QACd,KAAA,EAAO,UAAA;AAAA,QACP,QAAQ,GAAA,CAAI,MAAA;AAAA,QACZ,GAAA,EAAK,SAAA,CAAU,GAAA,CAAI,GAAG,CAAA;AAAA,QACtB,QAAQ,GAAA,CAAI,MAAA;AAAA,QACZ,EAAA,EAAI,IAAA,CAAK,GAAA,EAAI,GAAI;AAAA,OAClB,CAAA;AAED,MAAA,OAAO,GAAA;AAAA,IACT,SAAS,GAAA,EAAK;AACZ,MAAA,CAAC,IAAA,CAAK,KAAA,IAAS,IAAA,CAAK,GAAA,EAAK,KAAA,EAAO;AAAA,QAC9B,KAAA,EAAO,OAAA;AAAA,QACP,QAAQ,GAAA,CAAI,MAAA;AAAA,QACZ,GAAA,EAAK,SAAA,CAAU,GAAA,CAAI,GAAG,CAAA;AAAA,QACtB,EAAA,EAAI,IAAA,CAAK,GAAA,EAAI,GAAI,EAAA;AAAA,QACjB,KAAA,EAAO;AAAA,OACR,CAAA;AACD,MAAA,MAAM,GAAA;AAAA,IACR;AAAA,EACF,CAAA;AACF;AAKO,SAAS,YAAA,CAAa,IAAA,GAA4B,EAAC,EAAe;AACvE,EAAA,MAAM,IAAA,GAAmB,KAAK,IAAA,IAAQ,OAAA;AACtC,EAAA,MAAM,KAAA,GAAQ,KAAK,KAAA,IAAS,eAAA;AAE5B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,QAAA;AAAA,IACN,MAAM,OAAA,EAAS;AACb,MAAA,OAAA,CAAQ,WAAW,EAAC;AACpB,MAAA,OAAA,CAAQ,MAAA,CAAO,IAAA,CAAK,iBAAA,CAAkB,IAAA,EAAM,KAAK,CAAC,CAAA;AAClD,MAAA,OAAO,OAAA;AAAA,IACT;AAAA,GACF;AACF","file":"index.js","sourcesContent":["import type { Guard, HttpPlugin } from \"@cedvict/http-guardian\";\n\nexport type LoggerSink = {\n log: (...args: any[]) => void;\n warn?: (...args: any[]) => void;\n error?: (...args: any[]) => void;\n};\n\nexport type LoggerPluginOptions = {\n /** Where logs are written. Defaults to console. */\n sink?: LoggerSink;\n /** Optional tag/prefix to help identify logs. */\n label?: string;\n};\n\nfunction toSafeUrl(u: string | URL): string {\n // In http-guardian's internal context, `url` may be a string (already resolved)\n // or a URL instance depending on the runtime/fetch implementation.\n return typeof u === \"string\" ? u : String(u);\n}\n\nfunction createLoggerGuard(sink: LoggerSink, label: string): Guard {\n return async (ctx, next) => {\n const t0 = Date.now();\n try {\n sink.log(label, {\n event: \"request\",\n method: ctx.method,\n url: toSafeUrl(ctx.url),\n });\n\n const res = await next(ctx);\n\n sink.log(label, {\n event: \"response\",\n method: ctx.method,\n url: toSafeUrl(ctx.url),\n status: res.status,\n ms: Date.now() - t0,\n });\n\n return res;\n } catch (err) {\n (sink.error ?? sink.log)(label, {\n event: \"error\",\n method: ctx.method,\n url: toSafeUrl(ctx.url),\n ms: Date.now() - t0,\n error: err,\n });\n throw err;\n }\n };\n}\n\n/**\n * Production-friendly logging plugin: adds a guard that logs request/response.\n */\nexport function loggerPlugin(opts: LoggerPluginOptions = {}): HttpPlugin {\n const sink: LoggerSink = opts.sink ?? console;\n const label = opts.label ?? \"http-guardian\";\n\n return {\n name: \"logger\",\n apply(options) {\n options.guards ??= [];\n options.guards.push(createLoggerGuard(sink, label));\n return options;\n },\n };\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cedvict/http-guardian-plugin-logger",
|
|
3
|
+
"version": "0.0.1-next.10",
|
|
4
|
+
"description": "Logger plugin for http-guardian.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"browser": "./dist/index.js",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.cjs",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"main": "./dist/index.cjs",
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"CHANGELOG.md"
|
|
23
|
+
],
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=22"
|
|
27
|
+
},
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/cedvict/http-guardian.git"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@cedvict/http-guardian": "^0.0.1-next.6"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsup",
|
|
38
|
+
"dev": "tsup --watch",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"lint": "eslint . --max-warnings=0",
|
|
41
|
+
"typecheck": "tsc -p tsconfig.typecheck.json --noEmit",
|
|
42
|
+
"prepublishOnly": "npm -w @cedvict/http-guardian run build && npm run test && npm run lint && npm run typecheck && npm run build",
|
|
43
|
+
"prebuild": "npm -w @cedvict/http-guardian run build",
|
|
44
|
+
"pretypecheck": "npm -w @cedvict/http-guardian run build"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "^20.0.0",
|
|
48
|
+
"eslint": "^9.0.0",
|
|
49
|
+
"typescript": "^5.4.0",
|
|
50
|
+
"tsup": "^8.0.0",
|
|
51
|
+
"vitest": "^1.5.0",
|
|
52
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@cedvict/http-guardian": "^0.0.1-next.10"
|
|
57
|
+
}
|
|
58
|
+
}
|