-
Notifications
You must be signed in to change notification settings - Fork 16
/
cli-truncate.node.txt
19 lines (14 loc) · 1.84 KB
/
cli-truncate.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CLI-TRUNCATE
VERSION ==> #4.0.0
CLI-TRUNCATE(STR, NUM[, OPTS]) #Truncate at NUM characters. When truncating, add OPTS.truncationCharacter (def: '…')
->STR #OPTS:
# - position 'start', 'middle' or 'end' (def)
# - space BOOL (def: false): add a space next to ellipsis.
# - preferTruncationOnSpace BOOL (def: false): truncate on space if within 3 characters
#Using SLICE-ANSI + STRING-WIDTH (see their doc), handles:
# - control characters
# - ANSI sequences
# - Unicode combining characters, emoji and >=U-10000
# - fullwidth code points