@visulima/fs 5.0.0-alpha.2 → 5.0.0-alpha.20

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 (223) hide show
  1. package/CHANGELOG.md +256 -0
  2. package/LICENSE.md +208 -131
  3. package/dist/eol.d.ts +31 -30
  4. package/dist/eol.js +3 -26
  5. package/dist/error.d.ts +273 -7
  6. package/dist/error.js +1 -7
  7. package/dist/glob-parent.d.ts +35 -0
  8. package/dist/glob-parent.js +1 -0
  9. package/dist/glob.d.ts +4 -0
  10. package/dist/glob.js +1 -0
  11. package/dist/index.d.ts +858 -36
  12. package/dist/index.js +1 -33
  13. package/dist/ini.d.ts +70 -0
  14. package/dist/ini.js +1 -0
  15. package/dist/is-glob.d.ts +34 -0
  16. package/dist/is-glob.js +1 -0
  17. package/dist/json5.d.ts +36 -0
  18. package/dist/json5.js +1 -0
  19. package/dist/jsonc.d.ts +65 -0
  20. package/dist/jsonc.js +1 -0
  21. package/dist/match.d.ts +46 -0
  22. package/dist/match.js +1 -0
  23. package/dist/packem_shared/AlreadyExistsError-CEu6_Tjb.js +1 -0
  24. package/dist/packem_shared/DirectoryError-ddlbUV8C.js +1 -0
  25. package/dist/packem_shared/F_OK-CAwY1qU7.js +1 -0
  26. package/dist/packem_shared/JSONError-D7h6PNWc.js +4 -0
  27. package/dist/packem_shared/NotEmptyError-DMh1o7UL.js +1 -0
  28. package/dist/packem_shared/NotFoundError-BPiW0icm.js +1 -0
  29. package/dist/packem_shared/PermissionError-B1Emi5a9.js +1 -0
  30. package/dist/packem_shared/WalkError-Olmh4908.js +1 -0
  31. package/dist/packem_shared/_commonjsHelpers-D6W6KoPK.js +1 -0
  32. package/dist/packem_shared/assertValidFileContents-BZFnXa7K.js +1 -0
  33. package/dist/packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.js +1 -0
  34. package/dist/packem_shared/build-rm-options-C1R4reBu.js +1 -0
  35. package/dist/packem_shared/collect-2KPTpCdX.js +1 -0
  36. package/dist/packem_shared/collectSync-BX55r_BH.js +1 -0
  37. package/dist/packem_shared/emptyDir-8utO028L.js +1 -0
  38. package/dist/packem_shared/emptyDirSync-Bk5fUX73.js +1 -0
  39. package/dist/packem_shared/ensureDir-CZ4oUFuo.js +1 -0
  40. package/dist/packem_shared/ensureDirSync-CoPWhbjM.js +1 -0
  41. package/dist/packem_shared/ensureFile-CF1cAAyh.js +1 -0
  42. package/dist/packem_shared/ensureFileSync-C3qR6naU.js +1 -0
  43. package/dist/packem_shared/ensureLink-LLLxlGHn.js +1 -0
  44. package/dist/packem_shared/ensureLinkSync-Dh_GtT8F.js +1 -0
  45. package/dist/packem_shared/ensureSymlink-D50kj2zl.js +1 -0
  46. package/dist/packem_shared/ensureSymlinkSync-BbVDPvI4.js +1 -0
  47. package/dist/packem_shared/findUp-BT07y_Me.js +1 -0
  48. package/dist/packem_shared/findUpSync-BvZiYsKJ.js +1 -0
  49. package/dist/packem_shared/get-file-info-type-CaWGXRjY.js +1 -0
  50. package/dist/packem_shared/glob-MHJQjR39.js +1 -0
  51. package/dist/packem_shared/glob-sync.d-D1IzfyFn.d.ts +54 -0
  52. package/dist/packem_shared/globSync-CwzlELgS.js +1 -0
  53. package/dist/packem_shared/index-CYIVJA0W.js +1 -0
  54. package/dist/packem_shared/index-DrapuBsB.js +1 -0
  55. package/dist/packem_shared/index-K-NNTkpb.js +11 -0
  56. package/dist/packem_shared/index-yGx8uzZs.js +1 -0
  57. package/dist/packem_shared/indexToLineColumn-BRSZFC6I-BKj3uzZt.js +6 -0
  58. package/dist/packem_shared/ini-preserve-CXc_xkpG.js +4 -0
  59. package/dist/packem_shared/is-stats-identical-CohsLtWy.js +1 -0
  60. package/dist/packem_shared/isAccessible-CDFxsAAo.js +1 -0
  61. package/dist/packem_shared/isAccessibleSync-5nzZWgin.js +1 -0
  62. package/dist/packem_shared/isFsCaseSensitive-CMZVY1A2.js +1 -0
  63. package/dist/packem_shared/json-error.d-DVILOyHc.d.ts +52 -0
  64. package/dist/packem_shared/jsonc-merge-CQMjx3Vw.js +2 -0
  65. package/dist/packem_shared/move-LmP6P9sn.js +1 -0
  66. package/dist/packem_shared/parseJson-Xx6vHYbv.js +1 -0
  67. package/dist/packem_shared/readFile-BAVMZg5e.js +1 -0
  68. package/dist/packem_shared/readFileSync-CGmzMUF2.js +1 -0
  69. package/dist/packem_shared/readIni-Cfl6HmTS.js +1 -0
  70. package/dist/packem_shared/readIniSync-DPg4UD0P.js +1 -0
  71. package/dist/packem_shared/readJson-kPx68Wv1.js +1 -0
  72. package/dist/packem_shared/readJson5-pXTL9nUE.js +1 -0
  73. package/dist/packem_shared/readJson5Sync-BedQc292.js +1 -0
  74. package/dist/packem_shared/readJsonSync-_HXNI3Se.js +1 -0
  75. package/dist/packem_shared/readJsonc-BzvuAXbT.js +1 -0
  76. package/dist/packem_shared/readJsoncSync-CVG1_QnX.js +1 -0
  77. package/dist/packem_shared/readToml-BO5CZK2P.js +1 -0
  78. package/dist/packem_shared/readTomlSync-1fKo0R52.js +1 -0
  79. package/dist/packem_shared/readYaml-DjK_Vqj1.js +1 -0
  80. package/dist/packem_shared/readYamlSync-C3h6KA2c.js +1 -0
  81. package/dist/packem_shared/remove-DH41Ov_c.js +1 -0
  82. package/dist/packem_shared/removeSync-50OEdnHd.js +1 -0
  83. package/dist/packem_shared/resolve-symlink-target-BofZSDIc.js +1 -0
  84. package/dist/packem_shared/sanitize-CU1xmyrg.js +1 -0
  85. package/dist/packem_shared/stripJsonComments-CzNR77MF.js +1 -0
  86. package/dist/packem_shared/to-uint-8-array-DwgaTasY.js +1 -0
  87. package/dist/packem_shared/types.d-BB9TGb5v.d.ts +1660 -0
  88. package/dist/packem_shared/walk-D01Qmmvz.js +1 -0
  89. package/dist/packem_shared/walk-include-DCiVAwMP.js +1 -0
  90. package/dist/packem_shared/walkSync-BknSdmKD.js +1 -0
  91. package/dist/packem_shared/writeFile-DNGaDOMX.js +1 -0
  92. package/dist/packem_shared/writeFileSync-CE1i-eMA.js +1 -0
  93. package/dist/packem_shared/writeIni-DG7U4ji0.js +4 -0
  94. package/dist/packem_shared/writeIniSync-Ldt6HFLb.js +4 -0
  95. package/dist/packem_shared/writeJson-BkGlq1Kv.js +4 -0
  96. package/dist/packem_shared/writeJson5-Btud4sQh.js +4 -0
  97. package/dist/packem_shared/writeJson5Sync-Iln3i1IV.js +4 -0
  98. package/dist/packem_shared/writeJsonSync-HndmyvEK.js +4 -0
  99. package/dist/packem_shared/writeJsonc-9oiamG16.js +4 -0
  100. package/dist/packem_shared/writeJsoncSync-BHBziPiK.js +4 -0
  101. package/dist/packem_shared/writeToml-Cj57wZ8B.js +1 -0
  102. package/dist/packem_shared/writeTomlSync-B34ZZp0e.js +1 -0
  103. package/dist/packem_shared/writeYaml-BhQX2yN9.js +1 -0
  104. package/dist/packem_shared/writeYamlSync-DG01FBeC.js +1 -0
  105. package/dist/size.d.ts +246 -246
  106. package/dist/size.js +1 -144
  107. package/dist/toml.d.ts +63 -0
  108. package/dist/toml.js +1 -0
  109. package/dist/utils.d.ts +103 -6
  110. package/dist/utils.js +1 -6
  111. package/dist/yaml.d.ts +13 -5
  112. package/dist/yaml.js +1 -4
  113. package/package.json +89 -36
  114. package/dist/constants.d.ts +0 -42
  115. package/dist/ensure/ensure-dir-sync.d.ts +0 -14
  116. package/dist/ensure/ensure-dir.d.ts +0 -14
  117. package/dist/ensure/ensure-file-sync.d.ts +0 -15
  118. package/dist/ensure/ensure-file.d.ts +0 -27
  119. package/dist/ensure/ensure-link-sync.d.ts +0 -16
  120. package/dist/ensure/ensure-link.d.ts +0 -16
  121. package/dist/ensure/ensure-symlink-sync.d.ts +0 -23
  122. package/dist/ensure/ensure-symlink.d.ts +0 -23
  123. package/dist/ensure/utils/get-file-info-type.d.ts +0 -7
  124. package/dist/ensure/utils/is-stats-identical.d.ts +0 -3
  125. package/dist/ensure/utils/resolve-symlink-target.d.ts +0 -2
  126. package/dist/error/already-exists-error.d.ts +0 -39
  127. package/dist/error/directory-error.d.ts +0 -47
  128. package/dist/error/json-error.d.ts +0 -52
  129. package/dist/error/not-empty-error.d.ts +0 -51
  130. package/dist/error/not-found-error.d.ts +0 -44
  131. package/dist/error/permission-error.d.ts +0 -45
  132. package/dist/error/walk-error.d.ts +0 -51
  133. package/dist/find/collect-sync.d.ts +0 -31
  134. package/dist/find/collect.d.ts +0 -35
  135. package/dist/find/find-up-sync.d.ts +0 -42
  136. package/dist/find/find-up.d.ts +0 -46
  137. package/dist/find/utils/glob-to-regexp.d.ts +0 -2
  138. package/dist/find/utils/walk-include.d.ts +0 -2
  139. package/dist/find/walk-sync.d.ts +0 -34
  140. package/dist/find/walk.d.ts +0 -37
  141. package/dist/is-accessible-sync.d.ts +0 -3
  142. package/dist/is-accessible.d.ts +0 -29
  143. package/dist/move/index.d.ts +0 -68
  144. package/dist/move/types.d.ts +0 -36
  145. package/dist/move/utils/internal-move-file-sync.d.ts +0 -3
  146. package/dist/move/utils/internal-move-file.d.ts +0 -3
  147. package/dist/move/utils/validate-same-directory.d.ts +0 -2
  148. package/dist/packem_shared/AlreadyExistsError-6Y9hjgMn.js +0 -27
  149. package/dist/packem_shared/DirectoryError-BfYPkIYP.js +0 -27
  150. package/dist/packem_shared/F_OK-MldBaGxb.js +0 -8
  151. package/dist/packem_shared/JSONError-BkHRnInH.js +0 -26
  152. package/dist/packem_shared/NotEmptyError-B21RUlVr.js +0 -27
  153. package/dist/packem_shared/NotFoundError-BIp61X6k.js +0 -27
  154. package/dist/packem_shared/PermissionError-CjoiJgip.js +0 -27
  155. package/dist/packem_shared/WalkError-DUdQd6FT.js +0 -24
  156. package/dist/packem_shared/assertValidFileContents-BmcLtsGd.js +0 -7
  157. package/dist/packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js +0 -7
  158. package/dist/packem_shared/collect-DcBwsYYd.js +0 -14
  159. package/dist/packem_shared/collectSync-Bkjf9Dbm.js +0 -14
  160. package/dist/packem_shared/emptyDir-CYB5Tict.js +0 -43
  161. package/dist/packem_shared/emptyDirSync-BD8-1Ytl.js +0 -41
  162. package/dist/packem_shared/ensureDir-C_kuQ5Ik.js +0 -53
  163. package/dist/packem_shared/ensureDirSync-CI5g-uBI.js +0 -53
  164. package/dist/packem_shared/ensureFile-BUtXGlGT.js +0 -47
  165. package/dist/packem_shared/ensureFileSync-C8hASR-1.js +0 -47
  166. package/dist/packem_shared/ensureLink-BPnAG5-P.js +0 -54
  167. package/dist/packem_shared/ensureLinkSync-B-Z7X0ub.js +0 -54
  168. package/dist/packem_shared/ensureSymlink-U5B6J0BN.js +0 -73
  169. package/dist/packem_shared/ensureSymlinkSync-DHnZj-9F.js +0 -74
  170. package/dist/packem_shared/findUp-BSnyGqer.js +0 -85
  171. package/dist/packem_shared/findUpSync-jRHbSCMV.js +0 -85
  172. package/dist/packem_shared/get-file-info-type-FD4-jsyg.js +0 -14
  173. package/dist/packem_shared/index-CHM-in-V.js +0 -100
  174. package/dist/packem_shared/is-stats-identical-D8FxpvQU.js +0 -3
  175. package/dist/packem_shared/isAccessible-DuVrTNFV.js +0 -38
  176. package/dist/packem_shared/isAccessibleSync-DI8mM0fA.js +0 -38
  177. package/dist/packem_shared/isFsCaseSensitive-D-ayleCy.js +0 -62
  178. package/dist/packem_shared/move-DbpW5_vA.js +0 -134
  179. package/dist/packem_shared/parseJson-C8xb-3LR.js +0 -231
  180. package/dist/packem_shared/readFile-Iz7kvCCk.js +0 -65
  181. package/dist/packem_shared/readFileSync-6GEIrOnl.js +0 -53
  182. package/dist/packem_shared/readJson-vddQ97Ll.js +0 -22
  183. package/dist/packem_shared/readJsonSync-DzeAdYZl.js +0 -22
  184. package/dist/packem_shared/readYaml-D5q2a0e1.js +0 -10
  185. package/dist/packem_shared/readYamlSync-DMV4U-gi.js +0 -10
  186. package/dist/packem_shared/remove-_oDY3uKo.js +0 -38
  187. package/dist/packem_shared/removeSync-DETRj7Qn.js +0 -38
  188. package/dist/packem_shared/resolve-symlink-target-Kh4GovFf.js +0 -16
  189. package/dist/packem_shared/sanitize-lOzE6k2A.js +0 -205
  190. package/dist/packem_shared/stripJsonComments-vo4k0mpF.js +0 -19
  191. package/dist/packem_shared/to-uint-8-array-Dz2nF1y1.js +0 -19
  192. package/dist/packem_shared/walk-BhTbpr3y.js +0 -115
  193. package/dist/packem_shared/walk-include-CZco7BvN.js +0 -16
  194. package/dist/packem_shared/walkSync-DDBq95s8.js +0 -114
  195. package/dist/packem_shared/writeFile-DSHERs0Z.js +0 -83
  196. package/dist/packem_shared/writeFileSync-CJp1kXQR.js +0 -83
  197. package/dist/packem_shared/writeJson-C0OfLDbe.js +0 -50
  198. package/dist/packem_shared/writeJsonSync-Cs21FE7v.js +0 -50
  199. package/dist/packem_shared/writeYaml-n4xzYN9a.js +0 -24
  200. package/dist/packem_shared/writeYamlSync-DnOEnP10.js +0 -24
  201. package/dist/read/read-file-sync.d.ts +0 -37
  202. package/dist/read/read-file.d.ts +0 -41
  203. package/dist/read/read-json-sync.d.ts +0 -5
  204. package/dist/read/read-json.d.ts +0 -5
  205. package/dist/read/read-yaml-sync.d.ts +0 -4
  206. package/dist/read/read-yaml.d.ts +0 -4
  207. package/dist/remove/empty-dir-sync.d.ts +0 -23
  208. package/dist/remove/empty-dir.d.ts +0 -28
  209. package/dist/remove/remove-sync.d.ts +0 -27
  210. package/dist/remove/remove.d.ts +0 -32
  211. package/dist/sanitize.d.ts +0 -31
  212. package/dist/types.d.ts +0 -304
  213. package/dist/utils/assert-valid-file-contents.d.ts +0 -27
  214. package/dist/utils/assert-valid-file-or-directory-path.d.ts +0 -26
  215. package/dist/utils/parse-json.d.ts +0 -5
  216. package/dist/utils/strip-json-comments.d.ts +0 -44
  217. package/dist/write/utils/to-uint-8-array.d.ts +0 -2
  218. package/dist/write/write-file-sync.d.ts +0 -30
  219. package/dist/write/write-file.d.ts +0 -30
  220. package/dist/write/write-json-sync.d.ts +0 -29
  221. package/dist/write/write-json.d.ts +0 -30
  222. package/dist/write/write-yaml-sync.d.ts +0 -4
  223. package/dist/write/write-yaml.d.ts +0 -4
