@lmzhen/dsh-evolution-io-node 0.1.0-rc.21 → 0.1.0-rc.22

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.
Files changed (2) hide show
  1. package/lib/index.js +8 -1
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { cp, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
1
+ import { cp, mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
2
2
  import { dirname } from "node:path";
3
3
  import { randomBytes } from "node:crypto";
4
4
  //#region lib/types/index.js
@@ -55,6 +55,13 @@ function apply(ctx) {
55
55
  recursive: true,
56
56
  force: true
57
57
  });
58
+ },
59
+ async size(path) {
60
+ try {
61
+ return (await stat(path)).size;
62
+ } catch {
63
+ return null;
64
+ }
58
65
  }
59
66
  };
60
67
  ctx.effect(() => ctx.evolutionIo.registerProvider(provider), "evolution-io-node.provider");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-io-node",
3
3
  "description": "Local atomic node:fs IO provider (community build)",
4
- "version": "0.1.0-rc.21",
4
+ "version": "0.1.0-rc.22",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,10 +37,10 @@
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.21"
40
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.22"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
44
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.21"
44
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.22"
45
45
  }
46
46
  }