-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathwrap-ansi.node.txt
21 lines (18 loc) · 1.3 KB
/
wrap-ansi.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
┏━━━━━━━━━━━━━━━┓
┃ WRAP-ANSI ┃
┗━━━━━━━━━━━━━━━┛
VERSION ==> #9.0.0
WRAP-ANSI(STR, NUM[, OPTS])->STR #Wrap STR for NUM columns, using same logic as STRING-WIDTH
#OPTS:
# - wordWrap BOOL:
# - If true (def), only break on space (not other whitespaces).
# - If false, break on any characters.
# - hard BOOL (def: false): if true, also break after NUM characters if no spaces before that
# - trim BOOL (def: true): trim whitespaces at start|end
#Uses STRING-WIDTH (see their doc), i.e. handles:
# - control characters
# - ANSI sequences
# - Unicode combining characters, emoji and >=U-10000
# - fullwidth code points
#Also handles:
# - Windows newlines (convert to Unix)