package/dist/size.js CHANGED
@@ -1,144 +1 @@
1
- import { createRequire as __cjs_createRequire } from "node:module";
2
-
3
- const __cjs_require = __cjs_createRequire(import.meta.url);
4
-
5
- const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
6
-
7
- const __cjs_getBuiltinModule = (module) => {
8
- // Check if we're in Node.js and version supports getBuiltinModule
9
- if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
10
- const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
11
- // Node.js 20.16.0+ and 22.3.0+
12
- if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
13
- return __cjs_getProcess.getBuiltinModule(module);
14
- }
15
- }
16
- // Fallback to createRequire
17
- return __cjs_require(module);
18
- };
19
-
20
- const {
21
- readFileSync,
22
- statSync,
23
- existsSync
24
- } = __cjs_getBuiltinModule("node:fs");
25
- const {
26
- readFile
27
- } = __cjs_getBuiltinModule("node:fs/promises");
28
- const {
29
- isAbsolute,
30
- resolve
31
- } = __cjs_getBuiltinModule("node:path");
32
- const {
33
- Readable
34
- } = __cjs_getBuiltinModule("node:stream");
35
- const {
36
- URL
37
- } = __cjs_getBuiltinModule("node:url");
38
- const {
39
- gzipSync,
40
- brotliCompressSync,
41
- createBrotliCompress,
42
- createGzip
43
- } = __cjs_getBuiltinModule("node:zlib");
44
- import { toPath } from '@visulima/path/utils';
45
-
46
- const fileExists = (input) => {
47
- if (isAbsolute(input)) {
48
- return existsSync(input);
49
- }
50
- try {
51
- return existsSync(resolve(input));
52
- } catch {
53
- return false;
54
- }
55
- };
56
- const getStreamSizeEfficient = async (stream) => {
57
- let totalSize = 0;
58
- for await (const chunk of stream) {
59
- totalSize += Buffer.from(chunk).length;
60
- }
61
- return totalSize;
62
- };
63
- const getCompressedStreamSizeEfficient = async (stream, createCompressor) => {
64
- let totalSize = 0;
65
- const compressor = createCompressor();
66
- return await new Promise((resolve2, reject) => {
67
- compressor.on("data", (chunk) => {
68
- totalSize += chunk.length;
69
- });
70
- compressor.on("end", () => resolve2(totalSize));
71
- compressor.on("error", reject);
72
- stream.on("error", reject);
73
- stream.pipe(compressor);
74
- });
75
- };
76
- const processInputEfficiently = async (input, processor, streamProcessor) => {
77
- if (input instanceof URL || typeof input === "string") {
78
- const path = toPath(input);
79
- if (fileExists(path)) {
80
- const fileStream = Readable.from(await readFile(path));
81
- return await streamProcessor(fileStream);
82
- }
83
- if (typeof input === "string") {
84
- return processor(Buffer.from(input));
85
- }
86
- }
87
- if (input instanceof Readable) {
88
- return await streamProcessor(input);
89
- }
90
- return processor(input);
91
- };
92
- const gzipSize = async (input, options) => {
93
- const streamProcessor = async (stream) => await getCompressedStreamSizeEfficient(stream, () => createGzip(options));
94
- const bufferProcessor = (data) => gzipSync(data, options).length;
95
- return await processInputEfficiently(input, bufferProcessor, streamProcessor);
96
- };
97
- const brotliSize = async (input, options) => {
98
- const streamProcessor = async (stream) => await getCompressedStreamSizeEfficient(stream, () => createBrotliCompress(options));
99
- const bufferProcessor = (data) => brotliCompressSync(data, options).length;
100
- return await processInputEfficiently(input, bufferProcessor, streamProcessor);
101
- };
102
- const rawSize = async (input) => {
103
- const streamProcessor = async (stream) => await getStreamSizeEfficient(stream);
104
- const bufferProcessor = (data) => data.length;
105
- return await processInputEfficiently(input, bufferProcessor, streamProcessor);
106
- };
107
- const gzipSizeSync = (input, options) => {
108
- if (input instanceof URL || typeof input === "string") {
109
- const path = toPath(input);
110
- if (fileExists(path)) {
111
- return gzipSync(readFileSync(path), options).length;
112
- }
113
- if (typeof input === "string") {
114
- return gzipSync(Buffer.from(input), options).length;
115
- }
116
- }
117
- return gzipSync(input, options).length;
118
- };
119
- const brotliSizeSync = (input, options) => {
120
- if (input instanceof URL || typeof input === "string") {
121
- const path = toPath(input);
122
- if (fileExists(path)) {
123
- return brotliCompressSync(readFileSync(path), options).length;
124
- }
125
- if (typeof input === "string") {
126
- return brotliCompressSync(Buffer.from(input), options).length;
127
- }
128
- }
129
- return brotliCompressSync(input, options).length;
130
- };
131
- const rawSizeSync = (input) => {
132
- if (input instanceof URL || typeof input === "string") {
133
- const path = toPath(input);
134
- if (fileExists(path)) {
135
- return statSync(path).size;
136
- }
137
- if (typeof input === "string") {
138
- return Buffer.from(input).length;
139
- }
140
- }
141
- return input.length;
142
- };
143
-
144
- export { brotliSize, brotliSizeSync, gzipSize, gzipSizeSync, rawSize, rawSizeSync };
1
+ var w=Object.defineProperty;var p=(e,t)=>w(e,"name",{value:t,configurable:!0});import{createRequire as _}from"node:module";import{toPath as u}from"@visulima/path/utils";const P=_(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i=p(e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[t,r]=s.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return s.getBuiltinModule(e)}return P(e)},"__cjs_getBuiltinModule"),{readFileSync:d,statSync:B,existsSync:S}=i("node:fs"),{readFile:v}=i("node:fs/promises"),{isAbsolute:j,resolve:E}=i("node:path"),{Readable:z}=i("node:stream"),{URL:c}=i("node:url"),{brotliCompressSync:a,createBrotliCompress:R,gzipSync:f,createGzip:q}=i("node:zlib");var x=Object.defineProperty,n=p((e,t)=>x(e,"name",{value:t,configurable:!0}),"t");const l=n(e=>{if(j(e))return S(e);try{return S(E(e))}catch{return!1}},"fileExists"),C=n(async e=>{let t=0;for await(const r of e)t+=Buffer.from(r).length;return t},"getStreamSizeEfficient"),h=n(async(e,t)=>{let r=0;const o=t();return await new Promise((g,m)=>{o.on("data",b=>{r+=b.length}),o.on("end",()=>{g(r)}),o.on("error",m),e.on("error",m),e.pipe(o)})},"getCompressedStreamSizeEfficient"),y=n(async(e,t,r)=>{if(e instanceof c||typeof e=="string"){const o=u(e);if(l(o)){const g=z.from(await v(o));return await r(g)}if(typeof e=="string")return t(Buffer.from(e))}return e instanceof z?await r(e):t(e)},"processInputEfficiently"),M=n(async(e,t)=>await y(e,n(r=>f(r,t).length,"bufferProcessor"),n(async r=>await h(r,()=>q(t)),"streamProcessor")),"gzipSize"),A=n(async(e,t)=>await y(e,n(r=>a(r,t).length,"bufferProcessor"),n(async r=>await h(r,()=>R(t)),"streamProcessor")),"brotliSize"),G=n(async e=>await y(e,n(t=>t.length,"bufferProcessor"),n(async t=>await C(t),"streamProcessor")),"rawSize"),L=n((e,t)=>{if(e instanceof c||typeof e=="string"){const r=u(e);if(l(r))return f(d(r),t).length;if(typeof e=="string")return f(Buffer.from(e),t).length}return f(e,t).length},"gzipSizeSync"),N=n((e,t)=>{if(e instanceof c||typeof e=="string"){const r=u(e);if(l(r))return a(d(r),t).length;if(typeof e=="string")return a(Buffer.from(e),t).length}return a(e,t).length},"brotliSizeSync"),O=n(e=>{if(e instanceof c||typeof e=="string"){const t=u(e);if(l(t))return B(t).size;if(typeof e=="string")return Buffer.from(e).length}return e.length},"rawSizeSync");export{A as brotliSize,N as brotliSizeSync,M as gzipSize,L as gzipSizeSync,G as rawSize,O as rawSizeSync};
package/dist/toml.d.ts ADDED
@@ -0,0 +1,63 @@
1
+ import { C as CompressionType, b as ReadTomlOptions, c as WriteTomlOptions } from "./packem_shared/types.d-BB9TGb5v.js";
2
+ import 'node:fs';
3
+ import 'tinyglobby';
4
+ /**
5
+ * Asynchronously reads a TOML file and parses it into an object.
6
+ * @template R The expected type of the parsed TOML object. Defaults to `Record&lt;string, unknown>`.
7
+ * @param path The path to the TOML file to read. Can be a file URL or a string path.
8
+ * @param options Optional configuration for reading the file. See {@link ReadTomlOptions}.
9
+ * @returns A promise that resolves with the parsed TOML object of type `R`.
10
+ * @example
11
+ * ```javascript
12
+ * import { readToml } from "@visulima/fs/toml";
13
+ * import { join } from "node:path";
14
+ *
15
+ * const config = await readToml(join("path", "to", "config.toml"));
16
+ * ```
17
+ */
18
+ declare const readToml: <R = Record<string, unknown>>(path: URL | string, options?: ReadTomlOptions<CompressionType>) => Promise<R>;
19
+ /**
20
+ * Synchronously reads a TOML file and parses it into an object.
21
+ * @template R The expected type of the parsed TOML object. Defaults to `Record&lt;string, unknown>`.
22
+ * @param path The path to the TOML file to read. Can be a file URL or a string path.
23
+ * @param options Optional configuration for reading the file. See {@link ReadTomlOptions}.
24
+ * @returns The parsed TOML object of type `R`.
25
+ * @example
26
+ * ```javascript
27
+ * import { readTomlSync } from "@visulima/fs/toml";
28
+ * import { join } from "node:path";
29
+ *
30
+ * const config = readTomlSync(join("path", "to", "config.toml"));
31
+ * ```
32
+ */
33
+ declare const readTomlSync: (path: URL | string, options?: ReadTomlOptions<CompressionType>) => Record<string, unknown>;
34
+ /**
35
+ * Asynchronously writes an object to a TOML file.
36
+ * @param path The path to the TOML file to write. Can be a file URL or a string path.
37
+ * @param data The data to serialize. Must be a plain object compatible with `smol-toml.stringify`.
38
+ * @param options Optional configuration for writing the TOML file. See {@link WriteTomlOptions}.
39
+ * @returns A promise that resolves when the TOML file has been written.
40
+ * @example
41
+ * ```javascript
42
+ * import { writeToml } from "@visulima/fs/toml";
43
+ * import { join } from "node:path";
44
+ *
45
+ * await writeToml(join("/tmp", "config.toml"), { name: "app", version: 1 });
46
+ * ```
47
+ */
48
+ declare const writeToml: (path: URL | string, data: Record<string, unknown>, options?: WriteTomlOptions) => Promise<void>;
49
+ /**
50
+ * Synchronously writes an object to a TOML file.
51
+ * @param path The path to the TOML file to write. Can be a file URL or a string path.
52
+ * @param data The data to serialize. Must be a plain object compatible with `smol-toml.stringify`.
53
+ * @param options Optional configuration for writing the TOML file. See {@link WriteTomlOptions}.
54
+ * @example
55
+ * ```javascript
56
+ * import { writeTomlSync } from "@visulima/fs/toml";
57
+ * import { join } from "node:path";
58
+ *
59
+ * writeTomlSync(join("/tmp", "config.toml"), { name: "app", version: 1 });
60
+ * ```
61
+ */
62
+ declare const writeTomlSync: (path: URL | string, data: Record<string, unknown>, options?: WriteTomlOptions) => void;
63
+ export { type ReadTomlOptions, type WriteTomlOptions, readToml, readTomlSync, writeToml, writeTomlSync };
package/dist/toml.js ADDED
@@ -0,0 +1 @@
1
+ import{default as r}from"./packem_shared/readToml-BO5CZK2P.js";import{default as t}from"./packem_shared/readTomlSync-1fKo0R52.js";import{default as l}from"./packem_shared/writeToml-Cj57wZ8B.js";import{default as d}from"./packem_shared/writeTomlSync-B34ZZp0e.js";export{r as readToml,t as readTomlSync,l as writeToml,d as writeTomlSync};
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,103 @@
1
- export { default as JSONError } from "./error/json-error.d.ts";
2
- export { default as assertValidFileContents } from "./utils/assert-valid-file-contents.d.ts";
3
- export { default as assertValidFileOrDirectoryPath } from "./utils/assert-valid-file-or-directory-path.d.ts";
4
- export { default as parseJson } from "./utils/parse-json.d.ts";
5
- export { default as stripJsonComments } from "./utils/strip-json-comments.d.ts";
6
- export { toPath } from "@visulima/path/utils";
1
+ export { J as JSONError } from "./packem_shared/json-error.d-DVILOyHc.js";
2
+ import { JsonValue } from 'type-fest';
3
+ import { o as CodeFrameOptions, p as JsonReviver } from "./packem_shared/types.d-BB9TGb5v.js";
4
+ export { toPath } from '@visulima/path/utils';
5
+ import 'node:fs';
6
+ import 'tinyglobby';
7
+ /**
8
+ * Asserts that the provided contents are valid for writing to a file.
9
+ * Valid contents can be a string, an ArrayBuffer, or an ArrayBuffer view (e.g., Uint8Array).
10
+ * @param contents The file contents to validate.
11
+ * @throws {TypeError} If the contents are not a string, ArrayBuffer, or ArrayBuffer view.
12
+ * @example
13
+ * ```javascript
14
+ * import { assertValidFileContents } from "@visulima/fs"; // Assuming this util is exported
15
+ *
16
+ * try {
17
+ * assertValidFileContents("Hello, world!");
18
+ * assertValidFileContents(new Uint8Array([72, 101, 108, 108, 111])); // "Hello"
19
+ * assertValidFileContents(new ArrayBuffer(8));
20
+ * console.log("File contents are valid.");
21
+ * } catch (error) {
22
+ * console.error(error.message); // File contents must be a string, ArrayBuffer, or ArrayBuffer view.
23
+ * }
24
+ *
25
+ * try {
26
+ * assertValidFileContents(123); // Invalid content type
27
+ * } catch (error) {
28
+ * console.error(error.message); // File contents must be a string, ArrayBuffer, or ArrayBuffer view.
29
+ * }
30
+ * ```
31
+ */
32
+ declare const assertValidFileContents: (contents: any) => void;
33
+ /**
34
+ * Asserts that the provided path is a valid file or directory path.
35
+ * A valid path must be a non-empty string or a URL instance.
36
+ * @param fileOrDirectoryPath The path to validate.
37
+ * @throws {TypeError} If the path is not a non-empty string or a URL.
38
+ * @example
39
+ * ```javascript
40
+ * import { assertValidFileOrDirectoryPath } from "@visulima/fs"; // Assuming this util is exported
41
+ *
42
+ * try {
43
+ * assertValidFileOrDirectoryPath("/path/to/file.txt");
44
+ * assertValidFileOrDirectoryPath(new URL("file:///path/to/file.txt"));
45
+ * console.log("Path is valid.");
46
+ * } catch (error) {
47
+ * console.error(error.message); // Path must be a non-empty string or URL.
48
+ * }
49
+ *
50
+ * try {
51
+ * assertValidFileOrDirectoryPath(""); // Invalid path
52
+ * } catch (error) {
53
+ * console.error(error.message); // Path must be a non-empty string or URL.
54
+ * }
55
+ * ```
56
+ */
57
+ declare const assertValidFileOrDirectoryPath: (fileOrDirectoryPath: any) => void;
58
+ declare function parseJson(string: string, filename?: string, options?: CodeFrameOptions): JsonValue;
59
+ declare function parseJson(string: string, reviver: JsonReviver, fileName?: string, options?: CodeFrameOptions): JsonValue;
60
+ /**
61
+ * Strips comments from a JSON string.
62
+ * Handles both single-line (//) and multi-line (/* ... *&amp;#47;) comments.
63
+ * @param jsonString The JSON string possibly containing comments.
64
+ * @param [options] Optional configuration for stripping comments.
65
+ * @param [options.whitespace] If `true` (default), comments are replaced with whitespace to preserve line numbers and character positions. If `false`, comments are removed entirely.
66
+ * @returns The JSON string with comments stripped.
67
+ * @example
68
+ * ```javascript
69
+ * import { stripJsonComments } from "@visulima/fs"; // Assuming this util is exported
70
+ *
71
+ * const jsonWithComments = `{
72
+ * // This is a single-line comment
73
+ * "name": "John Doe",
74
+ * "age": 30, /* This is a
75
+ * multi-line comment *&#47;
76
+ * "city": "New York"
77
+ * }`;
78
+ *
79
+ * const stripped = stripJsonComments(jsonWithComments);
80
+ * console.log(stripped);
81
+ * // Output (with whitespace=true):
82
+ * // {
83
+ * //
84
+ * // "name": "John Doe",
85
+ * // "age": 30, /*
86
+ * //
87
+ * // "city": "New York"
88
+ * // }
89
+ *
90
+ * const strippedWithoutWhitespace = stripJsonComments(jsonWithComments, { whitespace: false });
91
+ * console.log(strippedWithoutWhitespace);
92
+ * // Output (with whitespace=false):
93
+ * // {
94
+ * // "name": "John Doe",
95
+ * // "age": 30,
96
+ * // "city": "New York"
97
+ * // }
98
+ * ```
99
+ */
100
+ declare const stripJsonComments: (jsonString: string, options?: {
101
+ whitespace?: boolean;
102
+ }) => string;
103
+ export { assertValidFileContents, assertValidFileOrDirectoryPath, parseJson, stripJsonComments };
package/dist/utils.js CHANGED
@@ -1,6 +1 @@
1
- export { default as JSONError } from './packem_shared/JSONError-BkHRnInH.js';
2
- export { default as assertValidFileContents } from './packem_shared/assertValidFileContents-BmcLtsGd.js';
3
- export { default as assertValidFileOrDirectoryPath } from './packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js';
4
- export { default as parseJson } from './packem_shared/parseJson-C8xb-3LR.js';
5
- export { default as stripJsonComments } from './packem_shared/stripJsonComments-vo4k0mpF.js';
6
- export { toPath } from '@visulima/path/utils';
1
+ import{default as e}from"./packem_shared/JSONError-D7h6PNWc.js";import{default as a}from"./packem_shared/assertValidFileContents-BZFnXa7K.js";import{default as f}from"./packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.js";import{default as m}from"./packem_shared/parseJson-Xx6vHYbv.js";import{default as d}from"./packem_shared/stripJsonComments-CzNR77MF.js";import{toPath as x}from"@visulima/path/utils";export{e as JSONError,a as assertValidFileContents,f as assertValidFileOrDirectoryPath,m as parseJson,d as stripJsonComments,x as toPath};
package/dist/yaml.d.ts CHANGED
@@ -1,5 +1,13 @@
1
- export { default as readYaml } from "./read/read-yaml.d.ts";
2
- export { default as readYamlSync } from "./read/read-yaml-sync.d.ts";
3
- export type { YamlReplacer } from "./types.d.ts";
4
- export { default as writeYaml } from "./write/write-yaml.d.ts";
5
- export { default as writeYamlSync } from "./write/write-yaml-sync.d.ts";
1
+ import { C as CompressionType, R as ReadYamlOptions, Y as YamlReviver, W as WriteYamlOptions, J as JsonReplacer } from "./packem_shared/types.d-BB9TGb5v.js";
2
+ export { type a as YamlReplacer } from "./packem_shared/types.d-BB9TGb5v.js";
3
+ import 'node:fs';
4
+ import 'tinyglobby';
5
+ declare function readYaml<R = Record<string, unknown>>(path: URL | string, options?: ReadYamlOptions<CompressionType>): Promise<R>;
6
+ declare function readYaml<R = Record<string, unknown>>(path: URL | string, reviver?: YamlReviver, options?: ReadYamlOptions<CompressionType>): Promise<R>;
7
+ declare function readYamlSync(path: URL | string, options?: ReadYamlOptions<CompressionType>): Record<string, unknown>;
8
+ declare function readYamlSync(path: URL | string, reviver?: YamlReviver, options?: ReadYamlOptions<CompressionType>): Record<string, unknown>;
9
+ declare function writeYaml(path: URL | string, data: any, options?: WriteYamlOptions): Promise<void>;
10
+ declare function writeYaml(path: URL | string, data: any, replacer?: JsonReplacer, options?: WriteYamlOptions | number | string): Promise<void>;
11
+ declare function writeYamlSync(path: URL | string, data: any, options?: WriteYamlOptions): void;
12
+ declare function writeYamlSync(path: URL | string, data: any, replacer?: JsonReplacer, options?: WriteYamlOptions | number | string): void;
13
+ export { readYaml, readYamlSync, writeYaml, writeYamlSync };
package/dist/yaml.js CHANGED
@@ -1,4 +1 @@
1
- export { default as readYaml } from './packem_shared/readYaml-D5q2a0e1.js';
2
- export { default as readYamlSync } from './packem_shared/readYamlSync-DMV4U-gi.js';
3
- export { default as writeYaml } from './packem_shared/writeYaml-n4xzYN9a.js';
4
- export { default as writeYamlSync } from './packem_shared/writeYamlSync-DnOEnP10.js';
1
+ import{default as r}from"./packem_shared/readYaml-DjK_Vqj1.js";import{default as f}from"./packem_shared/readYamlSync-C3h6KA2c.js";import{default as m}from"./packem_shared/writeYaml-BhQX2yN9.js";import{default as d}from"./packem_shared/writeYamlSync-DG01FBeC.js";export{r as readYaml,f as readYamlSync,m as writeYaml,d as writeYamlSync};
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@visulima/fs",
3
- "version": "5.0.0-alpha.2",
3
+ "version": "5.0.0-alpha.20",
4
4
  "description": "Human friendly file system utilities for Node.js",
