@vbarbarosh/node-helpers 3.32.0 → 3.34.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.32.0",
5
+ "version": "3.34.0",
6
6
  "description": "A set of helpers for JavaScript/Node.js",
7
7
  "files": [
8
8
  "src"
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @link https://stackoverflow.com/a/6969486/23502239
3
+ */
4
+ function escape_regexp(s)
5
+ {
6
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
7
+ }
8
+
9
+ module.exports = escape_regexp;
@@ -0,0 +1,9 @@
1
+ const shell = require('./shell');
2
+
3
+ async function shell_lines(args, options)
4
+ {
5
+ const s = await shell(args, options);
6
+ return s.trimEnd().split('\n');
7
+ }
8
+
9
+ module.exports = shell_lines;
@@ -0,0 +1,8 @@
1
+ const shell = require('./shell');
2
+
3
+ async function shell_thru(args, options)
4
+ {
5
+ return shell(args, {stdio: 'inherit', ...options});
6
+ }
7
+
8
+ module.exports = shell_thru;