@gravito/constellation 3.0.1 → 3.0.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DiskSitemapStorage
3
- } from "./chunk-7WHLC3OJ.js";
3
+ } from "./chunk-IS2H7U6M.js";
4
4
  export {
5
5
  DiskSitemapStorage
6
6
  };
@@ -1,4 +1,5 @@
1
1
  // src/storage/DiskSitemapStorage.ts
2
+ import { createReadStream } from "fs";
2
3
  import fs from "fs/promises";
3
4
  import path from "path";
4
5
  function sanitizeFilename(filename) {
@@ -34,6 +35,17 @@ var DiskSitemapStorage = class {
34
35
  return null;
35
36
  }
36
37
  }
38
+ async readStream(filename) {
39
+ try {
40
+ const safeName = sanitizeFilename(filename);
41
+ const fullPath = path.join(this.outDir, safeName);
42
+ await fs.access(fullPath);
43
+ const stream = createReadStream(fullPath, { encoding: "utf-8" });
44
+ return stream;
45
+ } catch {
46
+ return null;
47
+ }
48
+ }
37
49
  async exists(filename) {
38
50
  try {
39
51
  const safeName = sanitizeFilename(filename);