5
5
  "keywords": [
6
6
  "anolilab",
7
+ "brotli",
7
8
  "detect-newline",
8
9
  "dir",
9
10
  "directory",
10
- "eol",
11
11
  "empty-dir",
12
12
  "ensure",
13
- "ensure-file",
14
13
  "ensure-dir",
14
+ "ensure-file",
15
15
  "ensure-link",
16
16
  "ensure-symlink",
17
+ "eol",
17
18
  "file",
18
19
  "files",
19
20
  "filesystem",
@@ -23,10 +24,14 @@
23
24
  "folder",
24
25
  "fs",
25
26
  "fs-safe",
27
+ "gzip",
28
+ "ini",
29
+ "json",
30
+ "json5",
31
+ "jsonc",
32
+ "jsonc-parser",
26
33
  "look",
27
34
  "look-up",
28
- "json",
29
- "read-json",
30
35
  "match",
31
36
  "package",
32
37
  "parent",
@@ -34,12 +39,16 @@
34
39
  "path",
35
40
  "read",
36
41
  "read-file",
42
+ "read-json",
37
43
  "read-yaml",
38
44
  "resolve",
39
45
  "safe",
40
46
  "search",
41
- "std",
47
+ "size",
48
+ "smol-toml",
42
49
  "standard",
50
+ "std",
51
+ "toml",
43
52
  "up",
44
53
  "visulima",
45
54
  "walk",
@@ -48,15 +57,17 @@
48
57
  "write-dir",
49
58
  "write-file",
50
59
  "write-safe",
51
- "yaml",
52
- "size",
53
- "brotli",
54
- "gzip"
60
+ "yaml"
55
61
  ],
