@jdeighan/coffee-utils 4.1.2 → 4.1.3

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jdeighan/coffee-utils",
3
3
  "type": "module",
4
- "version": "4.1.2",
4
+ "version": "4.1.3",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -42,6 +42,7 @@
42
42
  "dependencies": {
43
43
  "ava": "^3.15.0",
44
44
  "cross-env": "^7.0.3",
45
- "js-yaml": "^4.1.0"
45
+ "js-yaml": "^4.1.0",
46
+ "readline-sync": "^1.4.10"
46
47
  }
47
48
  }
@@ -1,5 +1,6 @@
1
1
  # coffee_utils.coffee
2
2
 
3
+ import getline from 'readline-sync'
3
4
  import {log} from '@jdeighan/coffee-utils/log'
4
5
 
5
6
  export sep_dash = '-'.repeat(42)
@@ -212,9 +213,9 @@ export warn = (message) ->
212
213
  # say - print to the console (for now)
213
214
  # later, on a web page, call alert(str)
214
215
 
215
- export say = (str, obj=undef) ->
216
+ export say = (str) ->
216
217
 
217
- log str, obj
218
+ console.log str
218
219
  return
219
220
 
220
221
  # ---------------------------------------------------------------------------
@@ -223,7 +224,8 @@ export say = (str, obj=undef) ->
223
224
 
224
225
  export ask = (prompt) ->
225
226
 
226
- return 'yes'
227
+ answer = getline.question("{prompt}? ")
228
+ return answer
227
229
 
228
230
  # ---------------------------------------------------------------------------
229
231
 
@@ -2,6 +2,8 @@
2
2
  // coffee_utils.coffee
3
3
  var commentRegExp;
4
4
 
5
+ import getline from 'readline-sync';
6
+
5
7
  import {
6
8
  log
7
9
  } from '@jdeighan/coffee-utils/log';
@@ -217,15 +219,17 @@ export var warn = function(message) {
217
219
  // ---------------------------------------------------------------------------
218
220
  // say - print to the console (for now)
219
221
  // later, on a web page, call alert(str)
220
- export var say = function(str, obj = undef) {
221
- log(str, obj);
222
+ export var say = function(str) {
223
+ console.log(str);
222
224
  };
223
225
 
224
226
  // ---------------------------------------------------------------------------
225
227
  // ask - ask a question
226
228
  // later, on a web page, prompt the user for answer to question
227
229
  export var ask = function(prompt) {
228
- return 'yes';
230
+ var answer;
231
+ answer = getline.question("{prompt}? ");
232
+ return answer;
229
233
  };
230
234
 
231
235
  // ---------------------------------------------------------------------------
@@ -23,7 +23,7 @@ lDebugStack = []
23
23
  # --- These are saved/restored in lDebugStack
24
24
  export debugging = false
25
25
  ifMatches = undef
26
- lDebugFuncs = undef
26
+ lDebugFuncs = undef # --- names of functions to debug
27
27
 
28
28
  stdLogger = false
29
29
 
@@ -51,7 +51,7 @@ export var debugging = false;
51
51
 
52
52
  ifMatches = undef;
53
53
 
54
- lDebugFuncs = undef;
54
+ lDebugFuncs = undef; // --- names of functions to debug
55
55
 
56
56
  stdLogger = false;
57
57