@zgeoff/std 0.3.1 → 0.3.2

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/README.md CHANGED
@@ -75,6 +75,17 @@ import { readOptionalText } from '@zgeoff/std';
75
75
  const lefthook = await readOptionalText('lefthook.yml');
76
76
  ```
77
77
 
78
+ ### `writeStdout`
79
+
80
+ Writes a text to stdout as it is, with no newline added. Pass it as the `writeOutput` of a command's
81
+ options at its entry point, so a test hands in its own writer.
82
+
83
+ ```ts
84
+ import { writeStdout } from '@zgeoff/std';
85
+
86
+ process.exitCode = runCheck({ cwd: process.cwd(), writeOutput: writeStdout });
87
+ ```
88
+
78
89
  ## Typed helpers
79
90
 
80
91
  Each typed helper holds the one type assertion that its job needs, because TypeScript cannot prove
package/dist/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export { readOptionalText } from './read-optional-text.ts';
7
7
  export { type ExactOptional, toExactOptional } from './to-exact-optional.ts';
8
8
  export { type ReadonlyDeep, toReadonlyDeep } from './to-readonly-deep.ts';
9
9
  export { toTagged } from './to-tagged.ts';
10
+ export { writeStdout } from './write-stdout.ts';
@@ -0,0 +1 @@
1
+ export declare function writeStdout(text: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgeoff/std",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Small, dependency-free TypeScript helpers shared across the zgeoff repos",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "typecheck": "tsrs"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/bun": "1.4.3",
31
+ "@types/bun": "1.4.4",
32
32
  "tsrs": "0.18.0-ts7.1.0-dev.20260929",
33
33
  "type-fest": "5.10.0",
34
34
  "typescript": "7.0.2",
package/src/index.ts CHANGED
@@ -7,3 +7,4 @@ export { readOptionalText } from './read-optional-text.ts';
7
7
  export { type ExactOptional, toExactOptional } from './to-exact-optional.ts';
8
8
  export { type ReadonlyDeep, toReadonlyDeep } from './to-readonly-deep.ts';
9
9
  export { toTagged } from './to-tagged.ts';
10
+ export { writeStdout } from './write-stdout.ts';
@@ -0,0 +1,4 @@
1
+ // The writeOutput a command's entry point hands its options: each text goes to stdout as it is.
2
+ export function writeStdout(text: string): void {
3
+ process.stdout.write(text);
4
+ }