56
- "homepage": "https://www.visulima.com/docs/package/fs",
62
+ "homepage": "https://visulima.com/packages/fs/",
57
63
  "bugs": {
58
64
  "url": "https://github.com/visulima/visulima/issues"
59
65
  },
66
+ "license": "MIT",
67
+ "author": {
68
+ "name": "Daniel Bannert",
69
+ "email": "d.bannert@anolilab.de"
70
+ },
60
71
  "repository": {
61
72
  "type": "git",
62
73
  "url": "git+https://github.com/visulima/visulima.git",
@@ -72,13 +83,19 @@
72
83
  "url": "https://anolilab.com/support"
73
84
  }
74
85
  ],
75
- "license": "MIT",
76
- "author": {
77
- "name": "Daniel Bannert",
78
- "email": "d.bannert@anolilab.de"
79
- },
80
- "sideEffects": false,
86
+ "files": [
87
+ "dist/**",
88
+ "README.md",
89
+ "CHANGELOG.md",
90
+ "LICENSE.md"
91
+ ],
92
+ "os": [
93
+ "darwin",
94
+ "linux",
95
+ "win32"
96
+ ],
81
97
  "type": "module",
98
+ "sideEffects": false,
82
99
  "exports": {
83
100
  ".": {
84
101
  "types": "./dist/index.d.ts",
@@ -96,6 +113,22 @@
96
113
  "types": "./dist/yaml.d.ts",
97
114
  "default": "./dist/yaml.js"
98
115
  },
116
+ "./toml": {
117
+ "types": "./dist/toml.d.ts",
118
+ "default": "./dist/toml.js"
119
+ },
120
+ "./jsonc": {
121
+ "types": "./dist/jsonc.d.ts",
122
+ "default": "./dist/jsonc.js"
123
+ },
124
+ "./json5": {
125
+ "types": "./dist/json5.d.ts",
126
+ "default": "./dist/json5.js"
127
+ },
128
+ "./ini": {
129
+ "types": "./dist/ini.d.ts",
130
+ "default": "./dist/ini.js"
131
+ },
99
132
  "./size": {
100
133
  "types": "./dist/size.d.ts",
101
134
  "default": "./dist/size.js"
@@ -104,36 +137,56 @@
104
137
  "types": "./dist/eol.d.ts",
105
138
  "default": "./dist/eol.js"
106
139
  },
140
+ "./glob": {
141
+ "types": "./dist/glob.d.ts",
142
+ "default": "./dist/glob.js"
143
+ },
144
+ "./glob-parent": {
145
+ "types": "./dist/glob-parent.d.ts",
146
+ "default": "./dist/glob-parent.js"
147
+ },
148
+ "./is-glob": {
149
+ "types": "./dist/is-glob.d.ts",
150
+ "default": "./dist/is-glob.js"
151
+ },
152
+ "./match": {
153
+ "types": "./dist/match.d.ts",
154
+ "default": "./dist/match.js"
155
+ },
107
156
  "./package.json": "./package.json"
108
157
  },
