bare-console 4.0.0 → 4.1.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.
Files changed (2) hide show
  1. package/index.js +5 -5
  2. package/package.json +5 -4
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, { colors: this._colors })
73
+ out += typeof arg === 'string' ? arg : inspect(arg, opts)
74
74
  }
75
75
 
76
76
  return out
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "bare-console",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Simple debugging console for JavaScript",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "index.js"
8
8
  ],
9
9
  "scripts": {
10
- "test": "standard && brittle test.js"
10
+ "test": "standard && bare test.js"
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",
@@ -20,8 +20,9 @@
20
20
  },
21
21
  "homepage": "https://github.com/holepunchto/bare-console#readme",
22
22
  "dependencies": {
23
+ "bare-events": "^2.2.0",
23
24
  "bare-hrtime": "^2.0.0",
24
- "bare-inspect": "^1.1.0"
25
+ "bare-inspect": "^2.0.0"
25
26
  },
26
27
  "devDependencies": {
27
28
  "brittle": "^3.1.1",