Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

Commit b50b61d

Browse files
cncoldergeowarin
authored andcommitted
replace string-length with string-width (#45)
this pr fix #43
1 parent c8c4f3e commit b50b61d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
"dependencies": {
4343
"chalk": "^1.1.3",
4444
"error-stack-parser": "^2.0.0",
45-
"string-length": "^1.0.1"
45+
"string-width": "^2.0.0"
4646
}
4747
}

src/output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const colors = require('./utils/colors');
44
const chalk = require('chalk');
5-
const stringLength = require('string-length');
5+
const stringWidth = require('string-width');
66
const readline = require('readline');
77

88
class Debugger {
@@ -64,7 +64,7 @@ class Debugger {
6464
}
6565

6666
// Make timestamp appear at the end of the line
67-
let logSpace = process.stdout.columns - stringLength(message) - stringLength(dateString)
67+
let logSpace = process.stdout.columns - stringWidth(message) - stringWidth(dateString)
6868
if (logSpace <= 0) {
6969
logSpace = 10
7070
}

0 commit comments

Comments
 (0)