109
- "files": [
110
- "dist/**",
111
- "README.md",
112
- "CHANGELOG.md",
113
- "LICENSE.md"
114
- ],
158
+ "publishConfig": {
159
+ "access": "public",
160
+ "provenance": true
161
+ },
115
162
  "dependencies": {
116
- "@visulima/path": "3.0.0-alpha.3",
117
- "type-fest": "^5.3.0"
163
+ "@visulima/path": "3.0.0-alpha.10"
118
164
  },
119
165
  "peerDependencies": {
120
- "yaml": "^2.7.1"
166
+ "ini": "^6.0.0",
167
+ "json5": "^2.2.3",
168
+ "jsonc-parser": "^3.3.1",
169
+ "smol-toml": "^1.6.1",
170
+ "yaml": "2.8.4"
121
171
  },
122
172
  "peerDependenciesMeta": {
173
+ "ini": {
174
+ "optional": true
175
+ },
176
+ "json5": {
177
+ "optional": true
178
+ },
179
+ "jsonc-parser": {
180
+ "optional": true
181
+ },
182
+ "smol-toml": {
183
+ "optional": true
184
+ },
123
185
  "yaml": {
124
186
  "optional": true
125
187
  }
126
188
  },
127
189
  "engines": {
128
- "node": ">=22.13 <=25.x"
129
- },
130
- "os": [
131
- "darwin",
132
- "linux",
133
- "win32"
134
- ],
135
- "publishConfig": {
136
- "access": "public",
137
- "provenance": true
190
+ "node": "^22.14.0 || >=24.10.0"
138
191
  }
