@wecode-ai/weibo-openclaw-plugin 2.1.3 → 2.2.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 (355) hide show
  1. package/README.md +28 -1
  2. package/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
  3. package/node_modules/@isaacs/fs-minipass/README.md +71 -0
  4. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +118 -0
  5. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts.map +1 -0
  6. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
  7. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js.map +1 -0
  8. package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
  9. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +118 -0
  10. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts.map +1 -0
  11. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
  12. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js.map +1 -0
  13. package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
  14. package/node_modules/@isaacs/fs-minipass/package.json +72 -0
  15. package/node_modules/chownr/LICENSE.md +63 -0
  16. package/node_modules/chownr/README.md +3 -0
  17. package/node_modules/chownr/dist/commonjs/index.d.ts +3 -0
  18. package/node_modules/chownr/dist/commonjs/index.d.ts.map +1 -0
  19. package/node_modules/chownr/dist/commonjs/index.js +93 -0
  20. package/node_modules/chownr/dist/commonjs/index.js.map +1 -0
  21. package/node_modules/chownr/dist/commonjs/package.json +3 -0
  22. package/node_modules/chownr/dist/esm/index.d.ts +3 -0
  23. package/node_modules/chownr/dist/esm/index.d.ts.map +1 -0
  24. package/node_modules/chownr/dist/esm/index.js +85 -0
  25. package/node_modules/chownr/dist/esm/index.js.map +1 -0
  26. package/node_modules/chownr/dist/esm/package.json +3 -0
  27. package/node_modules/chownr/package.json +69 -0
  28. package/node_modules/minipass/LICENSE.md +55 -0
  29. package/node_modules/minipass/README.md +825 -0
  30. package/node_modules/minipass/dist/commonjs/index.d.ts +545 -0
  31. package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
  32. package/node_modules/minipass/dist/commonjs/index.js +1038 -0
  33. package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
  34. package/node_modules/minipass/dist/commonjs/package.json +3 -0
  35. package/node_modules/minipass/dist/esm/index.d.ts +545 -0
  36. package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
  37. package/node_modules/minipass/dist/esm/index.js +1020 -0
  38. package/node_modules/minipass/dist/esm/index.js.map +1 -0
  39. package/node_modules/minipass/dist/esm/package.json +3 -0
  40. package/node_modules/minipass/package.json +77 -0
  41. package/node_modules/minizlib/LICENSE +26 -0
  42. package/node_modules/minizlib/README.md +64 -0
  43. package/node_modules/minizlib/dist/commonjs/constants.d.ts +2 -0
  44. package/node_modules/minizlib/dist/commonjs/constants.d.ts.map +1 -0
  45. package/node_modules/minizlib/dist/commonjs/constants.js +123 -0
  46. package/node_modules/minizlib/dist/commonjs/constants.js.map +1 -0
  47. package/node_modules/minizlib/dist/commonjs/index.d.ts +99 -0
  48. package/node_modules/minizlib/dist/commonjs/index.d.ts.map +1 -0
  49. package/node_modules/minizlib/dist/commonjs/index.js +416 -0
  50. package/node_modules/minizlib/dist/commonjs/index.js.map +1 -0
  51. package/node_modules/minizlib/dist/commonjs/package.json +3 -0
  52. package/node_modules/minizlib/dist/esm/constants.d.ts +2 -0
  53. package/node_modules/minizlib/dist/esm/constants.d.ts.map +1 -0
  54. package/node_modules/minizlib/dist/esm/constants.js +117 -0
  55. package/node_modules/minizlib/dist/esm/constants.js.map +1 -0
  56. package/node_modules/minizlib/dist/esm/index.d.ts +99 -0
  57. package/node_modules/minizlib/dist/esm/index.d.ts.map +1 -0
  58. package/node_modules/minizlib/dist/esm/index.js +363 -0
  59. package/node_modules/minizlib/dist/esm/index.js.map +1 -0
  60. package/node_modules/minizlib/dist/esm/package.json +3 -0
  61. package/node_modules/minizlib/package.json +80 -0
  62. package/node_modules/tar/LICENSE.md +55 -0
  63. package/node_modules/tar/README.md +1224 -0
  64. package/node_modules/tar/dist/commonjs/create.d.ts +3 -0
  65. package/node_modules/tar/dist/commonjs/create.d.ts.map +1 -0
  66. package/node_modules/tar/dist/commonjs/create.js +82 -0
  67. package/node_modules/tar/dist/commonjs/create.js.map +1 -0
  68. package/node_modules/tar/dist/commonjs/cwd-error.d.ts +8 -0
  69. package/node_modules/tar/dist/commonjs/cwd-error.d.ts.map +1 -0
  70. package/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
  71. package/node_modules/tar/dist/commonjs/cwd-error.js.map +1 -0
  72. package/node_modules/tar/dist/commonjs/extract.d.ts +3 -0
  73. package/node_modules/tar/dist/commonjs/extract.d.ts.map +1 -0
  74. package/node_modules/tar/dist/commonjs/extract.js +88 -0
  75. package/node_modules/tar/dist/commonjs/extract.js.map +1 -0
  76. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +2 -0
  77. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts.map +1 -0
  78. package/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
  79. package/node_modules/tar/dist/commonjs/get-write-flag.js.map +1 -0
  80. package/node_modules/tar/dist/commonjs/header.d.ts +53 -0
  81. package/node_modules/tar/dist/commonjs/header.d.ts.map +1 -0
  82. package/node_modules/tar/dist/commonjs/header.js +312 -0
  83. package/node_modules/tar/dist/commonjs/header.js.map +1 -0
  84. package/node_modules/tar/dist/commonjs/index.d.ts +20 -0
  85. package/node_modules/tar/dist/commonjs/index.d.ts.map +1 -0
  86. package/node_modules/tar/dist/commonjs/index.js +64 -0
  87. package/node_modules/tar/dist/commonjs/index.js.map +1 -0
  88. package/node_modules/tar/dist/commonjs/index.min.js +4 -0
  89. package/node_modules/tar/dist/commonjs/index.min.js.map +7 -0
  90. package/node_modules/tar/dist/commonjs/large-numbers.d.ts +3 -0
  91. package/node_modules/tar/dist/commonjs/large-numbers.d.ts.map +1 -0
  92. package/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
  93. package/node_modules/tar/dist/commonjs/large-numbers.js.map +1 -0
  94. package/node_modules/tar/dist/commonjs/list.d.ts +7 -0
  95. package/node_modules/tar/dist/commonjs/list.d.ts.map +1 -0
  96. package/node_modules/tar/dist/commonjs/list.js +145 -0
  97. package/node_modules/tar/dist/commonjs/list.js.map +1 -0
  98. package/node_modules/tar/dist/commonjs/make-command.d.ts +49 -0
  99. package/node_modules/tar/dist/commonjs/make-command.d.ts.map +1 -0
  100. package/node_modules/tar/dist/commonjs/make-command.js +52 -0
  101. package/node_modules/tar/dist/commonjs/make-command.js.map +1 -0
  102. package/node_modules/tar/dist/commonjs/mkdir.d.ts +25 -0
  103. package/node_modules/tar/dist/commonjs/mkdir.d.ts.map +1 -0
  104. package/node_modules/tar/dist/commonjs/mkdir.js +187 -0
  105. package/node_modules/tar/dist/commonjs/mkdir.js.map +1 -0
  106. package/node_modules/tar/dist/commonjs/mode-fix.d.ts +2 -0
  107. package/node_modules/tar/dist/commonjs/mode-fix.d.ts.map +1 -0
  108. package/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
  109. package/node_modules/tar/dist/commonjs/mode-fix.js.map +1 -0
  110. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +2 -0
  111. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts.map +1 -0
  112. package/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
  113. package/node_modules/tar/dist/commonjs/normalize-unicode.js.map +1 -0
  114. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +2 -0
  115. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts.map +1 -0
  116. package/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
  117. package/node_modules/tar/dist/commonjs/normalize-windows-path.js.map +1 -0
  118. package/node_modules/tar/dist/commonjs/options.d.ts +596 -0
  119. package/node_modules/tar/dist/commonjs/options.d.ts.map +1 -0
  120. package/node_modules/tar/dist/commonjs/options.js +66 -0
  121. package/node_modules/tar/dist/commonjs/options.js.map +1 -0
  122. package/node_modules/tar/dist/commonjs/pack.d.ts +102 -0
  123. package/node_modules/tar/dist/commonjs/pack.d.ts.map +1 -0
  124. package/node_modules/tar/dist/commonjs/pack.js +511 -0
  125. package/node_modules/tar/dist/commonjs/pack.js.map +1 -0
  126. package/node_modules/tar/dist/commonjs/package.json +3 -0
  127. package/node_modules/tar/dist/commonjs/parse.d.ts +85 -0
  128. package/node_modules/tar/dist/commonjs/parse.d.ts.map +1 -0
  129. package/node_modules/tar/dist/commonjs/parse.js +610 -0
  130. package/node_modules/tar/dist/commonjs/parse.js.map +1 -0
  131. package/node_modules/tar/dist/commonjs/path-reservations.d.ts +11 -0
  132. package/node_modules/tar/dist/commonjs/path-reservations.d.ts.map +1 -0
  133. package/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
  134. package/node_modules/tar/dist/commonjs/path-reservations.js.map +1 -0
  135. package/node_modules/tar/dist/commonjs/pax.d.ts +26 -0
  136. package/node_modules/tar/dist/commonjs/pax.d.ts.map +1 -0
  137. package/node_modules/tar/dist/commonjs/pax.js +158 -0
  138. package/node_modules/tar/dist/commonjs/pax.js.map +1 -0
  139. package/node_modules/tar/dist/commonjs/process-umask.d.ts +2 -0
  140. package/node_modules/tar/dist/commonjs/process-umask.d.ts.map +1 -0
  141. package/node_modules/tar/dist/commonjs/process-umask.js +7 -0
  142. package/node_modules/tar/dist/commonjs/process-umask.js.map +1 -0
  143. package/node_modules/tar/dist/commonjs/read-entry.d.ts +36 -0
  144. package/node_modules/tar/dist/commonjs/read-entry.d.ts.map +1 -0
  145. package/node_modules/tar/dist/commonjs/read-entry.js +136 -0
  146. package/node_modules/tar/dist/commonjs/read-entry.js.map +1 -0
  147. package/node_modules/tar/dist/commonjs/replace.d.ts +2 -0
  148. package/node_modules/tar/dist/commonjs/replace.d.ts.map +1 -0
  149. package/node_modules/tar/dist/commonjs/replace.js +227 -0
  150. package/node_modules/tar/dist/commonjs/replace.js.map +1 -0
  151. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +2 -0
  152. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts.map +1 -0
  153. package/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
  154. package/node_modules/tar/dist/commonjs/strip-absolute-path.js.map +1 -0
  155. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +2 -0
  156. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts.map +1 -0
  157. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
  158. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js.map +1 -0
  159. package/node_modules/tar/dist/commonjs/symlink-error.d.ts +9 -0
  160. package/node_modules/tar/dist/commonjs/symlink-error.d.ts.map +1 -0
  161. package/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
  162. package/node_modules/tar/dist/commonjs/symlink-error.js.map +1 -0
  163. package/node_modules/tar/dist/commonjs/types.d.ts +7 -0
  164. package/node_modules/tar/dist/commonjs/types.d.ts.map +1 -0
  165. package/node_modules/tar/dist/commonjs/types.js +50 -0
  166. package/node_modules/tar/dist/commonjs/types.js.map +1 -0
  167. package/node_modules/tar/dist/commonjs/unpack.d.ts +101 -0
  168. package/node_modules/tar/dist/commonjs/unpack.d.ts.map +1 -0
  169. package/node_modules/tar/dist/commonjs/unpack.js +932 -0
  170. package/node_modules/tar/dist/commonjs/unpack.js.map +1 -0
  171. package/node_modules/tar/dist/commonjs/update.d.ts +2 -0
  172. package/node_modules/tar/dist/commonjs/update.d.ts.map +1 -0
  173. package/node_modules/tar/dist/commonjs/update.js +33 -0
  174. package/node_modules/tar/dist/commonjs/update.js.map +1 -0
  175. package/node_modules/tar/dist/commonjs/warn-method.d.ts +24 -0
  176. package/node_modules/tar/dist/commonjs/warn-method.d.ts.map +1 -0
  177. package/node_modules/tar/dist/commonjs/warn-method.js +31 -0
  178. package/node_modules/tar/dist/commonjs/warn-method.js.map +1 -0
  179. package/node_modules/tar/dist/commonjs/winchars.d.ts +3 -0
  180. package/node_modules/tar/dist/commonjs/winchars.d.ts.map +1 -0
  181. package/node_modules/tar/dist/commonjs/winchars.js +14 -0
  182. package/node_modules/tar/dist/commonjs/winchars.js.map +1 -0
  183. package/node_modules/tar/dist/commonjs/write-entry.d.ts +129 -0
  184. package/node_modules/tar/dist/commonjs/write-entry.d.ts.map +1 -0
  185. package/node_modules/tar/dist/commonjs/write-entry.js +698 -0
  186. package/node_modules/tar/dist/commonjs/write-entry.js.map +1 -0
  187. package/node_modules/tar/dist/esm/create.d.ts +3 -0
  188. package/node_modules/tar/dist/esm/create.d.ts.map +1 -0
  189. package/node_modules/tar/dist/esm/create.js +76 -0
  190. package/node_modules/tar/dist/esm/create.js.map +1 -0
  191. package/node_modules/tar/dist/esm/cwd-error.d.ts +8 -0
  192. package/node_modules/tar/dist/esm/cwd-error.d.ts.map +1 -0
  193. package/node_modules/tar/dist/esm/cwd-error.js +14 -0
  194. package/node_modules/tar/dist/esm/cwd-error.js.map +1 -0
  195. package/node_modules/tar/dist/esm/extract.d.ts +3 -0
  196. package/node_modules/tar/dist/esm/extract.d.ts.map +1 -0
  197. package/node_modules/tar/dist/esm/extract.js +49 -0
  198. package/node_modules/tar/dist/esm/extract.js.map +1 -0
  199. package/node_modules/tar/dist/esm/get-write-flag.d.ts +2 -0
  200. package/node_modules/tar/dist/esm/get-write-flag.d.ts.map +1 -0
  201. package/node_modules/tar/dist/esm/get-write-flag.js +26 -0
  202. package/node_modules/tar/dist/esm/get-write-flag.js.map +1 -0
  203. package/node_modules/tar/dist/esm/header.d.ts +53 -0
  204. package/node_modules/tar/dist/esm/header.d.ts.map +1 -0
  205. package/node_modules/tar/dist/esm/header.js +275 -0
  206. package/node_modules/tar/dist/esm/header.js.map +1 -0
  207. package/node_modules/tar/dist/esm/index.d.ts +20 -0
  208. package/node_modules/tar/dist/esm/index.d.ts.map +1 -0
  209. package/node_modules/tar/dist/esm/index.js +20 -0
  210. package/node_modules/tar/dist/esm/index.js.map +1 -0
  211. package/node_modules/tar/dist/esm/index.min.js +4 -0
  212. package/node_modules/tar/dist/esm/index.min.js.map +7 -0
  213. package/node_modules/tar/dist/esm/large-numbers.d.ts +3 -0
  214. package/node_modules/tar/dist/esm/large-numbers.d.ts.map +1 -0
  215. package/node_modules/tar/dist/esm/large-numbers.js +94 -0
  216. package/node_modules/tar/dist/esm/large-numbers.js.map +1 -0
  217. package/node_modules/tar/dist/esm/list.d.ts +7 -0
  218. package/node_modules/tar/dist/esm/list.d.ts.map +1 -0
  219. package/node_modules/tar/dist/esm/list.js +105 -0
  220. package/node_modules/tar/dist/esm/list.js.map +1 -0
  221. package/node_modules/tar/dist/esm/make-command.d.ts +49 -0
  222. package/node_modules/tar/dist/esm/make-command.d.ts.map +1 -0
  223. package/node_modules/tar/dist/esm/make-command.js +48 -0
  224. package/node_modules/tar/dist/esm/make-command.js.map +1 -0
  225. package/node_modules/tar/dist/esm/mkdir.d.ts +25 -0
  226. package/node_modules/tar/dist/esm/mkdir.d.ts.map +1 -0
  227. package/node_modules/tar/dist/esm/mkdir.js +179 -0
  228. package/node_modules/tar/dist/esm/mkdir.js.map +1 -0
  229. package/node_modules/tar/dist/esm/mode-fix.d.ts +2 -0
  230. package/node_modules/tar/dist/esm/mode-fix.d.ts.map +1 -0
  231. package/node_modules/tar/dist/esm/mode-fix.js +25 -0
  232. package/node_modules/tar/dist/esm/mode-fix.js.map +1 -0
  233. package/node_modules/tar/dist/esm/normalize-unicode.d.ts +2 -0
  234. package/node_modules/tar/dist/esm/normalize-unicode.d.ts.map +1 -0
  235. package/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
  236. package/node_modules/tar/dist/esm/normalize-unicode.js.map +1 -0
  237. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +2 -0
  238. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts.map +1 -0
  239. package/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
  240. package/node_modules/tar/dist/esm/normalize-windows-path.js.map +1 -0
  241. package/node_modules/tar/dist/esm/options.d.ts +596 -0
  242. package/node_modules/tar/dist/esm/options.d.ts.map +1 -0
  243. package/node_modules/tar/dist/esm/options.js +54 -0
  244. package/node_modules/tar/dist/esm/options.js.map +1 -0
  245. package/node_modules/tar/dist/esm/pack.d.ts +102 -0
  246. package/node_modules/tar/dist/esm/pack.d.ts.map +1 -0
  247. package/node_modules/tar/dist/esm/pack.js +469 -0
  248. package/node_modules/tar/dist/esm/pack.js.map +1 -0
  249. package/node_modules/tar/dist/esm/package.json +3 -0
  250. package/node_modules/tar/dist/esm/parse.d.ts +85 -0
  251. package/node_modules/tar/dist/esm/parse.d.ts.map +1 -0
  252. package/node_modules/tar/dist/esm/parse.js +606 -0
  253. package/node_modules/tar/dist/esm/parse.js.map +1 -0
  254. package/node_modules/tar/dist/esm/path-reservations.d.ts +11 -0
  255. package/node_modules/tar/dist/esm/path-reservations.d.ts.map +1 -0
  256. package/node_modules/tar/dist/esm/path-reservations.js +166 -0
  257. package/node_modules/tar/dist/esm/path-reservations.js.map +1 -0
  258. package/node_modules/tar/dist/esm/pax.d.ts +26 -0
  259. package/node_modules/tar/dist/esm/pax.d.ts.map +1 -0
  260. package/node_modules/tar/dist/esm/pax.js +154 -0
  261. package/node_modules/tar/dist/esm/pax.js.map +1 -0
  262. package/node_modules/tar/dist/esm/process-umask.d.ts +2 -0
  263. package/node_modules/tar/dist/esm/process-umask.d.ts.map +1 -0
  264. package/node_modules/tar/dist/esm/process-umask.js +3 -0
  265. package/node_modules/tar/dist/esm/process-umask.js.map +1 -0
  266. package/node_modules/tar/dist/esm/read-entry.d.ts +36 -0
  267. package/node_modules/tar/dist/esm/read-entry.d.ts.map +1 -0
  268. package/node_modules/tar/dist/esm/read-entry.js +132 -0
  269. package/node_modules/tar/dist/esm/read-entry.js.map +1 -0
  270. package/node_modules/tar/dist/esm/replace.d.ts +2 -0
  271. package/node_modules/tar/dist/esm/replace.d.ts.map +1 -0
  272. package/node_modules/tar/dist/esm/replace.js +221 -0
  273. package/node_modules/tar/dist/esm/replace.js.map +1 -0
  274. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +2 -0
  275. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts.map +1 -0
  276. package/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
  277. package/node_modules/tar/dist/esm/strip-absolute-path.js.map +1 -0
  278. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +2 -0
  279. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts.map +1 -0
  280. package/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
  281. package/node_modules/tar/dist/esm/strip-trailing-slashes.js.map +1 -0
  282. package/node_modules/tar/dist/esm/symlink-error.d.ts +9 -0
  283. package/node_modules/tar/dist/esm/symlink-error.d.ts.map +1 -0
  284. package/node_modules/tar/dist/esm/symlink-error.js +15 -0
  285. package/node_modules/tar/dist/esm/symlink-error.js.map +1 -0
  286. package/node_modules/tar/dist/esm/types.d.ts +7 -0
  287. package/node_modules/tar/dist/esm/types.d.ts.map +1 -0
  288. package/node_modules/tar/dist/esm/types.js +45 -0
  289. package/node_modules/tar/dist/esm/types.js.map +1 -0
  290. package/node_modules/tar/dist/esm/unpack.d.ts +101 -0
  291. package/node_modules/tar/dist/esm/unpack.d.ts.map +1 -0
  292. package/node_modules/tar/dist/esm/unpack.js +891 -0
  293. package/node_modules/tar/dist/esm/unpack.js.map +1 -0
  294. package/node_modules/tar/dist/esm/update.d.ts +2 -0
  295. package/node_modules/tar/dist/esm/update.d.ts.map +1 -0
  296. package/node_modules/tar/dist/esm/update.js +30 -0
  297. package/node_modules/tar/dist/esm/update.js.map +1 -0
  298. package/node_modules/tar/dist/esm/warn-method.d.ts +24 -0
  299. package/node_modules/tar/dist/esm/warn-method.d.ts.map +1 -0
  300. package/node_modules/tar/dist/esm/warn-method.js +27 -0
  301. package/node_modules/tar/dist/esm/warn-method.js.map +1 -0
  302. package/node_modules/tar/dist/esm/winchars.d.ts +3 -0
  303. package/node_modules/tar/dist/esm/winchars.d.ts.map +1 -0
  304. package/node_modules/tar/dist/esm/winchars.js +9 -0
  305. package/node_modules/tar/dist/esm/winchars.js.map +1 -0
  306. package/node_modules/tar/dist/esm/write-entry.d.ts +129 -0
  307. package/node_modules/tar/dist/esm/write-entry.d.ts.map +1 -0
  308. package/node_modules/tar/dist/esm/write-entry.js +656 -0
  309. package/node_modules/tar/dist/esm/write-entry.js.map +1 -0
  310. package/node_modules/tar/package.json +297 -0
  311. package/node_modules/yallist/LICENSE.md +63 -0
  312. package/node_modules/yallist/README.md +205 -0
  313. package/node_modules/yallist/dist/commonjs/index.d.ts +39 -0
  314. package/node_modules/yallist/dist/commonjs/index.d.ts.map +1 -0
  315. package/node_modules/yallist/dist/commonjs/index.js +384 -0
  316. package/node_modules/yallist/dist/commonjs/index.js.map +1 -0
  317. package/node_modules/yallist/dist/commonjs/package.json +3 -0
  318. package/node_modules/yallist/dist/esm/index.d.ts +39 -0
  319. package/node_modules/yallist/dist/esm/index.d.ts.map +1 -0
  320. package/node_modules/yallist/dist/esm/index.js +379 -0
  321. package/node_modules/yallist/dist/esm/index.js.map +1 -0
  322. package/node_modules/yallist/dist/esm/package.json +3 -0
  323. package/node_modules/yallist/package.json +68 -0
  324. package/package.json +3 -1
  325. package/skills/manifest.json +12 -0
  326. package/skills/weibo-cron/SKILL.md +115 -48
  327. package/skills/weibo-crowd/SKILL.md +187 -19
  328. package/skills/weibo-crowd/references/SILICON-TEAHOUSE-RULES.md +197 -63
  329. package/skills/weibo-crowd/scripts/weibo-crowd.js +105 -27
  330. package/skills/weibo-hot-search/SKILL.md +2 -0
  331. package/skills/weibo-pic/SKILL.md +266 -0
  332. package/skills/weibo-pic/scripts/weibo-pic.js +798 -0
  333. package/skills/weibo-search/SKILL.md +2 -0
  334. package/skills/weibo-status/SKILL.md +2 -0
  335. package/skills/weibo-token/SKILL.md +2 -0
  336. package/skills/weibo-video/SKILL.md +2 -0
  337. package/src/client.d.ts.map +1 -1
  338. package/src/client.js +3 -0
  339. package/src/client.js.map +1 -1
  340. package/src/skill-updater.d.ts +14 -0
  341. package/src/skill-updater.d.ts.map +1 -0
  342. package/src/skill-updater.js +240 -0
  343. package/src/skill-updater.js.map +1 -0
  344. package/src/token.d.ts +2 -0
  345. package/src/token.d.ts.map +1 -1
  346. package/src/token.js +1 -0
  347. package/src/token.js.map +1 -1
  348. package/src/weibo-hot-search.js +1 -1
  349. package/src/weibo-hot-search.js.map +1 -1
  350. package/src/weibo-search.js +1 -1
  351. package/src/weibo-search.js.map +1 -1
  352. package/src/weibo-status.js +1 -1
  353. package/src/weibo-status.js.map +1 -1
  354. package/src/weibo-token-tool.js +1 -1
  355. package/src/weibo-token-tool.js.map +1 -1
