extra-filesystem 0.4.10 → 0.5.1

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 (434) hide show
  1. package/lib/checksum-file.js +11 -0
  2. package/lib/checksum-file.js.map +1 -0
  3. package/lib/copy-sync.js +7 -0
  4. package/lib/copy-sync.js.map +1 -0
  5. package/lib/copy.js +7 -0
  6. package/lib/copy.js.map +1 -0
  7. package/lib/create-temp-dir-sync.js +8 -0
  8. package/lib/create-temp-dir-sync.js.map +1 -0
  9. package/lib/create-temp-dir.js +8 -0
  10. package/lib/create-temp-dir.js.map +1 -0
  11. package/lib/create-temp-file-sync.js +8 -0
  12. package/lib/create-temp-file-sync.js.map +1 -0
  13. package/lib/create-temp-file.js +8 -0
  14. package/lib/create-temp-file.js.map +1 -0
  15. package/lib/create-temp-name-sync.js +5 -0
  16. package/lib/create-temp-name-sync.js.map +1 -0
  17. package/lib/create-temp-name.js +5 -0
  18. package/lib/create-temp-name.js.map +1 -0
  19. package/lib/empty-dir-sync.js +8 -0
  20. package/lib/empty-dir-sync.js.map +1 -0
  21. package/lib/empty-dir.js +9 -0
  22. package/lib/empty-dir.js.map +1 -0
  23. package/lib/ensure-dir-sync.js +5 -0
  24. package/lib/ensure-dir-sync.js.map +1 -0
  25. package/lib/ensure-dir.js +5 -0
  26. package/lib/ensure-dir.js.map +1 -0
  27. package/lib/ensure-file-sync.js +15 -0
  28. package/lib/ensure-file-sync.js.map +1 -0
  29. package/lib/ensure-file.js +16 -0
  30. package/lib/ensure-file.js.map +1 -0
  31. package/lib/find-all-dirnames.js +18 -0
  32. package/lib/find-all-dirnames.js.map +1 -0
  33. package/lib/find-all-filenames.js +18 -0
  34. package/lib/find-all-filenames.js.map +1 -0
  35. package/lib/find-up-package-filename-sync.js +15 -0
  36. package/lib/find-up-package-filename-sync.js.map +1 -0
  37. package/lib/find-up-package-filename.js +15 -0
  38. package/lib/find-up-package-filename.js.map +1 -0
  39. package/lib/get-long-extension.js +14 -0
  40. package/lib/get-long-extension.js.map +1 -0
  41. package/lib/get-short-basename.js +6 -0
  42. package/lib/get-short-basename.js.map +1 -0
  43. package/lib/index.d.ts +47 -0
  44. package/lib/index.js +48 -0
  45. package/lib/index.js.map +1 -0
  46. package/lib/is-directory-sync.js +6 -0
  47. package/lib/is-directory-sync.js.map +1 -0
  48. package/lib/is-directory.js +6 -0
  49. package/lib/is-directory.js.map +1 -0
  50. package/lib/is-file-sync.js +6 -0
  51. package/lib/is-file-sync.js.map +1 -0
  52. package/lib/is-file.js +6 -0
  53. package/lib/is-file.js.map +1 -0
  54. package/lib/is-readable.js +12 -0
  55. package/lib/is-readable.js.map +1 -0
  56. package/lib/is-sub-path-of.js +8 -0
  57. package/lib/is-sub-path-of.js.map +1 -0
  58. package/lib/is-writable.js +12 -0
  59. package/lib/is-writable.js.map +1 -0
  60. package/lib/move-sync.js +7 -0
  61. package/lib/move-sync.js.map +1 -0
  62. package/lib/move.js +7 -0
  63. package/lib/move.js.map +1 -0
  64. package/lib/path-exists-sync.js +11 -0
  65. package/lib/path-exists-sync.js.map +1 -0
  66. package/lib/path-exists.js +11 -0
  67. package/lib/path-exists.js.map +1 -0
  68. package/lib/{es2015/read-file-line-by-line-sync.d.ts → read-file-line-by-line-sync.d.ts} +1 -1
  69. package/lib/read-file-line-by-line-sync.js +21 -0
  70. package/lib/read-file-line-by-line-sync.js.map +1 -0
  71. package/lib/{es2015/read-file-line-by-line.d.ts → read-file-line-by-line.d.ts} +1 -1
  72. package/lib/read-file-line-by-line.js +10 -0
  73. package/lib/read-file-line-by-line.js.map +1 -0
  74. package/lib/{es2015/read-json-file-sync.d.ts → read-json-file-sync.d.ts} +1 -1
  75. package/lib/read-json-file-sync.js +6 -0
  76. package/lib/read-json-file-sync.js.map +1 -0
  77. package/lib/{es2015/read-json-file.d.ts → read-json-file.d.ts} +1 -1
  78. package/lib/read-json-file.js +6 -0
  79. package/lib/read-json-file.js.map +1 -0
  80. package/lib/{es2015/read-ndjson-file-sync.d.ts → read-ndjson-file-sync.d.ts} +1 -1
  81. package/lib/read-ndjson-file-sync.js +7 -0
  82. package/lib/read-ndjson-file-sync.js.map +1 -0
  83. package/lib/{es2015/read-ndjson-file.d.ts → read-ndjson-file.d.ts} +1 -1
  84. package/lib/read-ndjson-file.js +7 -0
  85. package/lib/read-ndjson-file.js.map +1 -0
  86. package/lib/{es2015/read-yaml-file-sync.d.ts → read-yaml-file-sync.d.ts} +1 -1
  87. package/lib/read-yaml-file-sync.js +8 -0
  88. package/lib/read-yaml-file-sync.js.map +1 -0
  89. package/lib/{es2015/read-yaml-file.d.ts → read-yaml-file.d.ts} +1 -1
  90. package/lib/read-yaml-file.js +8 -0
  91. package/lib/read-yaml-file.js.map +1 -0
  92. package/lib/remove-sync.js +5 -0
  93. package/lib/remove-sync.js.map +1 -0
  94. package/lib/remove.js +5 -0
  95. package/lib/remove.js.map +1 -0
  96. package/lib/write-iterable-to-file.js +9 -0
  97. package/lib/write-iterable-to-file.js.map +1 -0
  98. package/lib/write-json-file-sync.js +6 -0
  99. package/lib/write-json-file-sync.js.map +1 -0
  100. package/lib/write-json-file.js +6 -0
  101. package/lib/write-json-file.js.map +1 -0
  102. package/lib/write-yaml-file-sync.js +7 -0
  103. package/lib/write-yaml-file-sync.js.map +1 -0
  104. package/lib/write-yaml-file.js +7 -0
  105. package/lib/write-yaml-file.js.map +1 -0
  106. package/package.json +37 -36
  107. package/src/checksum-file.ts +14 -0
  108. package/src/copy-sync.ts +7 -0
  109. package/src/copy.ts +10 -0
  110. package/src/create-temp-dir-sync.ts +8 -0
  111. package/src/create-temp-dir.ts +8 -0
  112. package/src/create-temp-file-sync.ts +8 -0
  113. package/src/create-temp-file.ts +8 -0
  114. package/src/create-temp-name-sync.ts +5 -0
  115. package/src/create-temp-name.ts +5 -0
  116. package/src/empty-dir-sync.ts +8 -0
  117. package/src/empty-dir.ts +9 -0
  118. package/src/ensure-dir-sync.ts +5 -0
  119. package/src/ensure-dir.ts +5 -0
  120. package/src/ensure-file-sync.ts +14 -0
  121. package/src/ensure-file.ts +15 -0
  122. package/src/find-all-dirnames.ts +22 -0
  123. package/src/find-all-filenames.ts +20 -0
  124. package/src/find-up-package-filename-sync.ts +14 -0
  125. package/src/find-up-package-filename.ts +14 -0
  126. package/src/get-long-extension.ts +13 -0
  127. package/src/get-short-basename.ts +6 -0
  128. package/src/index.ts +47 -0
  129. package/src/is-directory-sync.ts +6 -0
  130. package/src/is-directory.ts +6 -0
  131. package/src/is-file-sync.ts +6 -0
  132. package/src/is-file.ts +6 -0
  133. package/src/is-readable.ts +11 -0
  134. package/src/is-sub-path-of.ts +9 -0
  135. package/src/is-writable.ts +11 -0
  136. package/src/move-sync.ts +7 -0
  137. package/src/move.ts +7 -0
  138. package/src/path-exists-sync.ts +13 -0
  139. package/src/path-exists.ts +13 -0
  140. package/src/read-file-line-by-line-sync.ts +25 -0
  141. package/src/read-file-line-by-line.ts +14 -0
  142. package/src/read-json-file-sync.ts +9 -0
  143. package/src/read-json-file.ts +9 -0
  144. package/src/read-ndjson-file-sync.ts +14 -0
  145. package/src/read-ndjson-file.ts +14 -0
  146. package/src/read-yaml-file-sync.ts +11 -0
  147. package/src/read-yaml-file.ts +11 -0
  148. package/src/remove-sync.ts +5 -0
  149. package/src/remove.ts +5 -0
  150. package/src/write-iterable-to-file.ts +12 -0
  151. package/src/write-json-file-sync.ts +10 -0
  152. package/src/write-json-file.ts +10 -0
  153. package/src/write-yaml-file-sync.ts +7 -0
  154. package/src/write-yaml-file.ts +7 -0
  155. package/lib/es2015/checksum-file.js +0 -39
  156. package/lib/es2015/checksum-file.js.map +0 -1
  157. package/lib/es2015/copy-sync.js +0 -34
  158. package/lib/es2015/copy-sync.js.map +0 -1
  159. package/lib/es2015/copy.js +0 -45
  160. package/lib/es2015/copy.js.map +0 -1
  161. package/lib/es2015/create-temp-dir-sync.js +0 -12
  162. package/lib/es2015/create-temp-dir-sync.js.map +0 -1
  163. package/lib/es2015/create-temp-dir.js +0 -23
  164. package/lib/es2015/create-temp-dir.js.map +0 -1
  165. package/lib/es2015/create-temp-file-sync.js +0 -12
  166. package/lib/es2015/create-temp-file-sync.js.map +0 -1
  167. package/lib/es2015/create-temp-file.js +0 -23
  168. package/lib/es2015/create-temp-file.js.map +0 -1
  169. package/lib/es2015/create-temp-name-sync.js +0 -9
  170. package/lib/es2015/create-temp-name-sync.js.map +0 -1
  171. package/lib/es2015/create-temp-name.js +0 -20
  172. package/lib/es2015/create-temp-name.js.map +0 -1
  173. package/lib/es2015/empty-dir-sync.js +0 -35
  174. package/lib/es2015/empty-dir-sync.js.map +0 -1
  175. package/lib/es2015/empty-dir.js +0 -47
  176. package/lib/es2015/empty-dir.js.map +0 -1
  177. package/lib/es2015/ensure-dir-sync.js +0 -32
  178. package/lib/es2015/ensure-dir-sync.js.map +0 -1
  179. package/lib/es2015/ensure-dir.js +0 -43
  180. package/lib/es2015/ensure-dir.js.map +0 -1
  181. package/lib/es2015/ensure-file-sync.js +0 -42
  182. package/lib/es2015/ensure-file-sync.js.map +0 -1
  183. package/lib/es2015/ensure-file.js +0 -54
  184. package/lib/es2015/ensure-file.js.map +0 -1
  185. package/lib/es2015/find-all-dirnames.js +0 -82
  186. package/lib/es2015/find-all-dirnames.js.map +0 -1
  187. package/lib/es2015/find-all-filenames.js +0 -71
  188. package/lib/es2015/find-all-filenames.js.map +0 -1
  189. package/lib/es2015/find-up-package-filename-sync.js +0 -42
  190. package/lib/es2015/find-up-package-filename-sync.js.map +0 -1
  191. package/lib/es2015/find-up-package-filename.js +0 -53
  192. package/lib/es2015/find-up-package-filename.js.map +0 -1
  193. package/lib/es2015/get-long-extension.js +0 -41
  194. package/lib/es2015/get-long-extension.js.map +0 -1
  195. package/lib/es2015/get-short-basename.js +0 -33
  196. package/lib/es2015/get-short-basename.js.map +0 -1
  197. package/lib/es2015/index.d.ts +0 -47
  198. package/lib/es2015/index.js +0 -64
  199. package/lib/es2015/index.js.map +0 -1
  200. package/lib/es2015/is-directory-sync.js +0 -33
  201. package/lib/es2015/is-directory-sync.js.map +0 -1
  202. package/lib/es2015/is-directory.js +0 -44
  203. package/lib/es2015/is-directory.js.map +0 -1
  204. package/lib/es2015/is-file-sync.js +0 -33
  205. package/lib/es2015/is-file-sync.js.map +0 -1
  206. package/lib/es2015/is-file.js +0 -44
  207. package/lib/es2015/is-file.js.map +0 -1
  208. package/lib/es2015/is-readable.js +0 -50
  209. package/lib/es2015/is-readable.js.map +0 -1
  210. package/lib/es2015/is-sub-path-of.js +0 -35
  211. package/lib/es2015/is-sub-path-of.js.map +0 -1
  212. package/lib/es2015/is-writable.js +0 -50
  213. package/lib/es2015/is-writable.js.map +0 -1
  214. package/lib/es2015/move-sync.js +0 -34
  215. package/lib/es2015/move-sync.js.map +0 -1
  216. package/lib/es2015/move.js +0 -45
  217. package/lib/es2015/move.js.map +0 -1
  218. package/lib/es2015/path-exists-sync.js +0 -38
  219. package/lib/es2015/path-exists-sync.js.map +0 -1
  220. package/lib/es2015/path-exists.js +0 -49
  221. package/lib/es2015/path-exists.js.map +0 -1
  222. package/lib/es2015/read-file-line-by-line-sync.js +0 -48
  223. package/lib/es2015/read-file-line-by-line-sync.js.map +0 -1
  224. package/lib/es2015/read-file-line-by-line.js +0 -37
  225. package/lib/es2015/read-file-line-by-line.js.map +0 -1
  226. package/lib/es2015/read-json-file-sync.js +0 -33
  227. package/lib/es2015/read-json-file-sync.js.map +0 -1
  228. package/lib/es2015/read-json-file.js +0 -44
  229. package/lib/es2015/read-json-file.js.map +0 -1
  230. package/lib/es2015/read-ndjson-file-sync.js +0 -11
  231. package/lib/es2015/read-ndjson-file-sync.js.map +0 -1
  232. package/lib/es2015/read-ndjson-file.js +0 -11
  233. package/lib/es2015/read-ndjson-file.js.map +0 -1
  234. package/lib/es2015/read-yaml-file-sync.js +0 -35
  235. package/lib/es2015/read-yaml-file-sync.js.map +0 -1
  236. package/lib/es2015/read-yaml-file.js +0 -46
  237. package/lib/es2015/read-yaml-file.js.map +0 -1
  238. package/lib/es2015/remove-sync.js +0 -32
  239. package/lib/es2015/remove-sync.js.map +0 -1
  240. package/lib/es2015/remove.js +0 -43
  241. package/lib/es2015/remove.js.map +0 -1
  242. package/lib/es2015/write-iterable-to-file.js +0 -48
  243. package/lib/es2015/write-iterable-to-file.js.map +0 -1
  244. package/lib/es2015/write-json-file-sync.js +0 -33
  245. package/lib/es2015/write-json-file-sync.js.map +0 -1
  246. package/lib/es2015/write-json-file.js +0 -44
  247. package/lib/es2015/write-json-file.js.map +0 -1
  248. package/lib/es2015/write-yaml-file-sync.js +0 -34
  249. package/lib/es2015/write-yaml-file-sync.js.map +0 -1
  250. package/lib/es2015/write-yaml-file.js +0 -45
  251. package/lib/es2015/write-yaml-file.js.map +0 -1
  252. package/lib/es2018/checksum-file.d.ts +0 -1
  253. package/lib/es2018/checksum-file.js +0 -39
  254. package/lib/es2018/checksum-file.js.map +0 -1
  255. package/lib/es2018/copy-sync.d.ts +0 -1
  256. package/lib/es2018/copy-sync.js +0 -34
  257. package/lib/es2018/copy-sync.js.map +0 -1
  258. package/lib/es2018/copy.d.ts +0 -1
  259. package/lib/es2018/copy.js +0 -34
  260. package/lib/es2018/copy.js.map +0 -1
  261. package/lib/es2018/create-temp-dir-sync.d.ts +0 -1
  262. package/lib/es2018/create-temp-dir-sync.js +0 -12
  263. package/lib/es2018/create-temp-dir-sync.js.map +0 -1
  264. package/lib/es2018/create-temp-dir.d.ts +0 -1
  265. package/lib/es2018/create-temp-dir.js +0 -12
  266. package/lib/es2018/create-temp-dir.js.map +0 -1
  267. package/lib/es2018/create-temp-file-sync.d.ts +0 -1
  268. package/lib/es2018/create-temp-file-sync.js +0 -12
  269. package/lib/es2018/create-temp-file-sync.js.map +0 -1
  270. package/lib/es2018/create-temp-file.d.ts +0 -1
  271. package/lib/es2018/create-temp-file.js +0 -12
  272. package/lib/es2018/create-temp-file.js.map +0 -1
  273. package/lib/es2018/create-temp-name-sync.d.ts +0 -1
  274. package/lib/es2018/create-temp-name-sync.js +0 -9
  275. package/lib/es2018/create-temp-name-sync.js.map +0 -1
  276. package/lib/es2018/create-temp-name.d.ts +0 -1
  277. package/lib/es2018/create-temp-name.js +0 -9
  278. package/lib/es2018/create-temp-name.js.map +0 -1
  279. package/lib/es2018/empty-dir-sync.d.ts +0 -1
  280. package/lib/es2018/empty-dir-sync.js +0 -35
  281. package/lib/es2018/empty-dir-sync.js.map +0 -1
  282. package/lib/es2018/empty-dir.d.ts +0 -1
  283. package/lib/es2018/empty-dir.js +0 -36
  284. package/lib/es2018/empty-dir.js.map +0 -1
  285. package/lib/es2018/ensure-dir-sync.d.ts +0 -1
  286. package/lib/es2018/ensure-dir-sync.js +0 -32
  287. package/lib/es2018/ensure-dir-sync.js.map +0 -1
  288. package/lib/es2018/ensure-dir.d.ts +0 -1
  289. package/lib/es2018/ensure-dir.js +0 -32
  290. package/lib/es2018/ensure-dir.js.map +0 -1
  291. package/lib/es2018/ensure-file-sync.d.ts +0 -1
  292. package/lib/es2018/ensure-file-sync.js +0 -42
  293. package/lib/es2018/ensure-file-sync.js.map +0 -1
  294. package/lib/es2018/ensure-file.d.ts +0 -1
  295. package/lib/es2018/ensure-file.js +0 -43
  296. package/lib/es2018/ensure-file.js.map +0 -1
  297. package/lib/es2018/find-all-dirnames.d.ts +0 -1
  298. package/lib/es2018/find-all-dirnames.js +0 -45
  299. package/lib/es2018/find-all-dirnames.js.map +0 -1
  300. package/lib/es2018/find-all-filenames.d.ts +0 -1
  301. package/lib/es2018/find-all-filenames.js +0 -45
  302. package/lib/es2018/find-all-filenames.js.map +0 -1
  303. package/lib/es2018/find-up-package-filename-sync.d.ts +0 -1
  304. package/lib/es2018/find-up-package-filename-sync.js +0 -42
  305. package/lib/es2018/find-up-package-filename-sync.js.map +0 -1
  306. package/lib/es2018/find-up-package-filename.d.ts +0 -1
  307. package/lib/es2018/find-up-package-filename.js +0 -42
  308. package/lib/es2018/find-up-package-filename.js.map +0 -1
  309. package/lib/es2018/get-long-extension.d.ts +0 -1
  310. package/lib/es2018/get-long-extension.js +0 -41
  311. package/lib/es2018/get-long-extension.js.map +0 -1
  312. package/lib/es2018/get-short-basename.d.ts +0 -1
  313. package/lib/es2018/get-short-basename.js +0 -33
  314. package/lib/es2018/get-short-basename.js.map +0 -1
  315. package/lib/es2018/index.d.ts +0 -47
  316. package/lib/es2018/index.js +0 -64
  317. package/lib/es2018/index.js.map +0 -1
  318. package/lib/es2018/is-directory-sync.d.ts +0 -1
  319. package/lib/es2018/is-directory-sync.js +0 -33
  320. package/lib/es2018/is-directory-sync.js.map +0 -1
  321. package/lib/es2018/is-directory.d.ts +0 -1
  322. package/lib/es2018/is-directory.js +0 -33
  323. package/lib/es2018/is-directory.js.map +0 -1
  324. package/lib/es2018/is-file-sync.d.ts +0 -1
  325. package/lib/es2018/is-file-sync.js +0 -33
  326. package/lib/es2018/is-file-sync.js.map +0 -1
  327. package/lib/es2018/is-file.d.ts +0 -1
  328. package/lib/es2018/is-file.js +0 -33
  329. package/lib/es2018/is-file.js.map +0 -1
  330. package/lib/es2018/is-readable.d.ts +0 -1
  331. package/lib/es2018/is-readable.js +0 -39
  332. package/lib/es2018/is-readable.js.map +0 -1
  333. package/lib/es2018/is-sub-path-of.d.ts +0 -1
  334. package/lib/es2018/is-sub-path-of.js +0 -35
  335. package/lib/es2018/is-sub-path-of.js.map +0 -1
  336. package/lib/es2018/is-writable.d.ts +0 -1
  337. package/lib/es2018/is-writable.js +0 -39
  338. package/lib/es2018/is-writable.js.map +0 -1
  339. package/lib/es2018/move-sync.d.ts +0 -1
  340. package/lib/es2018/move-sync.js +0 -34
  341. package/lib/es2018/move-sync.js.map +0 -1
  342. package/lib/es2018/move.d.ts +0 -1
  343. package/lib/es2018/move.js +0 -34
  344. package/lib/es2018/move.js.map +0 -1
  345. package/lib/es2018/path-exists-sync.d.ts +0 -1
  346. package/lib/es2018/path-exists-sync.js +0 -38
  347. package/lib/es2018/path-exists-sync.js.map +0 -1
  348. package/lib/es2018/path-exists.d.ts +0 -1
  349. package/lib/es2018/path-exists.js +0 -38
  350. package/lib/es2018/path-exists.js.map +0 -1
  351. package/lib/es2018/read-file-line-by-line-sync.d.ts +0 -2
  352. package/lib/es2018/read-file-line-by-line-sync.js +0 -48
  353. package/lib/es2018/read-file-line-by-line-sync.js.map +0 -1
  354. package/lib/es2018/read-file-line-by-line.d.ts +0 -2
  355. package/lib/es2018/read-file-line-by-line.js +0 -37
  356. package/lib/es2018/read-file-line-by-line.js.map +0 -1
  357. package/lib/es2018/read-json-file-sync.d.ts +0 -2
  358. package/lib/es2018/read-json-file-sync.js +0 -33
  359. package/lib/es2018/read-json-file-sync.js.map +0 -1
  360. package/lib/es2018/read-json-file.d.ts +0 -2
  361. package/lib/es2018/read-json-file.js +0 -33
  362. package/lib/es2018/read-json-file.js.map +0 -1
  363. package/lib/es2018/read-ndjson-file-sync.d.ts +0 -2
  364. package/lib/es2018/read-ndjson-file-sync.js +0 -11
  365. package/lib/es2018/read-ndjson-file-sync.js.map +0 -1
  366. package/lib/es2018/read-ndjson-file.d.ts +0 -2
  367. package/lib/es2018/read-ndjson-file.js +0 -11
  368. package/lib/es2018/read-ndjson-file.js.map +0 -1
  369. package/lib/es2018/read-yaml-file-sync.d.ts +0 -2
  370. package/lib/es2018/read-yaml-file-sync.js +0 -35
  371. package/lib/es2018/read-yaml-file-sync.js.map +0 -1
  372. package/lib/es2018/read-yaml-file.d.ts +0 -2
  373. package/lib/es2018/read-yaml-file.js +0 -35
  374. package/lib/es2018/read-yaml-file.js.map +0 -1
  375. package/lib/es2018/remove-sync.d.ts +0 -1
  376. package/lib/es2018/remove-sync.js +0 -32
  377. package/lib/es2018/remove-sync.js.map +0 -1
  378. package/lib/es2018/remove.d.ts +0 -1
  379. package/lib/es2018/remove.js +0 -32
  380. package/lib/es2018/remove.js.map +0 -1
  381. package/lib/es2018/write-iterable-to-file.d.ts +0 -1
  382. package/lib/es2018/write-iterable-to-file.js +0 -37
  383. package/lib/es2018/write-iterable-to-file.js.map +0 -1
  384. package/lib/es2018/write-json-file-sync.d.ts +0 -3
  385. package/lib/es2018/write-json-file-sync.js +0 -33
  386. package/lib/es2018/write-json-file-sync.js.map +0 -1
  387. package/lib/es2018/write-json-file.d.ts +0 -3
  388. package/lib/es2018/write-json-file.js +0 -33
  389. package/lib/es2018/write-json-file.js.map +0 -1
  390. package/lib/es2018/write-yaml-file-sync.d.ts +0 -1
  391. package/lib/es2018/write-yaml-file-sync.js +0 -34
  392. package/lib/es2018/write-yaml-file-sync.js.map +0 -1
  393. package/lib/es2018/write-yaml-file.d.ts +0 -1
  394. package/lib/es2018/write-yaml-file.js +0 -34
  395. package/lib/es2018/write-yaml-file.js.map +0 -1
  396. /package/lib/{es2015/checksum-file.d.ts → checksum-file.d.ts} +0 -0
  397. /package/lib/{es2015/copy-sync.d.ts → copy-sync.d.ts} +0 -0
  398. /package/lib/{es2015/copy.d.ts → copy.d.ts} +0 -0
  399. /package/lib/{es2015/create-temp-dir-sync.d.ts → create-temp-dir-sync.d.ts} +0 -0
  400. /package/lib/{es2015/create-temp-dir.d.ts → create-temp-dir.d.ts} +0 -0
  401. /package/lib/{es2015/create-temp-file-sync.d.ts → create-temp-file-sync.d.ts} +0 -0
  402. /package/lib/{es2015/create-temp-file.d.ts → create-temp-file.d.ts} +0 -0
  403. /package/lib/{es2015/create-temp-name-sync.d.ts → create-temp-name-sync.d.ts} +0 -0
  404. /package/lib/{es2015/create-temp-name.d.ts → create-temp-name.d.ts} +0 -0
  405. /package/lib/{es2015/empty-dir-sync.d.ts → empty-dir-sync.d.ts} +0 -0
  406. /package/lib/{es2015/empty-dir.d.ts → empty-dir.d.ts} +0 -0
  407. /package/lib/{es2015/ensure-dir-sync.d.ts → ensure-dir-sync.d.ts} +0 -0
  408. /package/lib/{es2015/ensure-dir.d.ts → ensure-dir.d.ts} +0 -0
  409. /package/lib/{es2015/ensure-file-sync.d.ts → ensure-file-sync.d.ts} +0 -0
  410. /package/lib/{es2015/ensure-file.d.ts → ensure-file.d.ts} +0 -0
  411. /package/lib/{es2015/find-all-dirnames.d.ts → find-all-dirnames.d.ts} +0 -0
  412. /package/lib/{es2015/find-all-filenames.d.ts → find-all-filenames.d.ts} +0 -0
  413. /package/lib/{es2015/find-up-package-filename-sync.d.ts → find-up-package-filename-sync.d.ts} +0 -0
  414. /package/lib/{es2015/find-up-package-filename.d.ts → find-up-package-filename.d.ts} +0 -0
  415. /package/lib/{es2015/get-long-extension.d.ts → get-long-extension.d.ts} +0 -0
  416. /package/lib/{es2015/get-short-basename.d.ts → get-short-basename.d.ts} +0 -0
  417. /package/lib/{es2015/is-directory-sync.d.ts → is-directory-sync.d.ts} +0 -0
  418. /package/lib/{es2015/is-directory.d.ts → is-directory.d.ts} +0 -0
  419. /package/lib/{es2015/is-file-sync.d.ts → is-file-sync.d.ts} +0 -0
  420. /package/lib/{es2015/is-file.d.ts → is-file.d.ts} +0 -0
  421. /package/lib/{es2015/is-readable.d.ts → is-readable.d.ts} +0 -0
  422. /package/lib/{es2015/is-sub-path-of.d.ts → is-sub-path-of.d.ts} +0 -0
  423. /package/lib/{es2015/is-writable.d.ts → is-writable.d.ts} +0 -0
  424. /package/lib/{es2015/move-sync.d.ts → move-sync.d.ts} +0 -0
  425. /package/lib/{es2015/move.d.ts → move.d.ts} +0 -0
  426. /package/lib/{es2015/path-exists-sync.d.ts → path-exists-sync.d.ts} +0 -0
  427. /package/lib/{es2015/path-exists.d.ts → path-exists.d.ts} +0 -0
  428. /package/lib/{es2015/remove-sync.d.ts → remove-sync.d.ts} +0 -0
  429. /package/lib/{es2015/remove.d.ts → remove.d.ts} +0 -0
  430. /package/lib/{es2015/write-iterable-to-file.d.ts → write-iterable-to-file.d.ts} +0 -0
  431. /package/lib/{es2015/write-json-file-sync.d.ts → write-json-file-sync.d.ts} +0 -0
  432. /package/lib/{es2015/write-json-file.d.ts → write-json-file.d.ts} +0 -0
  433. /package/lib/{es2015/write-yaml-file-sync.d.ts → write-yaml-file-sync.d.ts} +0 -0
  434. /package/lib/{es2015/write-yaml-file.d.ts → write-yaml-file.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-file-line-by-line-sync.js","sourceRoot":"","sources":["../src/read-file-line-by-line-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,MAAM,SAAS,CAAC,CAAC,sBAAsB,CACrC,QAAgB,EAChB,WAA2B,OAAO;IAElC,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;IACrC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,CAAA;IAC5B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IAEvC,IAAI,SAAiB,CAAA;IACrB,IAAI,aAAa,GAAG,EAAE,CAAA;IACtB,OAAO,CAAC,SAAS,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE;QACvE,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;QACnD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAChC,KAAK,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACnC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,KAAK,CAAC,KAAK,EAAG,CAAA;SACrB;QACD,aAAa,GAAG,KAAK,CAAC,KAAK,EAAG,CAAA;KAC/B;IACD,IAAI,aAAa;QAAE,MAAM,aAAa,CAAA;IAEtC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;AAClB,CAAC"}
@@ -1,2 +1,2 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  export declare function readFileLineByLine(filename: string, encoding?: BufferEncoding): AsyncIterable<string>;
@@ -0,0 +1,10 @@
1
+ import fs from 'fs';
2
+ import readline from 'readline';
3
+ export function readFileLineByLine(filename, encoding = 'utf-8') {
4
+ const fileStream = fs.createReadStream(filename, { encoding });
5
+ return readline.createInterface({
6
+ input: fileStream,
7
+ crlfDelay: Infinity
8
+ });
9
+ }
10
+ //# sourceMappingURL=read-file-line-by-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-file-line-by-line.js","sourceRoot":"","sources":["../src/read-file-line-by-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAA;AAE/B,MAAM,UAAU,kBAAkB,CAChC,QAAgB,EAChB,WAA2B,OAAO;IAElC,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAA;IAE9D,OAAO,QAAQ,CAAC,eAAe,CAAC;QAC9B,KAAK,EAAE,UAAU;QACjB,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAA;AACJ,CAAC"}
@@ -1,2 +1,2 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  export declare function readJSONFileSync<T>(filename: string, encoding?: BufferEncoding): T;
@@ -0,0 +1,6 @@
1
+ import fs from 'fs';
2
+ export function readJSONFileSync(filename, encoding = 'utf-8') {
3
+ const text = fs.readFileSync(filename, encoding);
4
+ return JSON.parse(text);
5
+ }
6
+ //# sourceMappingURL=read-json-file-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-json-file-sync.js","sourceRoot":"","sources":["../src/read-json-file-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,WAA2B,OAAO;IAElC,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAChD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
@@ -1,2 +1,2 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  export declare function readJSONFile<T>(filename: string, encoding?: BufferEncoding): Promise<T>;
@@ -0,0 +1,6 @@
1
+ import fs from 'fs/promises';
2
+ export async function readJSONFile(filename, encoding = 'utf-8') {
3
+ const text = await fs.readFile(filename, encoding);
4
+ return JSON.parse(text);
5
+ }
6
+ //# sourceMappingURL=read-json-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-json-file.js","sourceRoot":"","sources":["../src/read-json-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAA;AAE5B,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,QAAgB,EAChB,WAA2B,OAAO;IAElC,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAClD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
@@ -1,2 +1,2 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  export declare function readNDJSONFileSync<T>(filename: string, encoding?: BufferEncoding): IterableIterator<T>;
@@ -0,0 +1,7 @@
1
+ import { filter, map } from 'iterable-operator';
2
+ import { readFileLineByLineSync } from './read-file-line-by-line-sync.js';
3
+ import { pipe } from 'extra-utils';
4
+ export function readNDJSONFileSync(filename, encoding = 'utf-8') {
5
+ return pipe(readFileLineByLineSync(filename, encoding), iter => filter(iter, line => line.trim() !== ''), iter => map(iter, line => JSON.parse(line)));
6
+ }
7
+ //# sourceMappingURL=read-ndjson-file-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-ndjson-file-sync.js","sourceRoot":"","sources":["../src/read-ndjson-file-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,MAAM,UAAU,kBAAkB,CAChC,QAAgB,EAChB,WAA2B,OAAO;IAElC,OAAO,IAAI,CACT,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAC1C,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAChD,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAC5C,CAAA;AACH,CAAC"}
@@ -1,2 +1,2 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  export declare function readNDJSONFile<T>(filename: string, encoding?: BufferEncoding): AsyncIterableIterator<T>;
@@ -0,0 +1,7 @@
1
+ import { filterAsync, mapAsync } from 'iterable-operator';
2
+ import { readFileLineByLine } from './read-file-line-by-line.js';
3
+ import { pipe } from 'extra-utils';
4
+ export function readNDJSONFile(filename, encoding = 'utf-8') {
5
+ return pipe(readFileLineByLine(filename, encoding), iter => filterAsync(iter, line => line.trim() !== ''), iter => mapAsync(iter, line => JSON.parse(line)));
6
+ }
7
+ //# sourceMappingURL=read-ndjson-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-ndjson-file.js","sourceRoot":"","sources":["../src/read-ndjson-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,MAAM,UAAU,cAAc,CAC5B,QAAgB,EAChB,WAA2B,OAAO;IAElC,OAAO,IAAI,CACT,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACtC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACrD,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CACjD,CAAA;AACH,CAAC"}
@@ -1,2 +1,2 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  export declare function readYAMLFileSync<T>(filename: string, encoding?: BufferEncoding): T;
@@ -0,0 +1,8 @@
1
+ import fs from 'fs';
2
+ import YAML from 'js-yaml';
3
+ export function readYAMLFileSync(filename, encoding = 'utf-8') {
4
+ const text = fs.readFileSync(filename, encoding);
5
+ const data = YAML.load(text);
6
+ return data;
7
+ }
8
+ //# sourceMappingURL=read-yaml-file-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-yaml-file-sync.js","sourceRoot":"","sources":["../src/read-yaml-file-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,WAA2B,OAAO;IAElC,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAChD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,OAAO,IAAS,CAAA;AAClB,CAAC"}
@@ -1,2 +1,2 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  export declare function readYAMLFile<T>(filename: string, encoding?: BufferEncoding): Promise<T>;
@@ -0,0 +1,8 @@
1
+ import fs from 'fs/promises';
2
+ import YAML from 'js-yaml';
3
+ export async function readYAMLFile(filename, encoding = 'utf-8') {
4
+ const text = await fs.readFile(filename, encoding);
5
+ const data = YAML.load(text);
6
+ return data;
7
+ }
8
+ //# sourceMappingURL=read-yaml-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-yaml-file.js","sourceRoot":"","sources":["../src/read-yaml-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAA;AAC5B,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,QAAgB,EAChB,WAA2B,OAAO;IAElC,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAClD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,OAAO,IAAS,CAAA;AAClB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import fs from 'fs';
2
+ export function removeSync(path) {
3
+ fs.rmSync(path, { recursive: true, force: true });
4
+ }
5
+ //# sourceMappingURL=remove-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-sync.js","sourceRoot":"","sources":["../src/remove-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;AACnD,CAAC"}
package/lib/remove.js ADDED
@@ -0,0 +1,5 @@
1
+ import fs from 'fs/promises';
2
+ export async function remove(path) {
3
+ await fs.rm(path, { recursive: true, force: true });
4
+ }
5
+ //# sourceMappingURL=remove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.js","sourceRoot":"","sources":["../src/remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAA;AAE5B,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAY;IACvC,MAAM,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;AACrD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import fs from 'fs';
2
+ import stream from 'stream';
3
+ import { pipeline } from 'stream/promises';
4
+ export async function writeIterableToFile(filename, iterable) {
5
+ const readStream = stream.Readable.from(iterable);
6
+ const writeStream = fs.createWriteStream(filename);
7
+ await pipeline(readStream, writeStream);
8
+ }
9
+ //# sourceMappingURL=write-iterable-to-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-iterable-to-file.js","sourceRoot":"","sources":["../src/write-iterable-to-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,QAAgB,EAChB,QAAkD;IAElD,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACjD,MAAM,WAAW,GAAG,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IAClD,MAAM,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;AACzC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import fs from 'fs';
2
+ export function writeJSONFileSync(filename, data, options = {}) {
3
+ const text = JSON.stringify(data, undefined, options.spaces);
4
+ fs.writeFileSync(filename, text, 'utf-8');
5
+ }
6
+ //# sourceMappingURL=write-json-file-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-json-file-sync.js","sourceRoot":"","sources":["../src/write-json-file-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,MAAM,UAAU,iBAAiB,CAC/B,QAAgB,EAChB,IAAa,EACb,UAA+B,EAAE;IAEjC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IAC5D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AAC3C,CAAC"}
@@ -0,0 +1,6 @@
1
+ import fs from 'fs/promises';
2
+ export async function writeJSONFile(filename, data, options = {}) {
3
+ const text = JSON.stringify(data, undefined, options.spaces);
4
+ await fs.writeFile(filename, text, 'utf-8');
5
+ }
6
+ //# sourceMappingURL=write-json-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-json-file.js","sourceRoot":"","sources":["../src/write-json-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAA;AAE5B,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,IAAa,EACb,UAA+B,EAAE;IAEjC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IAC5D,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AAC7C,CAAC"}
@@ -0,0 +1,7 @@
1
+ import fs from 'fs';
2
+ import YAML from 'js-yaml';
3
+ export function writeYAMLFileSync(filename, data) {
4
+ const text = YAML.dump(data);
5
+ fs.writeFileSync(filename, text, 'utf-8');
6
+ }
7
+ //# sourceMappingURL=write-yaml-file-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-yaml-file-sync.js","sourceRoot":"","sources":["../src/write-yaml-file-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,MAAM,UAAU,iBAAiB,CAAC,QAAgB,EAAE,IAAa;IAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AAC3C,CAAC"}
@@ -0,0 +1,7 @@
1
+ import fs from 'fs/promises';
2
+ import YAML from 'js-yaml';
3
+ export async function writeYAMLFile(filename, data) {
4
+ const text = YAML.dump(data);
5
+ await fs.writeFile(filename, text, 'utf-8');
6
+ }
7
+ //# sourceMappingURL=write-yaml-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-yaml-file.js","sourceRoot":"","sources":["../src/write-yaml-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAA;AAC5B,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAgB,EAAE,IAAa;IACjE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AAC7C,CAAC"}
package/package.json CHANGED
@@ -1,69 +1,70 @@
1
1
  {
2
2
  "name": "extra-filesystem",
3
- "version": "0.4.10",
3
+ "version": "0.5.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "files": [
7
- "lib"
7
+ "lib",
8
+ "src"
8
9
  ],
9
- "main": "lib/es2018/index.js",
10
- "types": "lib/es2018/index.d.ts",
10
+ "type": "module",
11
+ "main": "lib/index.js",
12
+ "types": "lib/index.d.ts",
11
13
  "repository": "git@github.com:BlackGlory/extra-filesystem.git",
12
14
  "author": "BlackGlory <woshenmedoubuzhidao@blackglory.me>",
13
15
  "license": "MIT",
14
16
  "sideEffects": false,
15
17
  "engines": {
16
- "node": ">=14"
18
+ "node": ">=16"
17
19
  },
18
20
  "scripts": {
19
- "lint": "eslint --ext .js,.jsx,.ts,.tsx --quiet src",
20
- "test": "jest --runInBand --config jest.config.js",
21
- "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
22
- "test:coverage": "jest --runInBand --coverage --config jest.config.js",
23
- "prepublishOnly": "run-s clean build",
21
+ "prepare": "ts-patch install -s",
22
+ "lint": "eslint --ext .js,.jsx,.ts,.tsx --quiet src __tests__",
23
+ "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --runInBand --config jest.config.cjs",
24
+ "test:debug": "cross-env NODE_OPTIONS=--experimental-vm-modules node --inspect-brk node_modules/.bin/jest --runInBand --config jest.config.cjs",
25
+ "test:coverage": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage --config jest.config.cjs",
26
+ "prepublishOnly": "run-s prepare clean build",
24
27
  "clean": "rimraf lib",
25
- "build": "run-p build:*",
26
- "build:es2015": "run-s build:es2015:*",
27
- "build:es2015:compile": "tsc --project tsconfig.build.json --target es2015 --outDir lib/es2015",
28
- "build:es2015:patch": "tscpaths -p tsconfig.build.json -s ./src -o ./lib/es2015",
29
- "build:es2018": "run-s build:es2018:*",
30
- "build:es2018:compile": "tsc --project tsconfig.build.json --target es2018 --outDir lib/es2018",
31
- "build:es2018:patch": "tscpaths -p tsconfig.build.json -s ./src -o ./lib/es2018",
28
+ "build": "tsc --project tsconfig.build.json",
32
29
  "release": "standard-version"
33
30
  },
34
31
  "husky": {
35
32
  "hooks": {
36
- "pre-commit": "run-s lint build test",
33
+ "pre-commit": "run-s prepare lint build test",
37
34
  "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
38
35
  }
39
36
  },
40
37
  "devDependencies": {
41
- "@commitlint/cli": "^17.3.0",
42
- "@commitlint/config-conventional": "^17.3.0",
43
- "@types/fs-extra": "^9.0.13",
44
- "@types/jest": "^29.2.4",
38
+ "@blackglory/jest-resolver": "^0.3.0",
39
+ "@commitlint/cli": "^17.5.0",
40
+ "@commitlint/config-conventional": "^17.4.4",
41
+ "@types/fs-extra": "^11.0.1",
42
+ "@types/jest": "^29.5.0",
45
43
  "@types/js-yaml": "^4.0.5",
46
- "@types/node": "14",
44
+ "@types/node": "16",
47
45
  "@types/tmp": "^0.2.3",
48
- "@typescript-eslint/eslint-plugin": "^5.46.1",
49
- "@typescript-eslint/parser": "^5.46.1",
50
- "eslint": "^8.30.0",
46
+ "@typescript-eslint/eslint-plugin": "^5.56.0",
47
+ "@typescript-eslint/parser": "^5.56.0",
48
+ "cross-env": "^7.0.3",
49
+ "eslint": "^8.36.0",
51
50
  "husky": "^4.3.0",
52
- "jest": "^29.3.1",
51
+ "jest": "^29.5.0",
52
+ "jest-resolve": "^29.5.0",
53
53
  "npm-run-all": "^4.1.5",
54
- "return-style": "^1.0.0",
54
+ "return-style": "^3.0.0",
55
55
  "rimraf": "^3.0.2",
56
56
  "standard-version": "^9.5.0",
57
- "ts-jest": "^29.0.3",
58
- "tscpaths": "^0.0.9",
59
- "typescript": "^4.9.4"
57
+ "ts-jest": "^29.0.5",
58
+ "ts-patch": "^2.1.0",
59
+ "typescript": "4.8",
60
+ "typescript-transform-paths": "^3.4.6"
60
61
  },
61
62
  "dependencies": {
62
- "@blackglory/prelude": "^0.1.10",
63
- "extra-promise": "^4.4.0",
64
- "extra-utils": "^3.7.0",
65
- "fs-extra": "^10.1.0",
66
- "iterable-operator": "^2.5.0",
63
+ "@blackglory/prelude": "^0.3.1",
64
+ "extra-promise": "^6.0.5",
65
+ "extra-utils": "^5.1.1",
66
+ "fs-extra": "^11.1.1",
67
+ "iterable-operator": "^4.0.5",
67
68
  "js-yaml": "^4.1.0",
68
69
  "tmp-promise": "^3.0.3"
69
70
  }
@@ -0,0 +1,14 @@
1
+ import crypto from 'crypto'
2
+ import fs from 'fs'
3
+
4
+ export async function checksumFile(
5
+ algorithm: string
6
+ , filename: string
7
+ ): Promise<string> {
8
+ const hash = crypto.createHash(algorithm)
9
+ const stream = fs.createReadStream(filename)
10
+ for await (const chunk of stream) {
11
+ hash.update(chunk)
12
+ }
13
+ return hash.digest('hex')
14
+ }
@@ -0,0 +1,7 @@
1
+ import fs from 'fs-extra'
2
+
3
+ export function copySync(sourcePath: string, destinationPath: string): void {
4
+ fs.copySync(sourcePath, destinationPath, {
5
+ overwrite: true
6
+ })
7
+ }
package/src/copy.ts ADDED
@@ -0,0 +1,10 @@
1
+ import fs from 'fs-extra'
2
+
3
+ export async function copy(
4
+ sourcePath: string
5
+ , destinationPath: string
6
+ ): Promise<void> {
7
+ await fs.copy(sourcePath, destinationPath, {
8
+ overwrite: true
9
+ })
10
+ }
@@ -0,0 +1,8 @@
1
+ import { ensureDirSync } from './ensure-dir-sync.js'
2
+ import { createTempNameSync } from './create-temp-name-sync.js'
3
+
4
+ export function createTempDirSync(): string {
5
+ const dirname = createTempNameSync()
6
+ ensureDirSync(dirname)
7
+ return dirname
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ensureDir } from './ensure-dir.js'
2
+ import { createTempName } from './create-temp-name.js'
3
+
4
+ export async function createTempDir(): Promise<string> {
5
+ const dirname = await createTempName()
6
+ await ensureDir(dirname)
7
+ return dirname
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ensureFileSync } from './ensure-file-sync.js'
2
+ import { createTempNameSync } from './create-temp-name-sync.js'
3
+
4
+ export function createTempFileSync(): string {
5
+ const filename = createTempNameSync()
6
+ ensureFileSync(filename)
7
+ return filename
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ensureFile } from './ensure-file.js'
2
+ import { createTempName } from './create-temp-name.js'
3
+
4
+ export async function createTempFile(): Promise<string> {
5
+ const filename = await createTempName()
6
+ await ensureFile(filename)
7
+ return filename
8
+ }
@@ -0,0 +1,5 @@
1
+ import { tmpNameSync } from 'tmp-promise'
2
+
3
+ export function createTempNameSync(): string {
4
+ return tmpNameSync()
5
+ }
@@ -0,0 +1,5 @@
1
+ import { tmpName } from 'tmp-promise'
2
+
3
+ export async function createTempName(): Promise<string> {
4
+ return await tmpName()
5
+ }
@@ -0,0 +1,8 @@
1
+ import fs from 'fs'
2
+ import { removeSync } from './remove-sync.js'
3
+ import path from 'path'
4
+
5
+ export function emptyDirSync(dirname: string): void {
6
+ const names = fs.readdirSync(dirname)
7
+ names.forEach(name => removeSync(path.join(dirname, name)))
8
+ }
@@ -0,0 +1,9 @@
1
+ import fs from 'fs/promises'
2
+ import { remove } from './remove.js'
3
+ import { each } from 'extra-promise'
4
+ import path from 'path'
5
+
6
+ export async function emptyDir(dirname: string): Promise<void> {
7
+ const names = await fs.readdir(dirname)
8
+ await each(names, name => remove(path.join(dirname, name)))
9
+ }
@@ -0,0 +1,5 @@
1
+ import fs from 'fs'
2
+
3
+ export function ensureDirSync(dirname: string): void {
4
+ fs.mkdirSync(dirname, { recursive: true })
5
+ }
@@ -0,0 +1,5 @@
1
+ import fs from 'fs/promises'
2
+
3
+ export async function ensureDir(dirname: string): Promise<void> {
4
+ await fs.mkdir(dirname, { recursive: true })
5
+ }
@@ -0,0 +1,14 @@
1
+ import { ensureDirSync } from './ensure-dir-sync.js'
2
+ import path from 'path'
3
+ import fs from 'fs'
4
+ import { pass } from '@blackglory/prelude'
5
+
6
+ export function ensureFileSync(filename: string): void {
7
+ const dir = path.dirname(filename)
8
+ ensureDirSync(dir)
9
+ try {
10
+ fs.closeSync(fs.openSync(filename, 'wx'))
11
+ } catch {
12
+ pass()
13
+ }
14
+ }
@@ -0,0 +1,15 @@
1
+ import { ensureDir } from './ensure-dir.js'
2
+ import path from 'path'
3
+ import fs from 'fs/promises'
4
+ import { pass } from '@blackglory/prelude'
5
+
6
+ export async function ensureFile(filename: string): Promise<void> {
7
+ const dir = path.dirname(filename)
8
+ await ensureDir(dir)
9
+ try {
10
+ const handle = await fs.open(filename, 'wx')
11
+ await handle.close()
12
+ } catch {
13
+ pass()
14
+ }
15
+ }
@@ -0,0 +1,22 @@
1
+ import fs from 'fs/promises'
2
+ import path from 'path'
3
+
4
+ export async function* findAllDirnames(
5
+ dirname: string
6
+ , predicate: (dirname: string) => boolean = _ => true
7
+ ): AsyncIterableIterator<string> {
8
+ const subDirnames = await getSubDirnames(dirname)
9
+ for (const dirname of subDirnames) {
10
+ if (predicate(dirname)) {
11
+ yield dirname
12
+ yield* findAllDirnames(dirname, predicate)
13
+ }
14
+ }
15
+ }
16
+
17
+ async function getSubDirnames(dirname: string): Promise<string[]> {
18
+ const dirents = await fs.readdir(dirname, { withFileTypes: true })
19
+ return dirents
20
+ .filter(x => x.isDirectory())
21
+ .map(x => path.join(dirname, x.name))
22
+ }
@@ -0,0 +1,20 @@
1
+ import fs from 'fs/promises'
2
+ import path from 'path'
3
+
4
+ export async function* findAllFilenames(
5
+ dirname: string
6
+ , predicate: (dirname: string) => boolean = _ => true
7
+ ): AsyncIterableIterator<string> {
8
+ const dirents = await fs.readdir(dirname, { withFileTypes: true })
9
+ for (const dirent of dirents) {
10
+ if (dirent.isDirectory()) {
11
+ const subDirname = path.join(dirname, dirent.name)
12
+ if (predicate(subDirname)) {
13
+ yield* findAllFilenames(subDirname, predicate)
14
+ }
15
+ } else {
16
+ const filename = path.join(dirname, dirent.name)
17
+ yield filename
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,14 @@
1
+ import path from 'path'
2
+ import { pathExistsSync } from './path-exists-sync.js'
3
+
4
+ export function findUpPackageFilenameSync(pathname: string): string | undefined {
5
+ pathname = path.resolve(pathname)
6
+ while (true) {
7
+ const filename = path.resolve(pathname, 'package.json')
8
+ if (pathExistsSync(filename)) return filename
9
+
10
+ const newpathname = path.resolve(pathname, '..')
11
+ if (newpathname === pathname) return
12
+ pathname = newpathname
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ import path from 'path'
2
+ import { pathExists } from './path-exists.js'
3
+
4
+ export async function findUpPackageFilename(pathname: string): Promise<string | undefined> {
5
+ pathname = path.resolve(pathname)
6
+ while (true) {
7
+ const filename = path.resolve(pathname, 'package.json')
8
+ if (await pathExists(filename)) return filename
9
+
10
+ const newpathname = path.resolve(pathname, '..')
11
+ if (newpathname === pathname) return
12
+ pathname = newpathname
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ import path from 'path'
2
+
3
+ export function getLongExtension(filename: string): string {
4
+ let result = ''
5
+ let remainder = filename
6
+ while (true) {
7
+ const extension = path.extname(remainder)
8
+ if (!extension) break
9
+ remainder = path.basename(remainder, extension)
10
+ result = extension + result
11
+ }
12
+ return result
13
+ }
@@ -0,0 +1,6 @@
1
+ import path from 'path'
2
+ import { getLongExtension } from './get-long-extension.js'
3
+
4
+ export function getShortBasename(filename: string): string {
5
+ return path.basename(filename, getLongExtension(filename))
6
+ }