@logtape/logtape 0.6.0-dev.82 → 0.6.0-dev.84
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/esm/fs.cjs +16 -0
- package/esm/fs.js +1 -19
- package/package.json +1 -1
package/esm/fs.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let fs = null;
|
|
2
|
+
if (
|
|
3
|
+
"process" in globalThis && "versions" in globalThis.process &&
|
|
4
|
+
"node" in globalThis.process.versions &&
|
|
5
|
+
typeof globalThis.caches === "undefined" &&
|
|
6
|
+
typeof globalThis.addEventListener !== "function" ||
|
|
7
|
+
"Bun" in globalThis
|
|
8
|
+
) {
|
|
9
|
+
try {
|
|
10
|
+
fs = require("node" + ":fs");
|
|
11
|
+
} catch (_) {
|
|
12
|
+
fs = null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = fs;
|
package/esm/fs.js
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
if (
|
|
3
|
-
"process" in globalThis && "versions" in globalThis.process &&
|
|
4
|
-
"node" in globalThis.process.versions &&
|
|
5
|
-
typeof globalThis.caches === "undefined" &&
|
|
6
|
-
typeof globalThis.addEventListener !== "function" ||
|
|
7
|
-
"Bun" in globalThis
|
|
8
|
-
) {
|
|
9
|
-
try {
|
|
10
|
-
fs = await import("node" + ":fs");
|
|
11
|
-
} catch (e) {
|
|
12
|
-
if (e instanceof TypeError) {
|
|
13
|
-
fs = null;
|
|
14
|
-
} else {
|
|
15
|
-
throw e;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
1
|
+
import fs from "./fs.cjs";
|
|
20
2
|
export default fs;
|