@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 +3 -2
- package/src/coffee_utils.coffee +5 -3
- package/src/coffee_utils.js +7 -3
- package/src/debug_utils.coffee +1 -1
- package/src/debug_utils.js +1 -1
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jdeighan/coffee-utils",
|
3
3
|
"type": "module",
|
4
|
-
"version": "4.1.
|
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
|
}
|
package/src/coffee_utils.coffee
CHANGED
@@ -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
|
216
|
+
export say = (str) ->
|
216
217
|
|
217
|
-
log str
|
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
|
-
|
227
|
+
answer = getline.question("{prompt}? ")
|
228
|
+
return answer
|
227
229
|
|
228
230
|
# ---------------------------------------------------------------------------
|
229
231
|
|
package/src/coffee_utils.js
CHANGED
@@ -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
|
221
|
-
log(str
|
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
|
-
|
230
|
+
var answer;
|
231
|
+
answer = getline.question("{prompt}? ");
|
232
|
+
return answer;
|
229
233
|
};
|
230
234
|
|
231
235
|
// ---------------------------------------------------------------------------
|
package/src/debug_utils.coffee
CHANGED