@jdeighan/coffee-utils 4.1.18 → 4.1.19

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jdeighan/coffee-utils",
3
3
  "type": "module",
4
- "version": "4.1.18",
4
+ "version": "4.1.19",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -1,12 +1,24 @@
1
1
  # coffee_utils.coffee
2
2
 
3
3
  import getline from 'readline-sync'
4
+ import {execSync} from 'child_process'
5
+
4
6
  import {log} from '@jdeighan/coffee-utils/log'
5
7
 
6
8
  export sep_dash = '-'.repeat(42)
7
9
  export sep_eq = '='.repeat(42)
8
10
  `export const undef = undefined`
9
11
 
12
+ # ---------------------------------------------------------------------------
13
+ # exec - run external commands
14
+
15
+ export exec = (cmd) ->
16
+
17
+ buffer = execSync cmd, {
18
+ windowsHide: true
19
+ }
20
+ return buffer.toString()
21
+
10
22
  # ---------------------------------------------------------------------------
11
23
  # pass - do nothing
12
24
 
@@ -4,6 +4,10 @@ var commentRegExp;
4
4
 
5
5
  import getline from 'readline-sync';
6
6
 
7
+ import {
8
+ execSync
9
+ } from 'child_process';
10
+
7
11
  import {
8
12
  log
9
13
  } from '@jdeighan/coffee-utils/log';
@@ -14,6 +18,16 @@ export var sep_eq = '='.repeat(42);
14
18
 
15
19
  export const undef = undefined;
16
20
 
21
+ // ---------------------------------------------------------------------------
22
+ // exec - run external commands
23
+ export var exec = function(cmd) {
24
+ var buffer;
25
+ buffer = execSync(cmd, {
26
+ windowsHide: true
27
+ });
28
+ return buffer.toString();
29
+ };
30
+
17
31
  // ---------------------------------------------------------------------------
18
32
  // pass - do nothing
19
33
  export var pass = function() {};