@vbarbarosh/node-helpers 3.64.0 → 3.65.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.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Vladimir Barbarosh <vladimir.barbarosh@gmail.com>",
3
3
  "license": "MIT",
4
4
  "name": "@vbarbarosh/node-helpers",
5
- "version": "3.64.0",
5
+ "version": "3.65.0",
6
6
  "description": "A set of helpers for JavaScript/Node.js",
7
7
  "unpkg": "dist/browser.js",
8
8
  "jsdelivr": "dist/browser.js",
package/src/fs_rmrf.js CHANGED
@@ -1,14 +1,15 @@
1
1
  const Promise = require('bluebird');
2
2
  const fs_lstat = require('./fs_lstat');
3
- const fs_path_resolve = require('./fs_path_resolve');
3
+ const fs_path_join = require('./fs_path_join');
4
4
  const fs_readdir = require('./fs_readdir');
5
5
  const fs_rm = require('./fs_rm');
6
6
  const fs_rmdir = require('./fs_rmdir');
7
+ const ignore = require('./ignore');
7
8
 
8
9
  /**
9
10
  * Remove a file or directory, along with all nested files and directories, recursively.
10
11
  */
11
- async function fs_rmrf(path)
12
+ async function fs_rmrf(path, progress = ignore)
12
13
  {
13
14
  const lstat = await fs_lstat(path).catch(() => null);
14
15
  if (lstat === null) {
@@ -17,10 +18,12 @@ async function fs_rmrf(path)
17
18
 
18
19
  if (lstat.isDirectory()) {
19
20
  const names = await fs_readdir(path);
20
- await Promise.all(names.map(v => fs_rmrf(fs_path_resolve(path, v))));
21
+ await Promise.all(names.map(v => fs_rmrf(fs_path_join(path, v), progress)));
22
+ progress('rmdir', path);
21
23
  await fs_rmdir(path);
22
24
  }
23
25
  else {
26
+ progress('rm', path);
24
27
  await fs_rm(path);
25
28
  }
26
29
  }
@@ -4,6 +4,7 @@ const stream = require('stream');
4
4
  const stream_curl_progress = require('./stream_curl_progress');
5
5
  const stream_each = require('./stream_each');
6
6
 
7
+ // 🦋 TODO ...options
7
8
  async function shell_curl_progress(args, {options, user_friendly_status})
8
9
  {
9
10
  // $ man curl