@@ -0,0 +1,1224 @@
1
+ # node-tar
2
+
3
+ Fast and full-featured Tar for Node.js
4
+
5
+ The API is designed to mimic the behavior of `tar(1)` on unix systems.
6
+ If you are familiar with how tar works, most of this will hopefully be
7
+ straightforward for you. If not, then hopefully this module can teach
8
+ you useful unix skills that may come in handy someday :)
9
+
10
+ ## Security Information
11
+
12
+ Significant efforts have been taken to harden this library
13
+ against a wide variety of filesystem based attacks, especially as
14
+ it is used to unpack packages that are published by unknown
15
+ agents to [the npm registry](https://npmjs.com/).
16
+
17
+ A brief overview of some of the hardening that has gone into this
18
+ implementation. (Note that most of these are disabled if
19
+ `preservePaths: true` is set in the options.)
20
+
21
+ - Paths that attempt to walk up outside of the extraction target
22
+ are ignored, and a warning is raised.
23
+ - `Link` and `SymbolicLink` entries are not allowed to target
24
+ locations outside of the extraction folder.
25
+ - Extraction is not allowed through a symbolic link that appears
26
+ within the extraction target.
27
+ - Absolute paths are turned into relative paths underneath the
28
+ extraction target.
29
+ - Character Device, Block Device, and FIFO entries are never
30
+ extracted.
31
+ - File and directory ownership is not mutated unless `forceChown`
32
+ is set, or the extraction is run as root.
33
+ - File and directory modes in the archive are ignored, unless
34
+ the `chmod: true` option is set.
35
+ - A path-reservation system is used to ensure that even when
36
+ multiple entries are being extracted in parallel, subsequent
37
+ entries with the same filename will not interfere with one
38
+ another (for example, exchanging a file with a symbolic link
39
+ while it is being written to).
40
+ - Unicode characters in path names are fully normalized, to
41
+ prevent evading these protections with unicode equivalences.
42
+
43
+ It is frankly unlikely that any tar implementation in JavaScript
44
+ is going to be as secure as this one, unless a similar amount of
45
+ work is put into it, putting it to the test over many years of
46
+ intensive use and scrutiny. You can vibe-code a tar extractor in
47
+ an afternoon, but you'll regret it.
48
+
49
+ > [!WARNING]
50
+ >
51
+ > **However**, all that being said, _care must still be taken_
52
+ > when dealing with data from unknown sources, especially when
53
+ > extracting files, with this or any library, no matter how
54
+ > hardened it may be. It is _your_ responsibility to use this
55
+ > library safely.
56
+
57
+ 1. **NEVER** extract tarball data into a folder that could be
58
+ potentially controlled by an unknown actor. A clever attacker
59
+ can swap out the target of an extracted file with a symbolic
60
+ link to some location of their choosing, resulting in writing
61
+ files outside the target folder. There is no reasonable way to
62
+ harden against this category of attack, and security reports
63
+ about it will be closed.
64
+ [TOCTOU](https://cwe.mitre.org/data/definitions/367.html)
65
+ exposure is unavoidable when creating files based on entries
66
+ in an archive file.
67
+ 2. If you are unpacking tarballs that may come from an unknown
68
+ source, it is **highly recommended** that you use a filter
69
+ function that rejects all hardlinks and symbolic links. Link
70
+ files are historically the root of nearly every file
71
+ extraction vulnerability. (npm filters links out of package
72
+ artifacts for this reason.)
73
+ 3. If you are extracting tarballs that are compressed (eg, with
74
+ gzip, brotli, or zstd), then it is a very good idea to also
75
+ filter out any files that are excessively large. Even if you
76
+ are restricting the size of the archive file itself, an
77
+ excessively large file of repetitive data can compress down
78
+ very small, and extract to take up a lot of disk space.
79
+ 4. **Stay up to date.** Old versions of tar are not maintained or
80
+ tested for newly discovered security advisories, and should be
81
+ assumed to contain every known security vulnerability, and
82
+ many that are unknown.
83
+
84
+ If you find a security vulnerability in node-tar, where it is not
85
+ properly enforcing the intended security protections, then please
86
+ report it using the GitHub Security Advisories system, where it
87
+ will be triaged and corrected if possible.
88
+
89
+ ## Background
90
+
91
+ A "tar file" or "tarball" is an archive of file system entries
92
+ (directories, files, links, etc.) The name comes from "tape archive".
93
+ If you run `man tar` on almost any Unix command line, you'll learn
94
+ quite a bit about what it can do, and its history.
95
+
96
+ Tar has 5 main top-level commands:
97
+
98
+ - `c` Create an archive
99
+ - `r` Replace entries within an archive
100
+ - `u` Update entries within an archive (ie, replace if they're newer)
101
+ - `t` List out the contents of an archive
102
+ - `x` Extract an archive to disk
103
+
104
+ The other flags and options modify how this top level function works.
105
+
106
+ ## High-Level API
107
+
108
+ These 5 functions are the high-level API. All of them have a
109
+ single-character name (for unix nerds familiar with `tar(1)`) as well
110
+ as a long name (for everyone else).
111
+
112
+ All the high-level functions take the following arguments, all three
113
+ of which are optional and may be omitted.
114
+
115
+ 1. `options` - An optional object specifying various options
116
+ 2. `paths` - An array of paths to add or extract
117
+ 3. `callback` - Called when the command is completed, if async. (If
118
+ sync or no file specified, providing a callback throws a
119
+ `TypeError`.)
120
+
121
+ If the command is sync (ie, if `options.sync=true`), then the
122
+ callback is not allowed, since the action will be completed immediately.
123
+
124
+ If a `file` argument is specified, and the command is async, then a
125
+ `Promise` is returned. In this case, if async, a callback may be
126
+ provided which is called when the command is completed.
127
+
128
+ If a `file` option is not specified, then a stream is returned. For
129
+ `create`, this is a readable stream of the generated archive. For
130
+ `list` and `extract` this is a writable stream that an archive should
131
+ be written into. If a file is not specified, then a callback is not
132
+ allowed, because you're already getting a stream to work with.
133
+
134
+ `replace` and `update` only work on existing archives, and so require
135
+ a `file` argument.
136
+
137
+ Sync commands without a file argument return a stream that acts on its
138
+ input immediately in the same tick. For readable streams, this means
139
+ that all of the data is immediately available by calling
140
+ `stream.read()`. For writable streams, it will be acted upon as soon
141
+ as it is provided, but this can be at any time.
142
+
143
+ ### Warnings and Errors
144
+
145
+ Tar emits warnings and errors for recoverable and unrecoverable situations,
146
+ respectively. In many cases, a warning only affects a single entry in an
147
+ archive, or is simply informing you that it's modifying an entry to comply
148
+ with the settings provided.
149
+
150
+ Unrecoverable warnings will always raise an error (ie, emit `'error'` on
151
+ streaming actions, throw for non-streaming sync actions, reject the
152
+ returned Promise for non-streaming async operations, or call a provided
153
+ callback with an `Error` as the first argument). Recoverable errors will
154
+ raise an error only if `strict: true` is set in the options.
155
+
156
+ Respond to (recoverable) warnings by listening to the `warn` event.
157
+ Handlers receive 3 arguments:
158
+
159
+ - `code` String. One of the error codes below. This may not match
160
+ `data.code`, which preserves the original error code from fs and zlib.
161
+ - `message` String. More details about the error.
162
+ - `data` Metadata about the error. An `Error` object for errors raised by
163
+ fs and zlib. All fields are attached to errors raisd by tar. Typically
164
+ contains the following fields, as relevant:
165
+ - `tarCode` The tar error code.
166
+ - `code` Either the tar error code, or the error code set by the
167
+ underlying system.
168
+ - `file` The archive file being read or written.
169
+ - `cwd` Working directory for creation and extraction operations.
170
+ - `entry` The entry object (if it could be created) for `TAR_ENTRY_INFO`,
171
+ `TAR_ENTRY_INVALID`, and `TAR_ENTRY_ERROR` warnings.
172
+ - `header` The header object (if it could be created, and the entry could
173
+ not be created) for `TAR_ENTRY_INFO` and `TAR_ENTRY_INVALID` warnings.
174
+ - `recoverable` Boolean. If `false`, then the warning will emit an
175
+ `error`, even in non-strict mode.
176
+
177
+ #### Error Codes
178
+
179
+ - `TAR_ENTRY_INFO` An informative error indicating that an entry is being
180
+ modified, but otherwise processed normally. For example, removing `/` or
181
+ `C:\` from absolute paths if `preservePaths` is not set.
182
+
183
+ - `TAR_ENTRY_INVALID` An indication that a given entry is not a valid tar
184
+ archive entry, and will be skipped. This occurs when:
185
+ - a checksum fails,
186
+ - a `linkpath` is missing for a link type, or
187
+ - a `linkpath` is provided for a non-link type.
188
+
189
+ If every entry in a parsed archive raises an `TAR_ENTRY_INVALID` error,
190
+ then the archive is presumed to be unrecoverably broken, and
191
+ `TAR_BAD_ARCHIVE` will be raised.
192
+
193
+ - `TAR_ENTRY_ERROR` The entry appears to be a valid tar archive entry, but
194
+ encountered an error which prevented it from being unpacked. This occurs
195
+ when:
196
+ - an unrecoverable fs error happens during unpacking,
197
+ - an entry is trying to extract into an excessively deep
198
+ location (by default, limited to 1024 subfolders),
199
+ - an entry has `..` in the path and `preservePaths` is not set, or
200
+ - an entry is extracting through a symbolic link, when `preservePaths` is
201
+ not set.
202
+
203
+ - `TAR_ENTRY_UNSUPPORTED` An indication that a given entry is
204
+ a valid archive entry, but of a type that is unsupported, and so will be
205
+ skipped in archive creation or extracting.
206
+
207
+ - `TAR_ABORT` When parsing gzipped-encoded archives, the parser will
208
+ abort the parse process raise a warning for any zlib errors encountered.
209
+ Aborts are considered unrecoverable for both parsing and unpacking.
210
+
211
+ - `TAR_BAD_ARCHIVE` The archive file is totally hosed. This can happen for
212
+ a number of reasons, and always occurs at the end of a parse or extract:
213
+ - An entry body was truncated before seeing the full number of bytes.
214
+ - The archive contained only invalid entries, indicating that it is
215
+ likely not an archive, or at least, not an archive this library can
216
+ parse.
217
+
218
+ `TAR_BAD_ARCHIVE` is considered informative for parse operations, but
219
+ unrecoverable for extraction. Note that, if encountered at the end of an
220
+ extraction, tar WILL still have extracted as much it could from the
221
+ archive, so there may be some garbage files to clean up.
222
+
223
+ Errors that occur deeper in the system (ie, either the filesystem or zlib)
224
+ will have their error codes left intact, and a `tarCode` matching one of
225
+ the above will be added to the warning metadata or the raised error object.
226
+
227
+ Errors generated by tar will have one of the above codes set as the
228
+ `error.code` field as well, but since errors originating in zlib or fs will
229
+ have their original codes, it's better to read `error.tarCode` if you wish
230
+ to see how tar is handling the issue.
231
+
232
+ ### Examples
233
+
234
+ The API mimics the `tar(1)` command line functionality, with aliases
235
+ for more human-readable option and function names. The goal is that
236
+ if you know how to use `tar(1)` in Unix, then you know how to use
237
+ `import('tar')` in JavaScript.
238
+
239
+ To replicate `tar czf my-tarball.tgz files and folders`, you'd do:
240
+
241
+ ```js
242
+ import { create } from 'tar'
243
+ create(
244
+ {
245
+ gzip: <true|gzip options>,
246
+ file: 'my-tarball.tgz'
247
+ },
248
+ ['some', 'files', 'and', 'folders']
249
+ ).then(_ => { .. tarball has been created .. })
250
+ ```
251
+
252
+ To replicate `tar cz files and folders > my-tarball.tgz`, you'd do:
253
+
254
+ ```js
255
+ // if you're familiar with the tar(1) cli flags, this can be nice
256
+ import * as tar from 'tar'
257
+ tar.c(
258
+ {
259
+ // 'z' is alias for 'gzip' option
260
+ z: <true|gzip options>
261
+ },
262
+ ['some', 'files', 'and', 'folders']
263
+ ).pipe(fs.createWriteStream('my-tarball.tgz'))
264
+ ```
265
+
266
+ To replicate `tar xf my-tarball.tgz` you'd do:
267
+
268
+ ```js
269
+ tar.x( // or `tar.extract`
270
+ {
271
+ // or `file:`
272
+ f: 'my-tarball.tgz'
273
+ }
274
+ ).then(_=> { .. tarball has been dumped in cwd .. })
275
+ ```
276
+
277
+ To replicate `cat my-tarball.tgz | tar x -C some-dir --strip=1`:
278
+
279
+ ```js
280
+ fs.createReadStream('my-tarball.tgz').pipe(
281
+ tar.x({
282
+ strip: 1,
283
+ C: 'some-dir', // alias for cwd:'some-dir', also ok
284
+ }),
285
+ )
286
+ ```
287
+
288
+ To replicate `tar tf my-tarball.tgz`, do this:
289
+
290
+ ```js
291
+ tar.t({
292
+ file: 'my-tarball.tgz',
293
+ onReadEntry: entry => { .. do whatever with it .. }
294
+ })
295
+ ```
296
+
297
+ For example, to just get the list of filenames from an archive:
298
+
299
+ ```js
300
+ const getEntryFilenames = async tarballFilename => {
301
+ const filenames = []
302
+ await tar.t({
303
+ file: tarballFilename,
304
+ onReadEntry: entry => filenames.push(entry.path),
305
+ })
306
+ return filenames
307
+ }
308
+ ```
309
+
310
+ To replicate `cat my-tarball.tgz | tar t` do:
311
+
312
+ ```js
313
+ fs.createReadStream('my-tarball.tgz')
314
+ .pipe(tar.t())
315
+ .on('entry', entry => { .. do whatever with it .. })
316
+ ```
317
+
318
+ To do anything synchronous, add `sync: true` to the options. Note
319
+ that sync functions don't take a callback and don't return a promise.
320
+ When the function returns, it's already done. Sync methods without a
321
+ file argument return a sync stream, which flushes immediately. But,
322
+ of course, it still won't be done until you `.end()` it.
323
+
324
+ ```js
325
+ const getEntryFilenamesSync = tarballFilename => {
326
+ const filenames = []
327
+ tar.t({
328
+ file: tarballFilename,
329
+ onReadEntry: entry => filenames.push(entry.path),
330
+ sync: true,
331
+ })
332
+ return filenames
333
+ }
334
+ ```
335
+
336
+ To filter entries, add `filter: <function>` to the options.
337
+ Tar-creating methods call the filter with `filter(path, stat)`.
338
+ Tar-reading methods (including extraction) call the filter with
339
+ `filter(path, entry)`. The filter is called in the `this`-context of
340
+ the `Pack` or `Unpack` stream object.
341
+
342
+ The arguments list to `tar t` and `tar x` specify a list of filenames
343
+ to extract or list, so they're equivalent to a filter that tests if
344
+ the file is in the list.
345
+
346
+ For those who _aren't_ fans of tar's single-character command names:
347
+
348
+ ```
349
+ tar.c === tar.create
350
+ tar.r === tar.replace (appends to archive, file is required)
351
+ tar.u === tar.update (appends if newer, file is required)
352
+ tar.x === tar.extract
353
+ tar.t === tar.list
354
+ ```
355
+
356
+ Keep reading for all the command descriptions and options, as well as
357
+ the low-level API that they are built on.
358
+
359
+ ### tar.c(options, fileList, callback) [alias: tar.create]
360
+
361
+ Create a tarball archive.
362
+
363
+ The `fileList` is an array of paths to add to the tarball. Adding a
364
+ directory also adds its children recursively.
365
+
366
+ An entry in `fileList` that starts with an `@` symbol is a tar archive
367
+ whose entries will be added. To add a file that starts with `@`,
368
+ prepend it with `./`.
369
+
370
+ The following options are supported:
371
+
372
+ - `file` Write the tarball archive to the specified filename. If this
373
+ is specified, then the callback will be fired when the file has been
374
+ written, and a promise will be returned that resolves when the file
375
+ is written. If a filename is not specified, then a Readable Stream
376
+ will be returned which will emit the file data. [Alias: `f`]
377
+ - `sync` Act synchronously. If this is set, then any provided file
378
+ will be fully written after the call to `tar.c`. If this is set,
379
+ and a file is not provided, then the resulting stream will already
380
+ have the data ready to `read` or `emit('data')` as soon as you
381
+ request it.
382
+ - `onwarn` A function that will get called with `(code, message, data)` for
383
+ any warnings encountered. (See "Warnings and Errors")
384
+ - `strict` Treat warnings as crash-worthy errors. Default false.
385
+ - `cwd` The current working directory for creating the archive.
386
+ Defaults to `process.cwd()`. [Alias: `C`]
387
+ - `prefix` A path portion to prefix onto the entries in the archive.
388
+ - `gzip` Set to any truthy value to create a gzipped archive, or an
389
+ object with settings for `zlib.Gzip()` [Alias: `z`]
390
+ - `filter` A function that gets called with `(path, stat)` for each
391
+ entry being added. Return `true` to add the entry to the archive,
392
+ or `false` to omit it.
393
+ - `portable` Omit metadata that is system-specific: `ctime`, `atime`,
394
+ `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note
395
+ that `mtime` is still included, because this is necessary for other
396
+ time-based operations. Additionally, `mode` is set to a "reasonable
397
+ default" for most unix systems, based on a `umask` value of `0o22`.
398
+ - `preservePaths` Allow absolute paths. By default, `/` is stripped
399
+ from absolute paths. [Alias: `P`]
400
+ - `mode` The mode to set on the created file archive
401
+ - `noDirRecurse` Do not recursively archive the contents of
402
+ directories. [Alias: `n`]
403
+ - `follow` Set to true to pack the targets of symbolic links. Without
404
+ this option, symbolic links are archived as such. [Alias: `L`, `h`]
405
+ - `noPax` Suppress pax extended headers. Note that this means that
406
+ long paths and linkpaths will be truncated, and large or negative
407
+ numeric values may be interpreted incorrectly.
408
+ - `noMtime` Set to true to omit writing `mtime` values for entries.
409
+ Note that this prevents using other mtime-based features like
410
+ `tar.update` or the `keepNewer` option with the resulting tar archive.
411
+ [Alias: `m`, `no-mtime`]
412
+ - `mtime` Set to a `Date` object to force a specific `mtime` for
413
+ everything added to the archive. Overridden by `noMtime`.
414
+ - `onWriteEntry` Called with each `WriteEntry` or
415
+ `WriteEntrySync` that is created in the course of writing the
416
+ archive.
417
+
418
+ The following options are mostly internal, but can be modified in some
419
+ advanced use cases, such as re-using caches between runs.
420
+
421
+ - `linkCache` A Map object containing the device and inode value for
422
+ any file whose nlink is > 1, to identify hard links.
423
+ - `statCache` A Map object that caches calls `lstat`.
424
+ - `readdirCache` A Map object that caches calls to `readdir`.
425
+ - `jobs` A number specifying how many concurrent jobs to run.
426
+ Defaults to 4.
427
+ - `maxReadSize` The maximum buffer size for `fs.read()` operations.
428
+ Defaults to 16 MB.
429
+
430
+ #### Using `onWriteEntry` to alter entries
431
+
432
+ The `onWriteEntry` function, if provided, will get a reference
433
+ to each `entry` object on its way into the archive.
434
+
435
+ If any fields on this entry are changed, then these changes will
436
+ be reflected in the entry that is written to the archive.
437
+
438
+ The return value of the function is ignored. All that matters is
439
+ the final state of the entry object. This can also be used to
440
+ track the files added to an archive, for example.
441
+
442
+ ```js
443
+ import * as tar from 'tar'
444
+ const filesAdded = []
445
+ tar.c(
446
+ {
447
+ sync: true,
448
+ file: 'lowercase-executable.tar',
449
+ onWriteEntry(entry) {
450
+ // initially, it's uppercase and 0o644
451
+ console.log('adding', entry.path, entry.stat.mode.toString(8))
452
+ // make all the paths lowercase
453
+ entry.path = entry.path.toLowerCase()
454
+ // make the entry executable
455
+ entry.stat.mode = 0o755
456
+ // in the archive, it's lowercase and 0o755
457
+ filesAdded.push([entry.path, entry.stat.mode.toString(8)])
458
+ },
459
+ },
460
+ ['./bin'],
461
+ )
462
+ console.log('added', filesAdded)
463
+ ```
464
+
465
+ Then, if the `./bin` directory contained `SOME-BIN`, it would
466
+ show up in the archive as:
467
+
468
+ ```
469
+ $ node create-lowercase-executable.js
470
+ adding ./bin/SOME-BIN 644
471
+ added [[ './bin/some-bin', '755' ]]
472
+
473
+ $ tar cvf lowercase-executable.tar
474
+ -rwxr-xr-x 0 isaacs 20 47731 Aug 14 08:56 ./bin/some-bin
475
+ ```
476
+
477
+ with a lowercase name and a mode of `0o755`.
478
+
479
+ ### tar.x(options, fileList, callback) [alias: tar.extract]
480
+
481
+ Extract a tarball archive.
482
+
483
+ The `fileList` is an array of paths to extract from the tarball. If
484
+ no paths are provided, then all the entries are extracted.
485
+
486
+ If the archive is gzipped, then tar will detect this and unzip it.
487
+
488
+ Note that all directories that are created will be forced to be
489
+ writable, readable, and listable by their owner, to avoid cases where
490
+ a directory prevents extraction of child entries by virtue of its
491
+ mode.
492
+
493
+ Most extraction errors will cause a `warn` event to be emitted. If
494
+ the `cwd` is missing, or not a directory, then the extraction will
495
+ fail completely.
496
+
497
+ The following options are supported:
498
+
499
+ - `cwd` Extract files relative to the specified directory. Defaults
500
+ to `process.cwd()`. If provided, this must exist and must be a
501
+ directory. [Alias: `C`]
502
+ - `file` The archive file to extract. If not specified, then a
503
+ Writable stream is returned where the archive data should be
504
+ written. [Alias: `f`]
505
+ - `sync` Create files and directories synchronously.
506
+ - `strict` Treat warnings as crash-worthy errors. Default false.
507
+ - `filter` A function that gets called with `(path, entry)` for each
508
+ entry being unpacked. Return `true` to unpack the entry from the
509
+ archive, or `false` to skip it.
510
+ - `newer` Set to true to keep the existing file on disk if it's newer
511
+ than the file in the archive. [Alias: `keep-newer`,
512
+ `keep-newer-files`]
513
+ - `keep` Do not overwrite existing files. In particular, if a file
514
+ appears more than once in an archive, later copies will not
515
+ overwrite earlier copies. [Alias: `k`, `keep-existing`]
516
+ - `preservePaths` Allow absolute paths, paths containing `..`, and
517
+ extracting through symbolic links. By default, `/` is stripped from
518
+ absolute paths, `..` paths are not extracted, and any file whose
519
+ location would be modified by a symbolic link is not extracted.
520
+ [Alias: `P`]
521
+ - `unlink` Unlink files before creating them. Without this option,
522
+ tar overwrites existing files, which preserves existing hardlinks.
523
+ With this option, existing hardlinks will be broken, as will any
524
+ symlink that would affect the location of an extracted file. [Alias:
525
+ `U`]
526
+ - `strip` Remove the specified number of leading path elements.
527
+ Pathnames with fewer elements will be silently skipped. Note that
528
+ the pathname is edited after applying the filter, but before
529
+ security checks. [Alias: `strip-components`, `stripComponents`]
530
+ - `preserveOwner` If true, tar will set the `uid` and `gid` of
531
+ extracted entries to the `uid` and `gid` fields in the archive.
532
+ This defaults to true when run as root, and false otherwise. If
533
+ false, then files and directories will be set with the owner and
534
+ group of the user running the process. This is similar to `-p` in
535
+ `tar(1)`, but ACLs and other system-specific data is never unpacked
536
+ in this implementation, and modes are set by default already.
537
+ [Alias: `p`]
538
+ - `uid` Set to a number to force ownership of all extracted files and
539
+ folders, and all implicitly created directories, to be owned by the
540
+ specified user id, regardless of the `uid` field in the archive.
541
+ Cannot be used along with `preserveOwner`. Requires also setting a
542
+ `gid` option.
543
+ - `gid` Set to a number to force ownership of all extracted files and
544
+ folders, and all implicitly created directories, to be owned by the
545
+ specified group id, regardless of the `gid` field in the archive.
546
+ Cannot be used along with `preserveOwner`. Requires also setting a
547
+ `uid` option.
548
+ - `noMtime` Set to true to omit writing `mtime` value for extracted
549
+ entries. [Alias: `m`, `no-mtime`]
550
+ - `transform` Provide a function that takes an `entry` object, and
551
+ returns a stream, or any falsey value. If a stream is provided,
552
+ then that stream's data will be written instead of the contents of
553
+ the archive entry. If a falsey value is provided, then the entry is
554
+ written to disk as normal. (To exclude items from extraction, use
555
+ the `filter` option described above.)
556
+ - `onReadEntry` A function that gets called with `(entry)` for each entry
557
+ that passes the filter.
558
+ - `onwarn` A function that will get called with `(code, message, data)` for
559
+ any warnings encountered. (See "Warnings and Errors")
560
+ - `chmod` Set to true to call `fs.chmod()` to ensure that the
561
+ extracted file matches the entry mode. This may necessitate a
562
+ call to the deprecated and thread-unsafe `process.umask()`
563
+ method to determine the default umask value, unless a
564
+ `processUmask` options is also provided. Otherwise tar will
565
+ extract with whatever mode is provided, and let the process
566
+ `umask` apply normally.
567
+ - `processUmask` Set to an explicit numeric value to avoid
568
+ calling `process.umask()` when `chmod: true` is set.
569
+ - `maxDepth` The maximum depth of subfolders to extract into. This
570
+ defaults to 1024. Anything deeper than the limit will raise a
571
+ warning and skip the entry. Set to `Infinity` to remove the
572
+ limitation.
573
+
574
+ The following options are mostly internal, but can be modified in some
575
+ advanced use cases, such as re-using caches between runs.
576
+
577
+ - `maxReadSize` The maximum buffer size for `fs.read()` operations.
578
+ Defaults to 16 MB.
579
+ - `umask` Filter the modes of entries like `process.umask()`.
580
+ - `dmode` Default mode for directories
581
+ - `fmode` Default mode for files
582
+ - `maxMetaEntrySize` The maximum size of meta entries that is
583
+ supported. Defaults to 1 MB.
584
+
585
+ Note that using an asynchronous stream type with the `transform`
586
+ option will cause undefined behavior in sync extractions.
587
+ [MiniPass](http://npm.im/minipass)-based streams are designed for this
588
+ use case.
589
+
590
+ ### tar.t(options, fileList, callback) [alias: tar.list]
591
+
592
+ List the contents of a tarball archive.
593
+
594
+ The `fileList` is an array of paths to list from the tarball. If
595
+ no paths are provided, then all the entries are listed.
596
+
597
+ If the archive is gzipped, then tar will detect this and unzip it.
598
+
599
+ If the `file` option is _not_ provided, then returns an event emitter that
600
+ emits `entry` events with `tar.ReadEntry` objects. However, they don't
601
+ emit `'data'` or `'end'` events. (If you want to get actual readable
602
+ entries, use the `tar.Parser` class instead.)
603
+
604
+ If a `file` option _is_ provided, then the return value will be a promise
605
+ that resolves when the file has been fully traversed in async mode, or
606
+ `undefined` if `sync: true` is set. Thus, you _must_ specify an `onReadEntry`
607
+ method in order to do anything useful with the data it parses.
608
+
609
+ The following options are supported:
610
+
611
+ - `file` The archive file to list. If not specified, then a
612
+ Writable stream is returned where the archive data should be
613
+ written. [Alias: `f`]
614
+ - `sync` Read the specified file synchronously. (This has no effect
615
+ when a file option isn't specified, because entries are emitted as
616
+ fast as they are parsed from the stream anyway.)
617
+ - `strict` Treat warnings as crash-worthy errors. Default false.
618
+ - `filter` A function that gets called with `(path, entry)` for each
619
+ entry being listed. Return `true` to emit the entry from the
620
+ archive, or `false` to skip it.
621
+ - `onReadEntry` A function that gets called with `(entry)` for each entry
622
+ that passes the filter. This is important for when `file` is set,
623
+ because there is no other way to do anything useful with this method.
624
+ - `maxReadSize` The maximum buffer size for `fs.read()` operations.
625
+ Defaults to 16 MB.
626
+ - `noResume` By default, `entry` streams are resumed immediately after
627
+ the call to `onReadEntry`. Set `noResume: true` to suppress this
628
+ behavior. Note that by opting into this, the stream will never
629
+ complete until the entry data is consumed.
630
+ - `onwarn` A function that will get called with `(code, message, data)` for
631
+ any warnings encountered. (See "Warnings and Errors")
632
+
633
+ ### tar.u(options, fileList, callback) [alias: tar.update]
634
+
635
+ Add files to an archive if they are newer than the entry already in
636
+ the tarball archive.
637
+
638
+ The `fileList` is an array of paths to add to the tarball. Adding a
639
+ directory also adds its children recursively.
640
+
641
+ An entry in `fileList` that starts with an `@` symbol is a tar archive
642
+ whose entries will be added. To add a file that starts with `@`,
643
+ prepend it with `./`.
644
+
645
+ The following options are supported:
646
+
647
+ - `file` Required. Write the tarball archive to the specified
648
+ filename. [Alias: `f`]
649
+ - `sync` Act synchronously. If this is set, then any provided file
650
+ will be fully written after the call to `tar.c`.
651
+ - `onwarn` A function that will get called with `(code, message, data)` for
652
+ any warnings encountered. (See "Warnings and Errors")
653
+ - `strict` Treat warnings as crash-worthy errors. Default false.
654
+ - `cwd` The current working directory for adding entries to the
655
+ archive. Defaults to `process.cwd()`. [Alias: `C`]
656
+ - `prefix` A path portion to prefix onto the entries in the archive.
657
+ - `gzip` Set to any truthy value to create a gzipped archive, or an
658
+ object with settings for `zlib.Gzip()` [Alias: `z`]
659
+ - `filter` A function that gets called with `(path, stat)` for each
660
+ entry being added. Return `true` to add the entry to the archive,
661
+ or `false` to omit it.
662
+ - `portable` Omit metadata that is system-specific: `ctime`, `atime`,
663
+ `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note
664
+ that `mtime` is still included, because this is necessary for other
665
+ time-based operations. Additionally, `mode` is set to a "reasonable
666
+ default" for most unix systems, based on a `umask` value of `0o22`.
667
+ - `preservePaths` Allow absolute paths. By default, `/` is stripped
668
+ from absolute paths. [Alias: `P`]
669
+ - `maxReadSize` The maximum buffer size for `fs.read()` operations.
670
+ Defaults to 16 MB.
671
+ - `noDirRecurse` Do not recursively archive the contents of
672
+ directories. [Alias: `n`]
673
+ - `follow` Set to true to pack the targets of symbolic links. Without
674
+ this option, symbolic links are archived as such. [Alias: `L`, `h`]
675
+ - `noPax` Suppress pax extended headers. Note that this means that
676
+ long paths and linkpaths will be truncated, and large or negative
677
+ numeric values may be interpreted incorrectly.
678
+ - `noMtime` Set to true to omit writing `mtime` values for entries.
679
+ Note that this prevents using other mtime-based features like
680
+ `tar.update` or the `keepNewer` option with the resulting tar archive.
681
+ [Alias: `m`, `no-mtime`]
682
+ - `mtime` Set to a `Date` object to force a specific `mtime` for
683
+ everything added to the archive. Overridden by `noMtime`.
684
+ - `onWriteEntry` Called with each `WriteEntry` or
685
+ `WriteEntrySync` that is created in the course of writing the
686
+ archive.
687
+
688
+ ### tar.r(options, fileList, callback) [alias: tar.replace]
689
+
690
+ Add files to an existing archive. Because later entries override
691
+ earlier entries, this effectively replaces any existing entries.
692
+
693
+ The `fileList` is an array of paths to add to the tarball. Adding a
694
+ directory also adds its children recursively.
695
+
696
+ An entry in `fileList` that starts with an `@` symbol is a tar archive
697
+ whose entries will be added. To add a file that starts with `@`,
698
+ prepend it with `./`.
699
+
700
+ The following options are supported:
701
+
702
+ - `file` Required. Write the tarball archive to the specified
703
+ filename. [Alias: `f`]
704
+ - `sync` Act synchronously. If this is set, then any provided file
705
+ will be fully written after the call to `tar.c`.
706
+ - `onwarn` A function that will get called with `(code, message, data)` for
707
+ any warnings encountered. (See "Warnings and Errors")
708
+ - `strict` Treat warnings as crash-worthy errors. Default false.
709
+ - `cwd` The current working directory for adding entries to the
710
+ archive. Defaults to `process.cwd()`. [Alias: `C`]
711
+ - `prefix` A path portion to prefix onto the entries in the archive.
712
+ - `gzip` Set to any truthy value to create a gzipped archive, or an
713
+ object with settings for `zlib.Gzip()` [Alias: `z`]
714
+ - `filter` A function that gets called with `(path, stat)` for each
715
+ entry being added. Return `true` to add the entry to the archive,
716
+ or `false` to omit it.
717
+ - `portable` Omit metadata that is system-specific: `ctime`, `atime`,
718
+ `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note
719
+ that `mtime` is still included, because this is necessary for other
720
+ time-based operations. Additionally, `mode` is set to a "reasonable
721
+ default" for most unix systems, based on a `umask` value of `0o22`.
722
+ - `preservePaths` Allow absolute paths. By default, `/` is stripped
723
+ from absolute paths. [Alias: `P`]
724
+ - `maxReadSize` The maximum buffer size for `fs.read()` operations.
725
+ Defaults to 16 MB.
726
+ - `noDirRecurse` Do not recursively archive the contents of
727
+ directories. [Alias: `n`]
728
+ - `follow` Set to true to pack the targets of symbolic links. Without
729
+ this option, symbolic links are archived as such. [Alias: `L`, `h`]
730
+ - `noPax` Suppress pax extended headers. Note that this means that
731
+ long paths and linkpaths will be truncated, and large or negative
732
+ numeric values may be interpreted incorrectly.
733
+ - `noMtime` Set to true to omit writing `mtime` values for entries.
734
+ Note that this prevents using other mtime-based features like
735
+ `tar.update` or the `keepNewer` option with the resulting tar archive.
736
+ [Alias: `m`, `no-mtime`]
737
+ - `mtime` Set to a `Date` object to force a specific `mtime` for
738
+ everything added to the archive. Overridden by `noMtime`.
739
+ - `onWriteEntry` Called with each `WriteEntry` or
740
+ `WriteEntrySync` that is created in the course of writing the
741
+ archive.
742
+
743
+ ## Low-Level API
744
+
745
+ ### class Pack
746
+
747
+ A readable tar stream.
748
+
749
+ Has all the standard readable stream interface stuff. `'data'` and
750
+ `'end'` events, `read()` method, `pause()` and `resume()`, etc.
751
+
752
+ #### constructor(options)
753
+
754
+ The following options are supported:
755
+
756
+ - `onwarn` A function that will get called with `(code, message, data)` for
757
+ any warnings encountered. (See "Warnings and Errors")
758
+ - `strict` Treat warnings as crash-worthy errors. Default false.
759
+ - `cwd` The current working directory for creating the archive.
760
+ Defaults to `process.cwd()`.
761
+ - `prefix` A path portion to prefix onto the entries in the archive.
762
+ - `gzip` Set to any truthy value to create a gzipped archive, or an
763
+ object with settings for `zlib.Gzip()`
764
+ - `filter` A function that gets called with `(path, stat)` for each
765
+ entry being added. Return `true` to add the entry to the archive,
766
+ or `false` to omit it.
767
+ - `portable` Omit metadata that is system-specific: `ctime`, `atime`,
768
+ `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note
769
+ that `mtime` is still included, because this is necessary for other
770
+ time-based operations. Additionally, `mode` is set to a "reasonable
771
+ default" for most unix systems, based on a `umask` value of `0o22`.
772
+ - `preservePaths` Allow absolute paths. By default, `/` is stripped
773
+ from absolute paths.
774
+ - `linkCache` A Map object containing the device and inode value for
775
+ any file whose nlink is > 1, to identify hard links.
776
+ - `statCache` A Map object that caches calls `lstat`.
777
+ - `readdirCache` A Map object that caches calls to `readdir`.
778
+ - `jobs` A number specifying how many concurrent jobs to run.
779
+ Defaults to 4.
780
+ - `maxReadSize` The maximum buffer size for `fs.read()` operations.
781
+ Defaults to 16 MB.
782
+ - `noDirRecurse` Do not recursively archive the contents of
783
+ directories.
784
+ - `follow` Set to true to pack the targets of symbolic links. Without
785
+ this option, symbolic links are archived as such.
786
+ - `noPax` Suppress pax extended headers. Note that this means that
787
+ long paths and linkpaths will be truncated, and large or negative
788
+ numeric values may be interpreted incorrectly.
789
+ - `noMtime` Set to true to omit writing `mtime` values for entries.
790
+ Note that this prevents using other mtime-based features like
791
+ `tar.update` or the `keepNewer` option with the resulting tar archive.
792
+ - `mtime` Set to a `Date` object to force a specific `mtime` for
793
+ everything added to the archive. Overridden by `noMtime`.
794
+ - `onWriteEntry` Called with each `WriteEntry` or
795
+ `WriteEntrySync` that is created in the course of writing the
796
+ archive.
797
+
798
+ #### add(path)
799
+
800
+ Adds an entry to the archive. Returns the Pack stream.
801
+
802
+ #### write(path)
803
+
804
+ Adds an entry to the archive. Returns true if flushed.
805
+
806
+ #### end()
807
+
808
+ Finishes the archive.
809
+
810
+ ### class PackSync
811
+
812
+ Synchronous version of `Pack`.
813
+
814
+ ### class Unpack
815
+
816
+ A writable stream that unpacks a tar archive onto the file system.
817
+
818
+ All the normal writable stream stuff is supported. `write()` and
819
+ `end()` methods, `'drain'` events, etc.
820
+
821
+ Note that all directories that are created will be forced to be
822
+ writable, readable, and listable by their owner, to avoid cases where
823
+ a directory prevents extraction of child entries by virtue of its
824
+ mode.
825
+
826
+ `'close'` is emitted when it's done writing stuff to the file system.
827
+
828
+ Most unpack errors will cause a `warn` event to be emitted. If the
829
+ `cwd` is missing, or not a directory, then an error will be emitted.
830
+
831
+ #### constructor(options)
832
+
833
+ - `cwd` Extract files relative to the specified directory. Defaults
834
+ to `process.cwd()`. If provided, this must exist and must be a
835
+ directory.
836
+ - `filter` A function that gets called with `(path, entry)` for each
837
+ entry being unpacked. Return `true` to unpack the entry from the
838
+ archive, or `false` to skip it.
839
+ - `newer` Set to true to keep the existing file on disk if it's newer
840
+ than the file in the archive.
841
+ - `keep` Do not overwrite existing files. In particular, if a file
842
+ appears more than once in an archive, later copies will not
843
+ overwrite earlier copies.
844
+ - `preservePaths` Allow absolute paths, paths containing `..`, and
845
+ extracting through symbolic links. By default, `/` is stripped from
846
+ absolute paths, `..` paths are not extracted, and any file whose
847
+ location would be modified by a symbolic link is not extracted.
848
+ - `unlink` Unlink files before creating them. Without this option,
849
+ tar overwrites existing files, which preserves existing hardlinks.
850
+ With this option, existing hardlinks will be broken, as will any
851
+ symlink that would affect the location of an extracted file.
852
+ - `strip` Remove the specified number of leading path elements.
853
+ Pathnames with fewer elements will be silently skipped. Note that
854
+ the pathname is edited after applying the filter, but before
855
+ security checks.
856
+ - `umask` Filter the modes of entries like `process.umask()`.
857
+ - `dmode` Default mode for directories
858
+ - `fmode` Default mode for files
859
+ - `maxMetaEntrySize` The maximum size of meta entries that is
860
+ supported. Defaults to 1 MB.
861
+ - `preserveOwner` If true, tar will set the `uid` and `gid` of
862
+ extracted entries to the `uid` and `gid` fields in the archive.
863
+ This defaults to true when run as root, and false otherwise. If
864
+ false, then files and directories will be set with the owner and
865
+ group of the user running the process. This is similar to `-p` in
866
+ `tar(1)`, but ACLs and other system-specific data is never unpacked
867
+ in this implementation, and modes are set by default already.
868
+ - `win32` True if on a windows platform. Causes behavior where
869
+ filenames containing `<|>?` chars are converted to
870
+ windows-compatible values while being unpacked.
871
+ - `uid` Set to a number to force ownership of all extracted files and
872
+ folders, and all implicitly created directories, to be owned by the
873
+ specified user id, regardless of the `uid` field in the archive.
874
+ Cannot be used along with `preserveOwner`. Requires also setting a
875
+ `gid` option.
876
+ - `gid` Set to a number to force ownership of all extracted files and
877
+ folders, and all implicitly created directories, to be owned by the
878
+ specified group id, regardless of the `gid` field in the archive.
879
+ Cannot be used along with `preserveOwner`. Requires also setting a
880
+ `uid` option.
881
+ - `noMtime` Set to true to omit writing `mtime` value for extracted
882
+ entries.
883
+ - `transform` Provide a function that takes an `entry` object, and
884
+ returns a stream, or any falsey value. If a stream is provided,
885
+ then that stream's data will be written instead of the contents of
886
+ the archive entry. If a falsey value is provided, then the entry is
887
+ written to disk as normal. (To exclude items from extraction, use
888
+ the `filter` option described above.)
889
+ - `strict` Treat warnings as crash-worthy errors. Default false.
890
+ - `onReadEntry` A function that gets called with `(entry)` for each entry
891
+ that passes the filter.
892
+ - `onwarn` A function that will get called with `(code, message, data)` for
893
+ any warnings encountered. (See "Warnings and Errors")
894
+ - `chmod` Set to true to call `fs.chmod()` to ensure that the
895
+ extracted file matches the entry mode. This may necessitate a
896
+ call to the deprecated and thread-unsafe `process.umask()`
897
+ method to determine the default umask value, unless a
898
+ `processUmask` options is also provided. Otherwise tar will
899
+ extract with whatever mode is provided, and let the process
900
+ `umask` apply normally.
901
+ - `processUmask` Set to an explicit numeric value to avoid
902
+ calling `process.umask()` when `chmod: true` is set.
903
+ - `maxDepth` The maximum depth of subfolders to extract into. This
904
+ defaults to 1024. Anything deeper than the limit will raise a
905
+ warning and skip the entry. Set to `Infinity` to remove the
906
+ limitation.
907
+
908
+ ### class UnpackSync
909
+
910
+ Synchronous version of `Unpack`.
911
+
912
+ Note that using an asynchronous stream type with the `transform`
913
+ option will cause undefined behavior in sync unpack streams.
914
+ [MiniPass](http://npm.im/minipass)-based streams are designed for this
915
+ use case.
916
+
917
+ ### class tar.Parser
918
+
919
+ A writable stream that parses a tar archive stream. All the standard
920
+ writable stream stuff is supported.
921
+
922
+ If the archive is gzipped, then tar will detect this and unzip it.
923
+
924
+ Emits `'entry'` events with `tar.ReadEntry` objects, which are
925
+ themselves readable streams that you can pipe wherever.
926
+
927
+ Each `entry` will not emit until the one before it is flushed through,
928
+ so make sure to either consume the data (with `on('data', ...)` or
929
+ `.pipe(...)`) or throw it away with `.resume()` to keep the stream
930
+ flowing.
931
+
932
+ #### constructor(options)
933
+
934
+ Returns an event emitter that emits `entry` events with
935
+ `tar.ReadEntry` objects.
936
+
937
+ The following options are supported:
938
+
939
+ - `strict` Treat warnings as crash-worthy errors. Default false.
940
+ - `filter` A function that gets called with `(path, entry)` for each
941
+ entry being listed. Return `true` to emit the entry from the
942
+ archive, or `false` to skip it.
943
+ - `onReadEntry` A function that gets called with `(entry)` for each entry
944
+ that passes the filter.
945
+ - `onwarn` A function that will get called with `(code, message, data)` for
946
+ any warnings encountered. (See "Warnings and Errors")
947
+
948
+ #### abort(error)
949
+
950
+ Stop all parsing activities. This is called when there are zlib
951
+ errors. It also emits an unrecoverable warning with the error provided.
952
+
953
+ ### class tar.ReadEntry extends [MiniPass](http://npm.im/minipass)
954
+
955
+ A representation of an entry that is being read out of a tar archive.
956
+
957
+ It has the following fields:
958
+
959
+ - `extended` The extended metadata object provided to the constructor.
960
+ - `globalExtended` The global extended metadata object provided to the
961
+ constructor.
962
+ - `remain` The number of bytes remaining to be written into the
963
+ stream.
964
+ - `blockRemain` The number of 512-byte blocks remaining to be written
965
+ into the stream.
966
+ - `ignore` Whether this entry should be ignored.
967
+ - `meta` True if this represents metadata about the next entry, false
968
+ if it represents a filesystem object.
969
+ - All the fields from the header, extended header, and global extended
970
+ header are added to the ReadEntry object. So it has `path`, `type`,
971
+ `size`, `mode`, and so on.
972
+
973
+ #### constructor(header, extended, globalExtended)
974
+
975
+ Create a new ReadEntry object with the specified header, extended
976
+ header, and global extended header values.
977
+
978
+ ### class tar.WriteEntry extends [MiniPass](http://npm.im/minipass)
979
+
980
+ A representation of an entry that is being written from the file
981
+ system into a tar archive.
982
+
983
+ Emits data for the Header, and for the Pax Extended Header if one is
984
+ required, as well as any body data.
985
+
986
+ Creating a WriteEntry for a directory does not also create
987
+ WriteEntry objects for all of the directory contents.
988
+
989
+ It has the following fields:
990
+
991
+ - `path` The path field that will be written to the archive. By
992
+ default, this is also the path from the cwd to the file system
993
+ object.
994
+ - `portable` Omit metadata that is system-specific: `ctime`, `atime`,
995
+ `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note
996
+ that `mtime` is still included, because this is necessary for other
997
+ time-based operations. Additionally, `mode` is set to a "reasonable
998
+ default" for most unix systems, based on a `umask` value of `0o22`.
999
+ - `myuid` If supported, the uid of the user running the current
1000
+ process.
1001
+ - `myuser` The `env.USER` string if set, or `''`. Set as the entry
1002
+ `uname` field if the file's `uid` matches `this.myuid`.
1003
+ - `maxReadSize` The maximum buffer size for `fs.read()` operations.
1004
+ Defaults to 1 MB.
1005
+ - `linkCache` A Map object containing the device and inode value for
1006
+ any file whose nlink is > 1, to identify hard links.
1007
+ - `statCache` A Map object that caches calls `lstat`.
1008
+ - `preservePaths` Allow absolute paths. By default, `/` is stripped
1009
+ from absolute paths.
1010
+ - `cwd` The current working directory for creating the archive.
1011
+ Defaults to `process.cwd()`.
1012
+ - `absolute` The absolute path to the entry on the filesystem. By
1013
+ default, this is `path.resolve(this.cwd, this.path)`, but it can be
1014
+ overridden explicitly.
1015
+ - `strict` Treat warnings as crash-worthy errors. Default false.
1016
+ - `win32` True if on a windows platform. Causes behavior where paths
1017
+ replace `\` with `/` and filenames containing the windows-compatible
1018
+ forms of `<|>?:` characters are converted to actual `<|>?:` characters
1019
+ in the archive.
1020
+ - `noPax` Suppress pax extended headers. Note that this means that
1021
+ long paths and linkpaths will be truncated, and large or negative
1022
+ numeric values may be interpreted incorrectly.
1023
+ - `noMtime` Set to true to omit writing `mtime` values for entries.
1024
+ Note that this prevents using other mtime-based features like
1025
+ `tar.update` or the `keepNewer` option with the resulting tar archive.
1026
+
1027
+ #### constructor(path, options)
1028
+
1029
+ `path` is the path of the entry as it is written in the archive.
1030
+
1031
+ The following options are supported:
1032
+
1033
+ - `portable` Omit metadata that is system-specific: `ctime`, `atime`,
1034
+ `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note
1035
+ that `mtime` is still included, because this is necessary for other
1036
+ time-based operations. Additionally, `mode` is set to a "reasonable
1037
+ default" for most unix systems, based on a `umask` value of `0o22`.
1038
+ - `maxReadSize` The maximum buffer size for `fs.read()` operations.
1039
+ Defaults to 1 MB.
1040
+ - `linkCache` A Map object containing the device and inode value for
1041
+ any file whose nlink is > 1, to identify hard links.
1042
+ - `statCache` A Map object that caches calls `lstat`.
1043
+ - `preservePaths` Allow absolute paths. By default, `/` is stripped
1044
+ from absolute paths.
1045
+ - `cwd` The current working directory for creating the archive.
1046
+ Defaults to `process.cwd()`.
1047
+ - `absolute` The absolute path to the entry on the filesystem. By
1048
+ default, this is `path.resolve(this.cwd, this.path)`, but it can be
1049
+ overridden explicitly.
1050
+ - `strict` Treat warnings as crash-worthy errors. Default false.
1051
+ - `win32` True if on a windows platform. Causes behavior where paths
1052
+ replace `\` with `/`.
1053
+ - `onwarn` A function that will get called with `(code, message, data)` for
1054
+ any warnings encountered. (See "Warnings and Errors")
1055
+ - `noMtime` Set to true to omit writing `mtime` values for entries.
1056
+ Note that this prevents using other mtime-based features like
1057
+ `tar.update` or the `keepNewer` option with the resulting tar archive.
1058
+ - `umask` Set to restrict the modes on the entries in the archive,
1059
+ somewhat like how umask works on file creation. Defaults to
1060
+ `process.umask()` on unix systems, or `0o22` on Windows.
1061
+
1062
+ #### warn(message, data)
1063
+
1064
+ If strict, emit an error with the provided message.
1065
+
1066
+ Otherwise, emit a `'warn'` event with the provided message and data.
1067
+
1068
+ ### class tar.WriteEntry.Sync
1069
+
1070
+ Synchronous version of tar.WriteEntry
1071
+
1072
+ ### class tar.WriteEntry.Tar
1073
+
1074
+ A version of tar.WriteEntry that gets its data from a tar.ReadEntry
1075
+ instead of from the filesystem.
1076
+
1077
+ #### constructor(readEntry, options)
1078
+
1079
+ `readEntry` is the entry being read out of another archive.
1080
+
1081
+ The following options are supported:
1082
+
1083
+ - `portable` Omit metadata that is system-specific: `ctime`, `atime`,
1084
+ `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note
1085
+ that `mtime` is still included, because this is necessary for other
1086
+ time-based operations. Additionally, `mode` is set to a "reasonable
1087
+ default" for most unix systems, based on a `umask` value of `0o22`.
1088
+ - `preservePaths` Allow absolute paths. By default, `/` is stripped
1089
+ from absolute paths.
1090
+ - `strict` Treat warnings as crash-worthy errors. Default false.
1091
+ - `onwarn` A function that will get called with `(code, message, data)` for
1092
+ any warnings encountered. (See "Warnings and Errors")
1093
+ - `noMtime` Set to true to omit writing `mtime` values for entries.
1094
+ Note that this prevents using other mtime-based features like
1095
+ `tar.update` or the `keepNewer` option with the resulting tar archive.
1096
+
1097
+ ### class tar.Header
1098
+
1099
+ A class for reading and writing header blocks.
1100
+
1101
+ It has the following fields:
1102
+
1103
+ - `nullBlock` True if decoding a block which is entirely composed of
1104
+ `0x00` null bytes. (Useful because tar files are terminated by
1105
+ at least 2 null blocks.)
1106
+ - `cksumValid` True if the checksum in the header is valid, false
1107
+ otherwise.
1108
+ - `needPax` True if the values, as encoded, will require a Pax
1109
+ extended header.
1110
+ - `path` The path of the entry.
1111
+ - `mode` The 4 lowest-order octal digits of the file mode. That is,
1112
+ read/write/execute permissions for world, group, and owner, and the
1113
+ setuid, setgid, and sticky bits.
1114
+ - `uid` Numeric user id of the file owner
1115
+ - `gid` Numeric group id of the file owner
1116
+ - `size` Size of the file in bytes
1117
+ - `mtime` Modified time of the file
1118
+ - `cksum` The checksum of the header. This is generated by adding all
1119
+ the bytes of the header block, treating the checksum field itself as
1120
+ all ascii space characters (that is, `0x20`).
1121
+ - `type` The human-readable name of the type of entry this represents,
1122
+ or the alphanumeric key if unknown.
1123
+ - `typeKey` The alphanumeric key for the type of entry this header
1124
+ represents.
1125
+ - `linkpath` The target of Link and SymbolicLink entries.
1126
+ - `uname` Human-readable user name of the file owner
1127
+ - `gname` Human-readable group name of the file owner
1128
+ - `devmaj` The major portion of the device number. Always `0` for
1129
+ files, directories, and links.
1130
+ - `devmin` The minor portion of the device number. Always `0` for
1131
+ files, directories, and links.
1132
+ - `atime` File access time.
1133
+ - `ctime` File change time.
1134
+
1135
+ #### constructor(data, [offset=0])
1136
+
1137
+ `data` is optional. It is either a Buffer that should be interpreted
1138
+ as a tar Header starting at the specified offset and continuing for
1139
+ 512 bytes, or a data object of keys and values to set on the header
1140
+ object, and eventually encode as a tar Header.
1141
+
1142
+ #### decode(block, offset)
1143
+
1144
+ Decode the provided buffer starting at the specified offset.
1145
+
1146
+ Buffer length must be greater than 512 bytes.
1147
+
1148
+ #### set(data)
1149
+
1150
+ Set the fields in the data object.
1151
+
1152
+ #### encode(buffer, offset)
1153
+
1154
+ Encode the header fields into the buffer at the specified offset.
1155
+
1156
+ Returns `this.needPax` to indicate whether a Pax Extended Header is
1157
+ required to properly encode the specified data.
1158
+
1159
+ ### class tar.Pax
1160
+
1161
+ An object representing a set of key-value pairs in an Pax extended
1162
+ header entry.
1163
+
1164
+ It has the following fields. Where the same name is used, they have
1165
+ the same semantics as the tar.Header field of the same name.
1166
+
1167
+ - `global` True if this represents a global extended header, or false
1168
+ if it is for a single entry.
1169
+ - `atime`
1170
+ - `charset`
1171
+ - `comment`
1172
+ - `ctime`
1173
+ - `gid`
1174
+ - `gname`
1175
+ - `linkpath`
1176
+ - `mtime`
1177
+ - `path`
1178
+ - `size`
1179
+ - `uid`
1180
+ - `uname`
1181
+ - `dev`
1182
+ - `ino`
1183
+ - `nlink`
1184
+
1185
+ #### constructor(object, global)
1186
+
1187
+ Set the fields set in the object. `global` is a boolean that defaults
1188
+ to false.
1189
+
1190
+ #### encode()
1191
+
1192
+ Return a Buffer containing the header and body for the Pax extended
1193
+ header entry, or `null` if there is nothing to encode.
1194
+
1195
+ #### encodeBody()
1196
+
1197
+ Return a string representing the body of the pax extended header
1198
+ entry.
1199
+
1200
+ #### encodeField(fieldName)
1201
+
1202
+ Return a string representing the key/value encoding for the specified
1203
+ fieldName, or `''` if the field is unset.
1204
+
1205
+ ### tar.Pax.parse(string, extended, global)
1206
+
1207
+ Return a new Pax object created by parsing the contents of the string
1208
+ provided.
1209
+
1210
+ If the `extended` object is set, then also add the fields from that
1211
+ object. (This is necessary because multiple metadata entries can
1212
+ occur in sequence.)
1213
+
1214
+ ### tar.types
1215
+
1216
+ A translation table for the `type` field in tar headers.
1217
+
1218
+ #### tar.types.name.get(code)
1219
+
1220
+ Get the human-readable name for a given alphanumeric code.
1221
+
1222
+ #### tar.types.code.get(name)
1223
+
1224
+ Get the alphanumeric code for a given human-readable name.