@bemoje/fs 0.4.1 → 1.0.0

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 (333) hide show
  1. package/index.d.ts +113 -0
  2. package/index.mjs +172 -0
  3. package/package.json +24 -19
  4. package/LICENSE +0 -21
  5. package/README.md +0 -34
  6. package/cjs/index.d.ts +0 -82
  7. package/cjs/index.d.ts.map +0 -1
  8. package/cjs/index.js +0 -85
  9. package/cjs/index.js.map +0 -1
  10. package/cjs/lib/FSPathFilter.d.ts +0 -84
  11. package/cjs/lib/FSPathFilter.d.ts.map +0 -1
  12. package/cjs/lib/FSPathFilter.js +0 -174
  13. package/cjs/lib/FSPathFilter.js.map +0 -1
  14. package/cjs/lib/appendFile.d.ts +0 -10
  15. package/cjs/lib/appendFile.d.ts.map +0 -1
  16. package/cjs/lib/appendFile.js +0 -23
  17. package/cjs/lib/appendFile.js.map +0 -1
  18. package/cjs/lib/appendFileLine.d.ts +0 -7
  19. package/cjs/lib/appendFileLine.d.ts.map +0 -1
  20. package/cjs/lib/appendFileLine.js +0 -16
  21. package/cjs/lib/appendFileLine.js.map +0 -1
  22. package/cjs/lib/appendFileLineSync.d.ts +0 -7
  23. package/cjs/lib/appendFileLineSync.d.ts.map +0 -1
  24. package/cjs/lib/appendFileLineSync.js +0 -16
  25. package/cjs/lib/appendFileLineSync.js.map +0 -1
  26. package/cjs/lib/appendFileSync.d.ts +0 -10
  27. package/cjs/lib/appendFileSync.d.ts.map +0 -1
  28. package/cjs/lib/appendFileSync.js +0 -23
  29. package/cjs/lib/appendFileSync.js.map +0 -1
  30. package/cjs/lib/createDirectory.d.ts +0 -9
  31. package/cjs/lib/createDirectory.d.ts.map +0 -1
  32. package/cjs/lib/createDirectory.js +0 -18
  33. package/cjs/lib/createDirectory.js.map +0 -1
  34. package/cjs/lib/createDirectorySync.d.ts +0 -8
  35. package/cjs/lib/createDirectorySync.d.ts.map +0 -1
  36. package/cjs/lib/createDirectorySync.js +0 -17
  37. package/cjs/lib/createDirectorySync.js.map +0 -1
  38. package/cjs/lib/emptyDirectory.d.ts +0 -17
  39. package/cjs/lib/emptyDirectory.d.ts.map +0 -1
  40. package/cjs/lib/emptyDirectory.js +0 -26
  41. package/cjs/lib/emptyDirectory.js.map +0 -1
  42. package/cjs/lib/emptyDirectorySync.d.ts +0 -17
  43. package/cjs/lib/emptyDirectorySync.d.ts.map +0 -1
  44. package/cjs/lib/emptyDirectorySync.js +0 -29
  45. package/cjs/lib/emptyDirectorySync.js.map +0 -1
  46. package/cjs/lib/getJsonIndentation.d.ts +0 -7
  47. package/cjs/lib/getJsonIndentation.d.ts.map +0 -1
  48. package/cjs/lib/getJsonIndentation.js +0 -17
  49. package/cjs/lib/getJsonIndentation.js.map +0 -1
  50. package/cjs/lib/getLastMofifiedFileIn.d.ts +0 -2
  51. package/cjs/lib/getLastMofifiedFileIn.d.ts.map +0 -1
  52. package/cjs/lib/getLastMofifiedFileIn.js +0 -20
  53. package/cjs/lib/getLastMofifiedFileIn.js.map +0 -1
  54. package/cjs/lib/promptUserEditInTextEditor.d.ts +0 -10
  55. package/cjs/lib/promptUserEditInTextEditor.d.ts.map +0 -1
  56. package/cjs/lib/promptUserEditInTextEditor.js +0 -30
  57. package/cjs/lib/promptUserEditInTextEditor.js.map +0 -1
  58. package/cjs/lib/promptUserEditInTextEditorSync.d.ts +0 -10
  59. package/cjs/lib/promptUserEditInTextEditorSync.d.ts.map +0 -1
  60. package/cjs/lib/promptUserEditInTextEditorSync.js +0 -27
  61. package/cjs/lib/promptUserEditInTextEditorSync.js.map +0 -1
  62. package/cjs/lib/promptUserEditJsonInTextEditor.d.ts +0 -13
  63. package/cjs/lib/promptUserEditJsonInTextEditor.d.ts.map +0 -1
  64. package/cjs/lib/promptUserEditJsonInTextEditor.js +0 -25
  65. package/cjs/lib/promptUserEditJsonInTextEditor.js.map +0 -1
  66. package/cjs/lib/promptUserEditJsonInTextEditorSync.d.ts +0 -13
  67. package/cjs/lib/promptUserEditJsonInTextEditorSync.d.ts.map +0 -1
  68. package/cjs/lib/promptUserEditJsonInTextEditorSync.js +0 -25
  69. package/cjs/lib/promptUserEditJsonInTextEditorSync.js.map +0 -1
  70. package/cjs/lib/readDirectoryDirents.d.ts +0 -11
  71. package/cjs/lib/readDirectoryDirents.d.ts.map +0 -1
  72. package/cjs/lib/readDirectoryDirents.js +0 -17
  73. package/cjs/lib/readDirectoryDirents.js.map +0 -1
  74. package/cjs/lib/readDirectoryDirentsPaths.d.ts +0 -14
  75. package/cjs/lib/readDirectoryDirentsPaths.d.ts.map +0 -1
  76. package/cjs/lib/readDirectoryDirentsPaths.js +0 -27
  77. package/cjs/lib/readDirectoryDirentsPaths.js.map +0 -1
  78. package/cjs/lib/readDirectoryDirentsPathsSafe.d.ts +0 -15
  79. package/cjs/lib/readDirectoryDirentsPathsSafe.d.ts.map +0 -1
  80. package/cjs/lib/readDirectoryDirentsPathsSafe.js +0 -22
  81. package/cjs/lib/readDirectoryDirentsPathsSafe.js.map +0 -1
  82. package/cjs/lib/readDirectoryDirentsPathsSafeSync.d.ts +0 -15
  83. package/cjs/lib/readDirectoryDirentsPathsSafeSync.d.ts.map +0 -1
  84. package/cjs/lib/readDirectoryDirentsPathsSafeSync.js +0 -22
  85. package/cjs/lib/readDirectoryDirentsPathsSafeSync.js.map +0 -1
  86. package/cjs/lib/readDirectoryDirentsPathsSync.d.ts +0 -14
  87. package/cjs/lib/readDirectoryDirentsPathsSync.d.ts.map +0 -1
  88. package/cjs/lib/readDirectoryDirentsPathsSync.js +0 -27
  89. package/cjs/lib/readDirectoryDirentsPathsSync.js.map +0 -1
  90. package/cjs/lib/readDirectoryDirentsSafe.d.ts +0 -12
  91. package/cjs/lib/readDirectoryDirentsSafe.d.ts.map +0 -1
  92. package/cjs/lib/readDirectoryDirentsSafe.js +0 -20
  93. package/cjs/lib/readDirectoryDirentsSafe.js.map +0 -1
  94. package/cjs/lib/readDirectoryDirentsSafeSync.d.ts +0 -12
  95. package/cjs/lib/readDirectoryDirentsSafeSync.d.ts.map +0 -1
  96. package/cjs/lib/readDirectoryDirentsSafeSync.js +0 -20
  97. package/cjs/lib/readDirectoryDirentsSafeSync.js.map +0 -1
  98. package/cjs/lib/readDirectoryDirentsSync.d.ts +0 -11
  99. package/cjs/lib/readDirectoryDirentsSync.d.ts.map +0 -1
  100. package/cjs/lib/readDirectoryDirentsSync.js +0 -17
  101. package/cjs/lib/readDirectoryDirentsSync.js.map +0 -1
  102. package/cjs/lib/readDirectoryNames.d.ts +0 -7
  103. package/cjs/lib/readDirectoryNames.d.ts.map +0 -1
  104. package/cjs/lib/readDirectoryNames.js +0 -15
  105. package/cjs/lib/readDirectoryNames.js.map +0 -1
  106. package/cjs/lib/readDirectoryNamesPaths.d.ts +0 -11
  107. package/cjs/lib/readDirectoryNamesPaths.d.ts.map +0 -1
  108. package/cjs/lib/readDirectoryNamesPaths.js +0 -24
  109. package/cjs/lib/readDirectoryNamesPaths.js.map +0 -1
  110. package/cjs/lib/readDirectoryNamesPathsSafe.d.ts +0 -12
  111. package/cjs/lib/readDirectoryNamesPathsSafe.d.ts.map +0 -1
  112. package/cjs/lib/readDirectoryNamesPathsSafe.js +0 -20
  113. package/cjs/lib/readDirectoryNamesPathsSafe.js.map +0 -1
  114. package/cjs/lib/readDirectoryNamesPathsSafeSync.d.ts +0 -12
  115. package/cjs/lib/readDirectoryNamesPathsSafeSync.d.ts.map +0 -1
  116. package/cjs/lib/readDirectoryNamesPathsSafeSync.js +0 -20
  117. package/cjs/lib/readDirectoryNamesPathsSafeSync.js.map +0 -1
  118. package/cjs/lib/readDirectoryNamesPathsSync.d.ts +0 -11
  119. package/cjs/lib/readDirectoryNamesPathsSync.d.ts.map +0 -1
  120. package/cjs/lib/readDirectoryNamesPathsSync.js +0 -24
  121. package/cjs/lib/readDirectoryNamesPathsSync.js.map +0 -1
  122. package/cjs/lib/readDirectoryNamesSafe.d.ts +0 -8
  123. package/cjs/lib/readDirectoryNamesSafe.d.ts.map +0 -1
  124. package/cjs/lib/readDirectoryNamesSafe.js +0 -18
  125. package/cjs/lib/readDirectoryNamesSafe.js.map +0 -1
  126. package/cjs/lib/readDirectoryNamesSafeSync.d.ts +0 -8
  127. package/cjs/lib/readDirectoryNamesSafeSync.d.ts.map +0 -1
  128. package/cjs/lib/readDirectoryNamesSafeSync.js +0 -18
  129. package/cjs/lib/readDirectoryNamesSafeSync.js.map +0 -1
  130. package/cjs/lib/readDirectoryNamesSync.d.ts +0 -7
  131. package/cjs/lib/readDirectoryNamesSync.d.ts.map +0 -1
  132. package/cjs/lib/readDirectoryNamesSync.js +0 -15
  133. package/cjs/lib/readDirectoryNamesSync.js.map +0 -1
  134. package/cjs/lib/readDirectoryPaths.d.ts +0 -7
  135. package/cjs/lib/readDirectoryPaths.d.ts.map +0 -1
  136. package/cjs/lib/readDirectoryPaths.js +0 -18
  137. package/cjs/lib/readDirectoryPaths.js.map +0 -1
  138. package/cjs/lib/readDirectoryPathsSafe.d.ts +0 -8
  139. package/cjs/lib/readDirectoryPathsSafe.d.ts.map +0 -1
  140. package/cjs/lib/readDirectoryPathsSafe.js +0 -19
  141. package/cjs/lib/readDirectoryPathsSafe.js.map +0 -1
  142. package/cjs/lib/readDirectoryPathsSafeSync.d.ts +0 -8
  143. package/cjs/lib/readDirectoryPathsSafeSync.d.ts.map +0 -1
  144. package/cjs/lib/readDirectoryPathsSafeSync.js +0 -19
  145. package/cjs/lib/readDirectoryPathsSafeSync.js.map +0 -1
  146. package/cjs/lib/readDirectoryPathsSync.d.ts +0 -7
  147. package/cjs/lib/readDirectoryPathsSync.d.ts.map +0 -1
  148. package/cjs/lib/readDirectoryPathsSync.js +0 -18
  149. package/cjs/lib/readDirectoryPathsSync.js.map +0 -1
  150. package/cjs/lib/readDirectoryStats.d.ts +0 -13
  151. package/cjs/lib/readDirectoryStats.d.ts.map +0 -1
  152. package/cjs/lib/readDirectoryStats.js +0 -33
  153. package/cjs/lib/readDirectoryStats.js.map +0 -1
  154. package/cjs/lib/readDirectoryStatsSafe.d.ts +0 -14
  155. package/cjs/lib/readDirectoryStatsSafe.d.ts.map +0 -1
  156. package/cjs/lib/readDirectoryStatsSafe.js +0 -20
  157. package/cjs/lib/readDirectoryStatsSafe.js.map +0 -1
  158. package/cjs/lib/readDirectoryStatsSafeSync.d.ts +0 -14
  159. package/cjs/lib/readDirectoryStatsSafeSync.d.ts.map +0 -1
  160. package/cjs/lib/readDirectoryStatsSafeSync.js +0 -20
  161. package/cjs/lib/readDirectoryStatsSafeSync.js.map +0 -1
  162. package/cjs/lib/readDirectoryStatsSync.d.ts +0 -13
  163. package/cjs/lib/readDirectoryStatsSync.d.ts.map +0 -1
  164. package/cjs/lib/readDirectoryStatsSync.js +0 -32
  165. package/cjs/lib/readDirectoryStatsSync.js.map +0 -1
  166. package/cjs/lib/readFile.d.ts +0 -22
  167. package/cjs/lib/readFile.d.ts.map +0 -1
  168. package/cjs/lib/readFile.js +0 -21
  169. package/cjs/lib/readFile.js.map +0 -1
  170. package/cjs/lib/readFileBuffer.d.ts +0 -20
  171. package/cjs/lib/readFileBuffer.d.ts.map +0 -1
  172. package/cjs/lib/readFileBuffer.js +0 -20
  173. package/cjs/lib/readFileBuffer.js.map +0 -1
  174. package/cjs/lib/readFileBufferSafe.d.ts +0 -12
  175. package/cjs/lib/readFileBufferSafe.d.ts.map +0 -1
  176. package/cjs/lib/readFileBufferSafe.js +0 -24
  177. package/cjs/lib/readFileBufferSafe.js.map +0 -1
  178. package/cjs/lib/readFileBufferSafeSync.d.ts +0 -12
  179. package/cjs/lib/readFileBufferSafeSync.d.ts.map +0 -1
  180. package/cjs/lib/readFileBufferSafeSync.js +0 -24
  181. package/cjs/lib/readFileBufferSafeSync.js.map +0 -1
  182. package/cjs/lib/readFileBufferSync.d.ts +0 -10
  183. package/cjs/lib/readFileBufferSync.d.ts.map +0 -1
  184. package/cjs/lib/readFileBufferSync.js +0 -17
  185. package/cjs/lib/readFileBufferSync.js.map +0 -1
  186. package/cjs/lib/readFileFirstLine.d.ts +0 -5
  187. package/cjs/lib/readFileFirstLine.d.ts.map +0 -1
  188. package/cjs/lib/readFileFirstLine.js +0 -21
  189. package/cjs/lib/readFileFirstLine.js.map +0 -1
  190. package/cjs/lib/readFileSafe.d.ts +0 -14
  191. package/cjs/lib/readFileSafe.d.ts.map +0 -1
  192. package/cjs/lib/readFileSafe.js +0 -26
  193. package/cjs/lib/readFileSafe.js.map +0 -1
  194. package/cjs/lib/readFileSafeSync.d.ts +0 -14
  195. package/cjs/lib/readFileSafeSync.d.ts.map +0 -1
  196. package/cjs/lib/readFileSafeSync.js +0 -26
  197. package/cjs/lib/readFileSafeSync.js.map +0 -1
  198. package/cjs/lib/readFileSync.d.ts +0 -11
  199. package/cjs/lib/readFileSync.d.ts.map +0 -1
  200. package/cjs/lib/readFileSync.js +0 -18
  201. package/cjs/lib/readFileSync.js.map +0 -1
  202. package/cjs/lib/readJsonFile.d.ts +0 -2
  203. package/cjs/lib/readJsonFile.d.ts.map +0 -1
  204. package/cjs/lib/readJsonFile.js +0 -6
  205. package/cjs/lib/readJsonFile.js.map +0 -1
  206. package/cjs/lib/readJsonFileSafe.d.ts +0 -10
  207. package/cjs/lib/readJsonFileSafe.d.ts.map +0 -1
  208. package/cjs/lib/readJsonFileSafe.js +0 -22
  209. package/cjs/lib/readJsonFileSafe.js.map +0 -1
  210. package/cjs/lib/readJsonFileSafeSync.d.ts +0 -10
  211. package/cjs/lib/readJsonFileSafeSync.d.ts.map +0 -1
  212. package/cjs/lib/readJsonFileSafeSync.js +0 -22
  213. package/cjs/lib/readJsonFileSafeSync.js.map +0 -1
  214. package/cjs/lib/readJsonFileSync.d.ts +0 -2
  215. package/cjs/lib/readJsonFileSync.d.ts.map +0 -1
  216. package/cjs/lib/readJsonFileSync.js +0 -6
  217. package/cjs/lib/readJsonFileSync.js.map +0 -1
  218. package/cjs/lib/removeDirectory.d.ts +0 -2
  219. package/cjs/lib/removeDirectory.d.ts.map +0 -1
  220. package/cjs/lib/removeDirectory.js +0 -6
  221. package/cjs/lib/removeDirectory.js.map +0 -1
  222. package/cjs/lib/removeDirectorySync.d.ts +0 -2
  223. package/cjs/lib/removeDirectorySync.d.ts.map +0 -1
  224. package/cjs/lib/removeDirectorySync.js +0 -6
  225. package/cjs/lib/removeDirectorySync.js.map +0 -1
  226. package/cjs/lib/removeFile.d.ts +0 -2
  227. package/cjs/lib/removeFile.d.ts.map +0 -1
  228. package/cjs/lib/removeFile.js +0 -6
  229. package/cjs/lib/removeFile.js.map +0 -1
  230. package/cjs/lib/removeFileSync.d.ts +0 -2
  231. package/cjs/lib/removeFileSync.d.ts.map +0 -1
  232. package/cjs/lib/removeFileSync.js +0 -6
  233. package/cjs/lib/removeFileSync.js.map +0 -1
  234. package/cjs/lib/tempFile.d.ts +0 -7
  235. package/cjs/lib/tempFile.d.ts.map +0 -1
  236. package/cjs/lib/tempFile.js +0 -27
  237. package/cjs/lib/tempFile.js.map +0 -1
  238. package/cjs/lib/tempFileSync.d.ts +0 -7
  239. package/cjs/lib/tempFileSync.d.ts.map +0 -1
  240. package/cjs/lib/tempFileSync.js +0 -27
  241. package/cjs/lib/tempFileSync.js.map +0 -1
  242. package/cjs/lib/types/IGetUserInputFromEditorOptions.d.ts +0 -16
  243. package/cjs/lib/types/IGetUserInputFromEditorOptions.d.ts.map +0 -1
  244. package/cjs/lib/types/IGetUserInputFromEditorOptions.js +0 -3
  245. package/cjs/lib/types/IGetUserInputFromEditorOptions.js.map +0 -1
  246. package/cjs/lib/types/IJFReadOptions.d.ts +0 -2
  247. package/cjs/lib/types/IJFReadOptions.d.ts.map +0 -1
  248. package/cjs/lib/types/IJFReadOptions.js +0 -3
  249. package/cjs/lib/types/IJFReadOptions.js.map +0 -1
  250. package/cjs/lib/types/IJFWriteOptions.d.ts +0 -2
  251. package/cjs/lib/types/IJFWriteOptions.d.ts.map +0 -1
  252. package/cjs/lib/types/IJFWriteOptions.js +0 -3
  253. package/cjs/lib/types/IJFWriteOptions.js.map +0 -1
  254. package/cjs/lib/types/IJsonOutputOptions.d.ts +0 -2
  255. package/cjs/lib/types/IJsonOutputOptions.d.ts.map +0 -1
  256. package/cjs/lib/types/IJsonOutputOptions.js +0 -3
  257. package/cjs/lib/types/IJsonOutputOptions.js.map +0 -1
  258. package/cjs/lib/types/ILogFileData.d.ts +0 -6
  259. package/cjs/lib/types/ILogFileData.d.ts.map +0 -1
  260. package/cjs/lib/types/ILogFileData.js +0 -3
  261. package/cjs/lib/types/ILogFileData.js.map +0 -1
  262. package/cjs/lib/types/IReadJsonFileOptions.d.ts +0 -2
  263. package/cjs/lib/types/IReadJsonFileOptions.d.ts.map +0 -1
  264. package/cjs/lib/types/IReadJsonFileOptions.js +0 -3
  265. package/cjs/lib/types/IReadJsonFileOptions.js.map +0 -1
  266. package/cjs/lib/types/JsonReplacerReviver.d.ts +0 -2
  267. package/cjs/lib/types/JsonReplacerReviver.d.ts.map +0 -1
  268. package/cjs/lib/types/JsonReplacerReviver.js +0 -3
  269. package/cjs/lib/types/JsonReplacerReviver.js.map +0 -1
  270. package/cjs/lib/updateFile.d.ts +0 -11
  271. package/cjs/lib/updateFile.d.ts.map +0 -1
  272. package/cjs/lib/updateFile.js +0 -20
  273. package/cjs/lib/updateFile.js.map +0 -1
  274. package/cjs/lib/updateFileSafe.d.ts +0 -13
  275. package/cjs/lib/updateFileSafe.d.ts.map +0 -1
  276. package/cjs/lib/updateFileSafe.js +0 -28
  277. package/cjs/lib/updateFileSafe.js.map +0 -1
  278. package/cjs/lib/updateFileSafeSync.d.ts +0 -13
  279. package/cjs/lib/updateFileSafeSync.d.ts.map +0 -1
  280. package/cjs/lib/updateFileSafeSync.js +0 -28
  281. package/cjs/lib/updateFileSafeSync.js.map +0 -1
  282. package/cjs/lib/updateFileSync.d.ts +0 -11
  283. package/cjs/lib/updateFileSync.d.ts.map +0 -1
  284. package/cjs/lib/updateFileSync.js +0 -20
  285. package/cjs/lib/updateFileSync.js.map +0 -1
  286. package/cjs/lib/updateJsonFile.d.ts +0 -15
  287. package/cjs/lib/updateJsonFile.d.ts.map +0 -1
  288. package/cjs/lib/updateJsonFile.js +0 -20
  289. package/cjs/lib/updateJsonFile.js.map +0 -1
  290. package/cjs/lib/updateJsonFileSafe.d.ts +0 -17
  291. package/cjs/lib/updateJsonFileSafe.d.ts.map +0 -1
  292. package/cjs/lib/updateJsonFileSafe.js +0 -28
  293. package/cjs/lib/updateJsonFileSafe.js.map +0 -1
  294. package/cjs/lib/updateJsonFileSafeSync.d.ts +0 -17
  295. package/cjs/lib/updateJsonFileSafeSync.d.ts.map +0 -1
  296. package/cjs/lib/updateJsonFileSafeSync.js +0 -28
  297. package/cjs/lib/updateJsonFileSafeSync.js.map +0 -1
  298. package/cjs/lib/updateJsonFileSync.d.ts +0 -15
  299. package/cjs/lib/updateJsonFileSync.d.ts.map +0 -1
  300. package/cjs/lib/updateJsonFileSync.js +0 -20
  301. package/cjs/lib/updateJsonFileSync.js.map +0 -1
  302. package/cjs/lib/writeFile.d.ts +0 -2
  303. package/cjs/lib/writeFile.d.ts.map +0 -1
  304. package/cjs/lib/writeFile.js +0 -6
  305. package/cjs/lib/writeFile.js.map +0 -1
  306. package/cjs/lib/writeFileSafe.d.ts +0 -2
  307. package/cjs/lib/writeFileSafe.d.ts.map +0 -1
  308. package/cjs/lib/writeFileSafe.js +0 -6
  309. package/cjs/lib/writeFileSafe.js.map +0 -1
  310. package/cjs/lib/writeFileSafeSync.d.ts +0 -2
  311. package/cjs/lib/writeFileSafeSync.d.ts.map +0 -1
  312. package/cjs/lib/writeFileSafeSync.js +0 -6
  313. package/cjs/lib/writeFileSafeSync.js.map +0 -1
  314. package/cjs/lib/writeFileSync.d.ts +0 -2
  315. package/cjs/lib/writeFileSync.d.ts.map +0 -1
  316. package/cjs/lib/writeFileSync.js +0 -6
  317. package/cjs/lib/writeFileSync.js.map +0 -1
  318. package/cjs/lib/writeJsonFile.d.ts +0 -2
  319. package/cjs/lib/writeJsonFile.d.ts.map +0 -1
  320. package/cjs/lib/writeJsonFile.js +0 -6
  321. package/cjs/lib/writeJsonFile.js.map +0 -1
  322. package/cjs/lib/writeJsonFileSafe.d.ts +0 -2
  323. package/cjs/lib/writeJsonFileSafe.d.ts.map +0 -1
  324. package/cjs/lib/writeJsonFileSafe.js +0 -6
  325. package/cjs/lib/writeJsonFileSafe.js.map +0 -1
  326. package/cjs/lib/writeJsonFileSafeSync.d.ts +0 -2
  327. package/cjs/lib/writeJsonFileSafeSync.d.ts.map +0 -1
  328. package/cjs/lib/writeJsonFileSafeSync.js +0 -6
  329. package/cjs/lib/writeJsonFileSafeSync.js.map +0 -1
  330. package/cjs/lib/writeJsonFileSync.d.ts +0 -2
  331. package/cjs/lib/writeJsonFileSync.d.ts.map +0 -1
  332. package/cjs/lib/writeJsonFileSync.js +0 -6
  333. package/cjs/lib/writeJsonFileSync.js.map +0 -1