139
192
  }
@@ -1,42 +0,0 @@
1
- /**
2
- * Constant to check if the path is visible to the calling process.
3
- * Corresponds to `node:fs.constants.F_OK`.
4
- */
5
- export declare const F_OK: number;
6
- /**
7
- * Constant to check if the path is readable to the calling process.
8
- * Corresponds to `node:fs.constants.R_OK`.
9
- */
10
- export declare const R_OK: number;
11
- /**
12
- * Constant to check if the path is writable to the calling process.
13
- * Corresponds to `node:fs.constants.W_OK`.
14
- */
15
- export declare const W_OK: number;
16
- /**
17
- * Constant to check if the path is executable by the calling process.
18
- * Corresponds to `node:fs.constants.X_OK`.
19
- */
20
- export declare const X_OK: number;
21
- /**
22
- * A special symbol that can be returned by the matcher function in `findUp` or `findUpSync`
23
- * to stop the search process prematurely.
24
- */
25
- export declare const FIND_UP_STOP: symbol;
26
- /**
27
- * Regular expression for stripping comments from JSON.
28
- * Matches:
29
- * 1. Quoted strings: "example \"escaped\" string"
30
- * 2. Single-line comments: // comment
31
- * 3. Multi-line comments: /* comment *\/
32
- * @example
33
- * const json = `{
34
- * // comment
35
- * "key": "value" // comment
36
- * }`;
37
- * json.replace(INTERNAL_STRIP_JSON_REGEX, (match) =>
38
- * /^"/.test(match) ? match : ''
39
- * );
40
- * // Result: { "key": "value" }
41
- */
42
- export declare const INTERNAL_STRIP_JSON_REGEX: RegExp;
@@ -1,14 +0,0 @@
1
- /**
2
- * Ensures that the directory exists.
3
- * If the directory structure does not exist, it is created. Like mkdir -p.
4
- * @param directory The path to the directory to ensure exists.
5
- * @example
6
- * ```javascript
7
- * import ensureDirSync from "@visulima/fs/ensure/ensure-dir-sync";
8
- *
9
- * ensureDirSync("/tmp/foo/bar/baz");
10
- * // Creates the directory structure /tmp/foo/bar/baz if it doesn't exist
11
- * ```
12
- */
13
- declare const ensureDirSync: (directory: URL | string) => void;
14
- export default ensureDirSync;
@@ -1,14 +0,0 @@
1
- /**
2
- * Ensures that the directory exists.
3
- * If the directory structure does not exist, it is created. Like mkdir -p.
4
- * @param directory The path to the directory to ensure exists.
5
- * @example
6
- * ```javascript
7
- * import ensureDir from "@visulima/fs/ensure/ensure-dir";
8
- *
9
- * await ensureDir("/tmp/foo/bar/baz");
10
- * // Creates the directory structure /tmp/foo/bar/baz if it doesn't exist
11
- * ```
12
- */
13
- declare const ensureDir: (directory: URL | string) => Promise<void>;
14
- export default ensureDir;
@@ -1,15 +0,0 @@
1
- /**
2
- * Ensures that the file exists.
3
- * If the file that is requested to be created is in directories that do not exist,
4
- * these directories are created. If the file already exists, it is NOT MODIFIED.
5
- * @param filePath The path to the file to ensure exists.
6
- * @example
7
- * ```javascript
8
- * import { ensureFileSync } from "@visulima/fs";
9
- *
10
- * ensureFileSync("/tmp/foo/bar/baz.txt");
11
- * // Creates the file /tmp/foo/bar/baz.txt and any missing parent directories if they don't exist
12
- * ```
13
- */
14
- declare const ensureFileSync: (filePath: URL | string) => void;
15
- export default ensureFileSync;