UNPKG
full-width-of-terminal
Version:
latest (2.1.0)
2.1.0
2.0.0
1.1.2
1.1.1
1.1.0
1.0.0
0.1.0
0.0.3
0.0.2
0.0.1
The string is displayed on the full width of the terminal.
full-width-of-terminal
/
build
/
index.js
11 lines
(7 loc)
•
245 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
//
'use strict'
const
columns =
require
(
'./columns'
).
getColumns
()
exports
.
getStringFullWidthOfTerminal
=
(
str =
'-'
) =>
{
const
size =
Math
.
ceil
(columns / str.
length
)
return
str.
repeat
(size +
1
).
substr
(
0
, columns) }