bare-console 4.0.0 → 4.0.1
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/index.js +5 -5
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -19,11 +19,11 @@ module.exports = class Console {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
log (...args) {
|
|
22
|
-
this._stdout.write(formatArgs(args) + '\n')
|
|
22
|
+
this._stdout.write(formatArgs(args, { colors: this._colors }) + '\n')
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
error (...args) {
|
|
26
|
-
this._stderr.write(formatArgs(args) + '\n')
|
|
26
|
+
this._stderr.write(formatArgs(args, { colors: this._colors }) + '\n')
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
time (label = 'default') {
|
|
@@ -52,7 +52,7 @@ module.exports = class Console {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
trace (...args) {
|
|
55
|
-
const err = { name: 'Trace', message: formatArgs(args) }
|
|
55
|
+
const err = { name: 'Trace', message: formatArgs(args, { colors: this._colors }) }
|
|
56
56
|
Error.captureStackTrace(err, this.trace)
|
|
57
57
|
this.error(err.stack)
|
|
58
58
|
}
|
|
@@ -62,7 +62,7 @@ function adaptStream (stream) {
|
|
|
62
62
|
return typeof stream === 'function' ? { write: stream } : stream
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function formatArgs (args) {
|
|
65
|
+
function formatArgs (args, opts) {
|
|
66
66
|
let out = ''
|
|
67
67
|
let first = true
|
|
68
68
|
|
|
@@ -70,7 +70,7 @@ function formatArgs (args) {
|
|
|
70
70
|
if (first) first = false
|
|
71
71
|
else out += ' '
|
|
72
72
|
|
|
73
|
-
out += typeof arg === 'string' ? arg : inspect(arg,
|
|
73
|
+
out += typeof arg === 'string' ? arg : inspect(arg, opts)
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
return out
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bare-console",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Simple debugging console for JavaScript",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/holepunchto/bare-console.git"
|
|
14
|
+
"url": "git+https://github.com/holepunchto/bare-console.git"
|
|
15
15
|
},
|
|
16
16
|
"author": "Holepunch",
|
|
17
17
|
"license": "Apache-2.0",
|