@holz/json-backend 0.8.3-rc.154 → 0.8.3-rc.155
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.
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { LogProcessor } from '@holz/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { LogProcessor } from '@holz/core';
|
|
2
|
+
|
|
3
|
+
declare interface Config {
|
|
4
|
+
/** Where to print logs. Each log is written as a line of UTF-8 NDJSON. */
|
|
5
|
+
stream: WritableStream<Uint8Array>;
|
|
6
|
+
/**
|
|
7
|
+
* Closes the stream on abort, flushing queued writes and committing
|
|
8
|
+
* OPFS-style sinks. Fire-and-forget: to await the flush, observe your own
|
|
9
|
+
* sink or resource completion. Logs are dropped once shutdown begins.
|
|
10
|
+
*/
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Prints structured logs to a writable stream in NDJSON form. Optimized for
|
|
16
|
+
* log files.
|
|
17
|
+
*
|
|
18
|
+
* Writes to a Web Streams `WritableStream<Uint8Array>` so the same backend
|
|
19
|
+
* runs across Node, Deno, Bun, and the browser (e.g. OPFS). See the readme
|
|
20
|
+
* for a Node file-stream example.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* createJsonBackend({
|
|
24
|
+
* stream: new WritableStream({
|
|
25
|
+
* write: (chunk) => void process.stdout.write(chunk),
|
|
26
|
+
* }),
|
|
27
|
+
* })
|
|
28
|
+
*
|
|
29
|
+
* @see https://github.com/ndjson/ndjson-spec
|
|
30
|
+
*/
|
|
31
|
+
export declare const createJsonBackend: ({ stream, signal }: Config) => LogProcessor;
|
|
32
|
+
|
|
33
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holz/json-backend",
|
|
3
|
-
"version": "0.8.3-rc.
|
|
3
|
+
"version": "0.8.3-rc.155+ca9302f",
|
|
4
4
|
"description": "Print logs as newline-delimited JSON.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"test:types": "tsc"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@holz/core": "^0.8.3-rc.
|
|
39
|
+
"@holz/core": "^0.8.3-rc.155+ca9302f",
|
|
40
|
+
"@microsoft/api-extractor": "^7.58.8",
|
|
40
41
|
"@types/node": "^24.0.0",
|
|
41
42
|
"@vitest/coverage-v8": "^4.0.0",
|
|
42
43
|
"typescript": "^6.0.0",
|
|
@@ -45,5 +46,5 @@
|
|
|
45
46
|
"vite-tsconfig-paths": "^6.0.0",
|
|
46
47
|
"vitest": "^4.0.0"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "ca9302f8b1709bb57058eb0dc73af0ed2021ddfd"
|
|
49
50
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createJsonBackend } from './json-backend';
|