package/index.d.ts ADDED
@@ -0,0 +1,113 @@
1
+ import { Stats } from 'fs-extra';
2
+
3
+ /**
4
+ * Delete files older than a given timestamp
5
+ * @param dp The dirpath to a folder in which to delete files from
6
+ * @param ageThreshold The age in milliseconds to compare against
7
+ */
8
+ declare function deleteOlderThan(dp: string, ageThreshold: number): Promise<void>;
9
+
10
+ /**
11
+ * Retrieves the age of a file in milliseconds.
12
+ * @param filepath - The path to the file.
13
+ */
14
+ declare function getFileAge(filepath: string): Promise<number>;
15
+
16
+ /**
17
+ * Get the name of the first file (not directory) found in a directory.
18
+ */
19
+ declare function getFirstFileInDir(dirpath: string): Promise<string>;
20
+
21
+ /**
22
+ * Reads the first line of a file asynchronously.
23
+ */
24
+ declare function readFileFirstLine(filepath: string): Promise<string>;
25
+
26
+ /**
27
+ * Removes the data URL scheme prefix from a given string.
28
+ * @param dataUrl - The string to remove the prefix from.
29
+ * @returns The string with the prefix removed.
30
+ */
31
+ declare function removeDataUrlSchemePrefix(dataUrl: string): string;
32
+
33
+ /**
34
+ * Updates a file by reading its content, applying a transformation function, and writing back the result.
35
+ * Creates the file and directories if they don't exist.
36
+ */
37
+ declare function updateFile(filepath: string, update: (fileContent: string) => string | Promise<string>): Promise<void>;
38
+
39
+ /**
40
+ * Updates a file by applying a transformation function to an array of lines.
41
+ * The transformation can return either a string (the entire new content) or an array of lines.
42
+ * Creates the file and directories if they don't exist.
43
+ */
44
+ declare function updateFileLines(filepath: string, update: (fileContentLines: string[]) => string | string[] | Promise<string | string[]>): Promise<void>;
45
+
46
+ /**
47
+ * Synchronous version of `updateFileLines`.
48
+ */
49
+ declare function updateFileLinesSync(filepath: string, update: (fileContentLines: string[]) => string | string[]): void;
50
+
51
+ /**
52
+ * Synchronous version of `updateFile`.
53
+ */
54
+ declare function updateFileSync(filepath: string, update: (fileContent: string) => string): void;
55
+
56
+ /**
57
+ * Updates a JSON file by applying a transformation function to the parsed content.
58
+ * If the file doesn't exist or can't be parsed, uses the default value.
59
+ * Creates the file and directories if they don't exist.
60
+ */
61
+ declare function updateJsonFile<T extends object, R extends object>(filepath: string, update: (parsedFileContent: T) => R | Promise<R>, defaultValue?: T): Promise<R>;
62
+
63
+ /**
64
+ * Synchronous version of `updateJsonFile`.
65
+ */
66
+ declare function updateJsonFileSync<T extends object, R extends object>(filepath: string, update: (parsedFileContent: T) => R, defaultValue?: T): R;
67
+
68
+ /**
69
+ * Walk a directory recursively and return an array of paths.
70
+ */
71
+ declare function walkDirectory(dirpath: string, options: WalkDirectoryOptionsWithoutStats): string[];
72
+ /**
73
+ * Walk a directory recursively and return an array of [path: string, stats: Stats] tuples.
74
+ */
75
+ declare function walkDirectory(dirpath: string, options: WalkDirectoryOptionsWithStats): [path: string, stats: Stats][];
76
+ /**
77
+ * Options for @see walkDirectory
78
+ */
79
+ interface WalkDirectoryOptions {
80
+ /**
81
+ * Return stats for each path.
82
+ */
83
+ stats?: boolean;
84
+ /**
85
+ * Only return either files or directories.
86
+ */
87
+ only?: 'files' | 'directories';
88
+ /**
89
+ * Recursion depth limit.
90
+ */
91
+ maxDepth?: number;
92
+ /**
93
+ * Determine whether to walk a given directory.
94
+ */
95
+ filter?: (dirpath: string, basename: string) => boolean;
96
+ /**
97
+ * Follow symbolic links.
98
+ */
99
+ followSymlinks?: boolean;
100
+ /**
101
+ * On filesystems where inodes are not unique (eg. windows), some files may not be walked due to inode collision.
102
+ * Turning off this behavior may be required but at the same time may lead to hitting max_depth via link loop.
103
+ */
104
+ ignoreInodes?: boolean;
105
+ }
106
+ interface WalkDirectoryOptionsWithoutStats extends WalkDirectoryOptions {
107
+ stats?: false;
108
+ }
109
+ interface WalkDirectoryOptionsWithStats extends WalkDirectoryOptions {
110
+ stats: true;
111
+ }
112
+
113
+ export { type WalkDirectoryOptions, type WalkDirectoryOptionsWithStats, type WalkDirectoryOptionsWithoutStats, deleteOlderThan, getFileAge, getFirstFileInDir, readFileFirstLine, removeDataUrlSchemePrefix, updateFile, updateFileLines, updateFileLinesSync, updateFileSync, updateJsonFile, updateJsonFileSync, walkDirectory };
package/index.mjs ADDED
@@ -0,0 +1,172 @@
1
+ import fs5 from 'fs-extra';
2
+ import readline from 'readline';
3
+ import upath from 'upath';
4
+ import walkdir from 'walkdir';
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ async function getFileAge(filepath) {
9
+ const stats = await fs5.stat(filepath);
10
+ const time = stats.ctimeMs || stats.birthtimeMs || stats.mtimeMs;
11
+ return Date.now() - time;
12
+ }
13
+ __name(getFileAge, "getFileAge");
14
+
15
+ // src/deleteOlderThan.ts
16
+ async function deleteOlderThan(dp, ageThreshold) {
17
+ const files = await fs5.readdir(dp);
18
+ for (const file of files) {
19
+ const actualAge = await getFileAge(`${dp}/${file}`);
20
+ if (actualAge > ageThreshold) {
21
+ await fs5.remove(`${dp}/${file}`);
22
+ }
23
+ }
24
+ }
25
+ __name(deleteOlderThan, "deleteOlderThan");
26
+ async function getFirstFileInDir(dirpath) {
27
+ const dirents = await fs5.readdir(dirpath, {
28
+ withFileTypes: true
29
+ });
30
+ const fileDirents = dirents.filter((file) => {
31
+ return file.isFile();
32
+ });
33
+ const filenames = fileDirents.map((file) => {
34
+ return file.name;
35
+ });
36
+ const firstFileName = filenames[0];
37
+ return firstFileName;
38
+ }
39
+ __name(getFirstFileInDir, "getFirstFileInDir");
40
+ async function readFileFirstLine(filepath) {
41
+ const fileStream = fs5.createReadStream(filepath, "utf8");
42
+ const rl = readline.createInterface({
43
+ input: fileStream,
44
+ crlfDelay: Infinity
45
+ });
46
+ for await (const line of rl) {
47
+ return line.trim();
48
+ }
49
+ return "";
50
+ }
51
+ __name(readFileFirstLine, "readFileFirstLine");
52
+
53
+ // src/removeDataUrlSchemePrefix.ts
54
+ function removeDataUrlSchemePrefix(dataUrl) {
55
+ return dataUrl.replace(/^data:.+;base64,/, "");
56
+ }
57
+ __name(removeDataUrlSchemePrefix, "removeDataUrlSchemePrefix");
58
+ async function updateFile(filepath, update) {
59
+ await fs5.ensureFile(filepath);
60
+ const content = await fs5.readFile(filepath, "utf8");
61
+ const updated = await update(content);
62
+ await fs5.outputFile(filepath, updated);
63
+ }
64
+ __name(updateFile, "updateFile");
65
+ async function updateFileLines(filepath, update) {
66
+ await fs5.ensureFile(filepath);
67
+ const content = await fs5.readFile(filepath, "utf8");
68
+ const lines = content.split(/\r?\n/);
69
+ const retval = await update(lines);
70
+ const updated = Array.isArray(retval) ? retval.join("\n") : retval;
71
+ await fs5.outputFile(filepath, updated);
72
+ }
73
+ __name(updateFileLines, "updateFileLines");
74
+ function updateFileLinesSync(filepath, update) {
75
+ fs5.ensureFileSync(filepath);
76
+ const content = fs5.readFileSync(filepath, "utf8");
77
+ const lines = content.split(/\r?\n/);
78
+ const retval = update(lines);
79
+ const updated = Array.isArray(retval) ? retval.join("\n") : retval;
80
+ fs5.outputFileSync(filepath, updated);
81
+ }
82
+ __name(updateFileLinesSync, "updateFileLinesSync");
83
+ function updateFileSync(filepath, update) {
84
+ fs5.ensureFileSync(filepath);
85
+ const content = fs5.readFileSync(filepath, "utf8");
86
+ const updated = update(content);
87
+ fs5.outputFileSync(filepath, updated);
88
+ }
89
+ __name(updateFileSync, "updateFileSync");
90
+ async function updateJsonFile(filepath, update, defaultValue = {}) {
91
+ let content = defaultValue;
92
+ try {
93
+ content = await fs5.readJson(filepath);
94
+ } catch (_) {
95
+ }
96
+ const updated = await update(content);
97
+ await fs5.outputJson(filepath, updated);
98
+ return updated;
99
+ }
100
+ __name(updateJsonFile, "updateJsonFile");
101
+ function updateJsonFileSync(filepath, update, defaultValue = {}) {
102
+ let content = defaultValue;
103
+ try {
104
+ content = fs5.readJsonSync(filepath);
105
+ } catch (_) {
106
+ }
107
+ const updated = update(content);
108
+ fs5.outputJsonSync(filepath, updated);
109
+ return updated;
110
+ }
111
+ __name(updateJsonFileSync, "updateJsonFileSync");
112
+ function walkDirectory(dirpath, options) {
113
+ dirpath = upath.normalizeSafe(dirpath);
114
+ if (!options.stats && !options.only) {
115
+ return walkdir.sync(dirpath, {
116
+ ...convertToWalkdirOptions(options),
117
+ return_object: false
118
+ }).map((fspath) => {
119
+ return upath.normalizeSafe(fspath);
120
+ });
121
+ }
122
+ let entries = Object.entries(walkdir.sync(dirpath, convertToWalkdirOptions(options)));
123
+ if (options.only === "files") {
124
+ entries = entries.filter(([_, stats]) => {
125
+ return stats.isFile();
126
+ });
127
+ } else if (options.only === "directories") {
128
+ entries = entries.filter(([_, stats]) => {
129
+ return stats.isDirectory();
130
+ });
131
+ }
132
+ entries = entries.map(([fspath, stats]) => {
133
+ return [
134
+ upath.normalizeSafe(fspath),
135
+ stats
136
+ ];
137
+ });
138
+ if (options.stats) {
139
+ return entries;
140
+ } else {
141
+ return entries.map(([fspath]) => {
142
+ return fspath;
143
+ });
144
+ }
145
+ }
146
+ __name(walkDirectory, "walkDirectory");
147
+ function convertToWalkdirOptions(options) {
148
+ const result = {
149
+ fs: fs5,
150
+ sync: true,
151
+ return_object: true
152
+ };
153
+ if (options.maxDepth !== void 0) {
154
+ result.max_depth = options.maxDepth;
155
+ }
156
+ if (options.followSymlinks !== void 0) {
157
+ result.follow_symlinks = options.followSymlinks;
158
+ }
159
+ if (options.ignoreInodes !== void 0) {
160
+ result.track_inodes = !options.ignoreInodes;
161
+ }
162
+ if (options.filter) {
163
+ const filter = options.filter;
164
+ result.filter = (dirpath, files) => {
165
+ return filter(upath.normalizeSafe(dirpath), upath.basename(dirpath)) ? files : [];
166
+ };
167
+ }
168
+ return result;
169
+ }
170
+ __name(convertToWalkdirOptions, "convertToWalkdirOptions");
171
+
172
+ export { deleteOlderThan, getFileAge, getFirstFileInDir, readFileFirstLine, removeDataUrlSchemePrefix, updateFile, updateFileLines, updateFileLinesSync, updateFileSync, updateJsonFile, updateJsonFileSync, walkDirectory };
package/package.json CHANGED
@@ -1,17 +1,29 @@
1
1
  {
2
2
  "name": "@bemoje/fs",
3
- "version": "0.4.1",
4
- "type": "commonjs",
5
- "main": "cjs/index.js",
6
- "types": "cjs/index.d.ts",
3
+ "version": "1.0.0",
4
+ "description": "fs",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "keywords": [
8
+ "fs"
9
+ ],
10
+ "exports": {
11
+ ".": {
12
+ "types": "./index.d.ts",
13
+ "import": "./index.mjs",
14
+ "default": "./index.mjs"
15
+ }
16
+ },
7
17
  "dependencies": {
8
- "@bemoje/os": "latest",
9
- "@bemoje/regex": "latest",
10
- "fs-extra": "^11.2.0",
11
- "tslib": "latest"
18
+ "fs-extra": "^11.3.0",
19
+ "upath": "^2.0.1",
20
+ "walkdir": "^0.4.1",
21
+ "@types/fs-extra": "^11.0.4"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
12
25
  },
13
26
  "license": "MIT",
14
- "keywords": [],
15
27
  "author": {
16
28
  "name": "Benjamin Møller Jensen",
17
29
  "email": "bemoje@bemoje.net",
@@ -19,14 +31,7 @@
19
31
  },
20
32
  "repository": {
21
33
  "type": "git",
22
- "url": "git+https://github.com/bemoje/tsmono.git"
23
- },
24
- "funding": {
25
- "type": "patreon",
26
- "url": "https://www.patreon.com/user?u=40752770"
27
- },
28
- "bugs": {
29
- "url": "https://github.com/bemoje/tsmono/issues"
30
- },
31
- "homepage": "https://github.com/bemoje/tsmono"
34
+ "url": "git+https://github.com/bemoje/mono.git",
35
+ "directory": "libs/fs"
36
+ }
32
37
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Benjamin Møller Jensen
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/README.md DELETED
@@ -1,34 +0,0 @@
1
- # @bemoje/fs
2
-
3
-
4
-
5
- ![npm (scoped)](https://img.shields.io/npm/v/%40bemoje/trie-map)
6
- ![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/%40bemoje/fs)
7
- ![npm](https://img.shields.io/npm/dt/%40bemoje/fs)
8
- ![NPM](https://img.shields.io/npm/l/%40bemoje%2Ffs)
9
-
10
- ![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/bemoje/tsmono)
11
- ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/bemoje/tsmono)
12
- ![GitHub top language](https://img.shields.io/github/languages/top/bemoje/tsmono)
13
-
14
-
15
- ## Documentation
16
- [Documentation Website](https://bemoje.github.io/tsmono/modules/fs.html)
17
-
18
- ## Installation
19
- This library is published in the NPM registry and can be installed using any compatible package manager.
20
-
21
- #### NPM
22
- ```sh
23
- npm install @bemoje/fs
24
- ```
25
-
26
-
27
- ## Issues
28
- Please let me know of any bugs or [issues](https://github.com/bemoje/tsmono/issues).
29
-
30
- ## Contribute
31
- Contributors are welcome to open a [pull request](https://github.com/bemoje/tsmono/pulls).
32
-
33
- ## License
34
- Released under the [undefined License](./LICENSE).
package/cjs/index.d.ts DELETED
@@ -1,82 +0,0 @@
1
- export * from './lib/appendFile';
2
- export * from './lib/appendFileLine';
3
- export * from './lib/appendFileLineSync';
4
- export * from './lib/appendFileSync';
5
- export * from './lib/createDirectory';
6
- export * from './lib/createDirectorySync';
7
- export * from './lib/emptyDirectory';
8
- export * from './lib/emptyDirectorySync';
9
- export * from './lib/FSPathFilter';
10
- export * from './lib/getJsonIndentation';
11
- export * from './lib/getLastMofifiedFileIn';
12
- export * from './lib/promptUserEditInTextEditor';
13
- export * from './lib/promptUserEditInTextEditorSync';
14
- export * from './lib/promptUserEditJsonInTextEditor';
15
- export * from './lib/promptUserEditJsonInTextEditorSync';
16
- export * from './lib/readDirectoryDirents';
17
- export * from './lib/readDirectoryDirentsPaths';
18
- export * from './lib/readDirectoryDirentsPathsSafe';
19
- export * from './lib/readDirectoryDirentsPathsSafeSync';
20
- export * from './lib/readDirectoryDirentsPathsSync';
21
- export * from './lib/readDirectoryDirentsSafe';
22
- export * from './lib/readDirectoryDirentsSafeSync';
23
- export * from './lib/readDirectoryDirentsSync';
24
- export * from './lib/readDirectoryNames';
25
- export * from './lib/readDirectoryNamesPaths';
26
- export * from './lib/readDirectoryNamesPathsSafe';
27
- export * from './lib/readDirectoryNamesPathsSafeSync';
28
- export * from './lib/readDirectoryNamesPathsSync';
29
- export * from './lib/readDirectoryNamesSafe';
30
- export * from './lib/readDirectoryNamesSafeSync';
31
- export * from './lib/readDirectoryNamesSync';
32
- export * from './lib/readDirectoryPaths';
33
- export * from './lib/readDirectoryPathsSafe';
34
- export * from './lib/readDirectoryPathsSafeSync';
35
- export * from './lib/readDirectoryPathsSync';
36
- export * from './lib/readDirectoryStats';
37
- export * from './lib/readDirectoryStatsSafe';
38
- export * from './lib/readDirectoryStatsSafeSync';
39
- export * from './lib/readDirectoryStatsSync';
40
- export * from './lib/readFile';
41
- export * from './lib/readFileBuffer';
42
- export * from './lib/readFileBufferSafe';
43
- export * from './lib/readFileBufferSafeSync';
44
- export * from './lib/readFileBufferSync';
45
- export * from './lib/readFileFirstLine';
46
- export * from './lib/readFileSafe';
47
- export * from './lib/readFileSafeSync';
48
- export * from './lib/readFileSync';
49
- export * from './lib/readJsonFile';
50
- export * from './lib/readJsonFileSafe';
51
- export * from './lib/readJsonFileSafeSync';
52
- export * from './lib/readJsonFileSync';
53
- export * from './lib/removeDirectory';
54
- export * from './lib/removeDirectorySync';
55
- export * from './lib/removeFile';
56
- export * from './lib/removeFileSync';
57
- export * from './lib/tempFile';
58
- export * from './lib/tempFileSync';
59
- export * from './lib/types/IGetUserInputFromEditorOptions';
60
- export * from './lib/types/IJFReadOptions';
61
- export * from './lib/types/IJFWriteOptions';
62
- export * from './lib/types/IJsonOutputOptions';
63
- export * from './lib/types/ILogFileData';
64
- export * from './lib/types/IReadJsonFileOptions';
65
- export * from './lib/types/JsonReplacerReviver';
66
- export * from './lib/updateFile';
67
- export * from './lib/updateFileSafe';
68
- export * from './lib/updateFileSafeSync';
69
- export * from './lib/updateFileSync';
70
- export * from './lib/updateJsonFile';
71
- export * from './lib/updateJsonFileSafe';
72
- export * from './lib/updateJsonFileSafeSync';
73
- export * from './lib/updateJsonFileSync';
74
- export * from './lib/writeFile';
75
- export * from './lib/writeFileSafe';
76
- export * from './lib/writeFileSafeSync';
77
- export * from './lib/writeFileSync';
78
- export * from './lib/writeJsonFile';
79
- export * from './lib/writeJsonFileSafe';
80
- export * from './lib/writeJsonFileSafeSync';
81
- export * from './lib/writeJsonFileSync';
82
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/fs/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kCAAkC,CAAA;AAChD,cAAc,sCAAsC,CAAA;AACpD,cAAc,sCAAsC,CAAA;AACpD,cAAc,0CAA0C,CAAA;AACxD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,qCAAqC,CAAA;AACnD,cAAc,yCAAyC,CAAA;AACvD,cAAc,qCAAqC,CAAA;AACnD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oCAAoC,CAAA;AAClD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,uCAAuC,CAAA;AACrD,cAAc,mCAAmC,CAAA;AACjD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4CAA4C,CAAA;AAC1D,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA;AACxC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA"}
package/cjs/index.js DELETED
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./lib/appendFile"), exports);
5
- tslib_1.__exportStar(require("./lib/appendFileLine"), exports);
6
- tslib_1.__exportStar(require("./lib/appendFileLineSync"), exports);
7
- tslib_1.__exportStar(require("./lib/appendFileSync"), exports);
8
- tslib_1.__exportStar(require("./lib/createDirectory"), exports);
9
- tslib_1.__exportStar(require("./lib/createDirectorySync"), exports);
10
- tslib_1.__exportStar(require("./lib/emptyDirectory"), exports);
11
- tslib_1.__exportStar(require("./lib/emptyDirectorySync"), exports);
12
- tslib_1.__exportStar(require("./lib/FSPathFilter"), exports);
13
- tslib_1.__exportStar(require("./lib/getJsonIndentation"), exports);
14
- tslib_1.__exportStar(require("./lib/getLastMofifiedFileIn"), exports);
15
- tslib_1.__exportStar(require("./lib/promptUserEditInTextEditor"), exports);
16
- tslib_1.__exportStar(require("./lib/promptUserEditInTextEditorSync"), exports);
17
- tslib_1.__exportStar(require("./lib/promptUserEditJsonInTextEditor"), exports);
18
- tslib_1.__exportStar(require("./lib/promptUserEditJsonInTextEditorSync"), exports);
19
- tslib_1.__exportStar(require("./lib/readDirectoryDirents"), exports);
20
- tslib_1.__exportStar(require("./lib/readDirectoryDirentsPaths"), exports);
21
- tslib_1.__exportStar(require("./lib/readDirectoryDirentsPathsSafe"), exports);
22
- tslib_1.__exportStar(require("./lib/readDirectoryDirentsPathsSafeSync"), exports);
23
- tslib_1.__exportStar(require("./lib/readDirectoryDirentsPathsSync"), exports);
24
- tslib_1.__exportStar(require("./lib/readDirectoryDirentsSafe"), exports);
25
- tslib_1.__exportStar(require("./lib/readDirectoryDirentsSafeSync"), exports);
26
- tslib_1.__exportStar(require("./lib/readDirectoryDirentsSync"), exports);
27
- tslib_1.__exportStar(require("./lib/readDirectoryNames"), exports);
28
- tslib_1.__exportStar(require("./lib/readDirectoryNamesPaths"), exports);
29
- tslib_1.__exportStar(require("./lib/readDirectoryNamesPathsSafe"), exports);
30
- tslib_1.__exportStar(require("./lib/readDirectoryNamesPathsSafeSync"), exports);
31
- tslib_1.__exportStar(require("./lib/readDirectoryNamesPathsSync"), exports);
32
- tslib_1.__exportStar(require("./lib/readDirectoryNamesSafe"), exports);
33
- tslib_1.__exportStar(require("./lib/readDirectoryNamesSafeSync"), exports);
34
- tslib_1.__exportStar(require("./lib/readDirectoryNamesSync"), exports);
35
- tslib_1.__exportStar(require("./lib/readDirectoryPaths"), exports);
36
- tslib_1.__exportStar(require("./lib/readDirectoryPathsSafe"), exports);
37
- tslib_1.__exportStar(require("./lib/readDirectoryPathsSafeSync"), exports);
38
- tslib_1.__exportStar(require("./lib/readDirectoryPathsSync"), exports);
39
- tslib_1.__exportStar(require("./lib/readDirectoryStats"), exports);
40
- tslib_1.__exportStar(require("./lib/readDirectoryStatsSafe"), exports);
41
- tslib_1.__exportStar(require("./lib/readDirectoryStatsSafeSync"), exports);
42
- tslib_1.__exportStar(require("./lib/readDirectoryStatsSync"), exports);
43
- tslib_1.__exportStar(require("./lib/readFile"), exports);
44
- tslib_1.__exportStar(require("./lib/readFileBuffer"), exports);
45
- tslib_1.__exportStar(require("./lib/readFileBufferSafe"), exports);
46
- tslib_1.__exportStar(require("./lib/readFileBufferSafeSync"), exports);
47
- tslib_1.__exportStar(require("./lib/readFileBufferSync"), exports);
48
- tslib_1.__exportStar(require("./lib/readFileFirstLine"), exports);
49
- tslib_1.__exportStar(require("./lib/readFileSafe"), exports);
50
- tslib_1.__exportStar(require("./lib/readFileSafeSync"), exports);
51
- tslib_1.__exportStar(require("./lib/readFileSync"), exports);
52
- tslib_1.__exportStar(require("./lib/readJsonFile"), exports);
53
- tslib_1.__exportStar(require("./lib/readJsonFileSafe"), exports);
54
- tslib_1.__exportStar(require("./lib/readJsonFileSafeSync"), exports);
55
- tslib_1.__exportStar(require("./lib/readJsonFileSync"), exports);
56
- tslib_1.__exportStar(require("./lib/removeDirectory"), exports);
57
- tslib_1.__exportStar(require("./lib/removeDirectorySync"), exports);
58
- tslib_1.__exportStar(require("./lib/removeFile"), exports);
59
- tslib_1.__exportStar(require("./lib/removeFileSync"), exports);
60
- tslib_1.__exportStar(require("./lib/tempFile"), exports);
61
- tslib_1.__exportStar(require("./lib/tempFileSync"), exports);
62
- tslib_1.__exportStar(require("./lib/types/IGetUserInputFromEditorOptions"), exports);
63
- tslib_1.__exportStar(require("./lib/types/IJFReadOptions"), exports);
64
- tslib_1.__exportStar(require("./lib/types/IJFWriteOptions"), exports);
65
- tslib_1.__exportStar(require("./lib/types/IJsonOutputOptions"), exports);
66
- tslib_1.__exportStar(require("./lib/types/ILogFileData"), exports);
67
- tslib_1.__exportStar(require("./lib/types/IReadJsonFileOptions"), exports);
68
- tslib_1.__exportStar(require("./lib/types/JsonReplacerReviver"), exports);
69
- tslib_1.__exportStar(require("./lib/updateFile"), exports);
70
- tslib_1.__exportStar(require("./lib/updateFileSafe"), exports);
71
- tslib_1.__exportStar(require("./lib/updateFileSafeSync"), exports);
72
- tslib_1.__exportStar(require("./lib/updateFileSync"), exports);
73
- tslib_1.__exportStar(require("./lib/updateJsonFile"), exports);
74
- tslib_1.__exportStar(require("./lib/updateJsonFileSafe"), exports);
75
- tslib_1.__exportStar(require("./lib/updateJsonFileSafeSync"), exports);
76
- tslib_1.__exportStar(require("./lib/updateJsonFileSync"), exports);
77
- tslib_1.__exportStar(require("./lib/writeFile"), exports);
78
- tslib_1.__exportStar(require("./lib/writeFileSafe"), exports);
79
- tslib_1.__exportStar(require("./lib/writeFileSafeSync"), exports);
80
- tslib_1.__exportStar(require("./lib/writeFileSync"), exports);
81
- tslib_1.__exportStar(require("./lib/writeJsonFile"), exports);
82
- tslib_1.__exportStar(require("./lib/writeJsonFileSafe"), exports);
83
- tslib_1.__exportStar(require("./lib/writeJsonFileSafeSync"), exports);
84
- tslib_1.__exportStar(require("./lib/writeJsonFileSync"), exports);
85
- //# sourceMappingURL=index.js.map
package/cjs/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/fs/src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAgC;AAChC,+DAAoC;AACpC,mEAAwC;AACxC,+DAAoC;AACpC,gEAAqC;AACrC,oEAAyC;AACzC,+DAAoC;AACpC,mEAAwC;AACxC,6DAAkC;AAClC,mEAAwC;AACxC,sEAA2C;AAC3C,2EAAgD;AAChD,+EAAoD;AACpD,+EAAoD;AACpD,mFAAwD;AACxD,qEAA0C;AAC1C,0EAA+C;AAC/C,8EAAmD;AACnD,kFAAuD;AACvD,8EAAmD;AACnD,yEAA8C;AAC9C,6EAAkD;AAClD,yEAA8C;AAC9C,mEAAwC;AACxC,wEAA6C;AAC7C,4EAAiD;AACjD,gFAAqD;AACrD,4EAAiD;AACjD,uEAA4C;AAC5C,2EAAgD;AAChD,uEAA4C;AAC5C,mEAAwC;AACxC,uEAA4C;AAC5C,2EAAgD;AAChD,uEAA4C;AAC5C,mEAAwC;AACxC,uEAA4C;AAC5C,2EAAgD;AAChD,uEAA4C;AAC5C,yDAA8B;AAC9B,+DAAoC;AACpC,mEAAwC;AACxC,uEAA4C;AAC5C,mEAAwC;AACxC,kEAAuC;AACvC,6DAAkC;AAClC,iEAAsC;AACtC,6DAAkC;AAClC,6DAAkC;AAClC,iEAAsC;AACtC,qEAA0C;AAC1C,iEAAsC;AACtC,gEAAqC;AACrC,oEAAyC;AACzC,2DAAgC;AAChC,+DAAoC;AACpC,yDAA8B;AAC9B,6DAAkC;AAClC,qFAA0D;AAC1D,qEAA0C;AAC1C,sEAA2C;AAC3C,yEAA8C;AAC9C,mEAAwC;AACxC,2EAAgD;AAChD,0EAA+C;AAC/C,2DAAgC;AAChC,+DAAoC;AACpC,mEAAwC;AACxC,+DAAoC;AACpC,+DAAoC;AACpC,mEAAwC;AACxC,uEAA4C;AAC5C,mEAAwC;AACxC,0DAA+B;AAC/B,8DAAmC;AACnC,kEAAuC;AACvC,8DAAmC;AACnC,8DAAmC;AACnC,kEAAuC;AACvC,sEAA2C;AAC3C,kEAAuC"}
@@ -1,84 +0,0 @@
1
- /// <reference types="node" />
2
- import { EventEmitter } from 'events';
3
- export interface IPathFilterIgnoreOptions {
4
- startsWith?: boolean;
5
- endsWith?: boolean;
6
- }
7
- /**
8
- * Builder class to easily and flexibly construct and implement filesystem path filtering.
9
- */
10
- export declare class FSPathFilter extends EventEmitter {
11
- /**
12
- * Returns a new object with the default ignore options.
13
- */
14
- protected static get ignoreOptionDefaults(): IPathFilterIgnoreOptions;
15
- readonly filepathFilters: Array<(path: string) => boolean>;
16
- readonly dirpathFilters: Array<(path: string) => boolean>;
17
- readonly filenameFilters: Array<(path: string) => boolean>;
18
- readonly filepathRegex: Array<RegExp>;
19
- readonly dirpathRegex: Array<RegExp>;
20
- readonly filenameRegex: Array<RegExp>;
21
- readonly ignoredExtensions: Set<string>;
22
- isCaseInsensitive: boolean;
23
- constructor(options?: {
24
- captureRejections?: boolean;
25
- });
26
- protected createRegex(ignore: string, options?: IPathFilterIgnoreOptions): RegExp;
27
- /**
28
- * Add a whole or partial filepath to ignore.
29
- */
30
- ignoreFilepath(ignore: string, options?: IPathFilterIgnoreOptions): FSPathFilter;
31
- /**
32
- * Add a whole or partial dirname to ignore.
33
- */
34
- ignoreDirpath(ignore: string, options?: IPathFilterIgnoreOptions): FSPathFilter;
35
- /**
36
- * Add a whole or partial filename to ignore.
37
- */
38
- ignoreFilename(ignore: string, options?: IPathFilterIgnoreOptions): FSPathFilter;
39
- /**
40
- * Add a file extension type to ignore.
41
- */
42
- ignoreExtension(ignore: string): FSPathFilter;
43
- /**
44
- * Add a custom filter function for validating filepaths
45
- */
46
- filterFilepath(filter: (path: string) => boolean): FSPathFilter;
47
- /**
48
- * Add a custom filter function for validating dirpaths.
49
- */
50
- filterDirpath(filter: (path: string) => boolean): FSPathFilter;
51
- /**
52
- * Add a custom filter function for validating filenames.
53
- */
54
- filterFilename(filter: (path: string) => boolean): FSPathFilter;
55
- /**
56
- * Add a custom regex object for matching filepaths to be ignored.
57
- */
58
- ignoreFilepathRegex(regex: RegExp): FSPathFilter;
59
- /**
60
- * Add a custom regex object for matching dirpaths to be ignored.
61
- */
62
- ignoreDirpathRegex(regex: RegExp): FSPathFilter;
63
- /**
64
- * Add a custom regex object for matching filenames to be ignored.
65
- */
66
- ignoreFilenameRegex(regex: RegExp): FSPathFilter;
67
- /**
68
- * Performs the configured filepath filtering.
69
- */
70
- validateFilepath(filepath: string): boolean;
71
- /**
72
- * Performs the configured dirpath filtering.
73
- */
74
- validateDirpath(dirpath: string): boolean;
75
- /**
76
- * Performs the configured filename filtering.
77
- */
78
- validateFilename(filename: string): boolean;
79
- /**
80
- * Performs the configured extension filtering.
81
- */
82
- validateExtension(ext: string): boolean;
83
- }
84
- //# sourceMappingURL=FSPathFilter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FSPathFilter.d.ts","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/FSPathFilter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAIrC,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C;;OAEG;IACH,SAAS,CAAC,MAAM,KAAK,oBAAoB,IAAI,wBAAwB,CAKpE;IAED,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAK;IAC/D,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAK;IAC9D,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAK;IAE/D,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAK;IAC1C,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAK;IACzC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAK;IAE1C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAY;IAEnD,iBAAiB,UAAc;gBAEnB,OAAO,GAAE;QAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAgC;IAIlF,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,wBAA6B,GAAG,MAAM;IASrF;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,YAAY;IAKhF;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,YAAY;IAK/E;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,YAAY;IAKhF;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK7C;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,YAAY;IAK/D;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,YAAY;IAK9D;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,YAAY;IAK/D;;OAEG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKhD;;OAEG;IACH,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAK/C;;OAEG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAKhD;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAgB3C;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAgBzC;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAgB3C;;OAEG;IACH,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAGxC"}