File tree Expand file tree Collapse file tree 3 files changed +57
-1
lines changed
Expand file tree Collapse file tree 3 files changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,34 @@ bun add @flex-development/string-wrap
8181
8282## Use
8383
84- ** TODO** : use
84+ ``` js
85+ import c from ' @flex-development/colors'
86+ import wrap from ' @flex-development/string-wrap'
87+
88+ /**
89+ * The string to wrap.
90+ *
91+ * @type {string}
92+ * @const string
93+ */
94+ const string = ` The ${ c .bold (c .italic (' quick' ))} brown ` +
95+ c .red (' 🦊 jumped over ' ) +
96+ ' the ' +
97+ c .bold (' lazy ' ) +
98+ c .green (' 🐶 and then ran away with the 🦄.' )
99+
100+ /**
101+ * The number of columns to wrap the string to.
102+ *
103+ * @type {number}
104+ * @const columns
105+ */
106+ const columns = 8
107+
108+ console .log (wrap (string, columns, { indent: 2 }))
109+ ```
110+
111+ <img alt =" preview " src =" ./preview.png " width =" 100 " />
85112
86113## API
87114
Original file line number Diff line number Diff line change 1+ /**
2+ * @file example
3+ * @module example
4+ */
5+
6+ import c from '@flex-development/colors'
7+ import wrap from '@flex-development/string-wrap'
8+
9+ /**
10+ * The string to wrap.
11+ *
12+ * @type {string }
13+ * @const string
14+ */
15+ const string = `The ${ c . bold ( c . italic ( 'quick' ) ) } brown ` +
16+ c . red ( '🦊 jumped over ' ) +
17+ 'the ' +
18+ c . bold ( 'lazy ' ) +
19+ c . green ( '🐶 and then ran away with the 🦄.' )
20+
21+ /**
22+ * The number of columns to wrap the string to.
23+ *
24+ * @type {number }
25+ * @const columns
26+ */
27+ const columns = 8
28+
29+ console . log ( wrap ( string , columns , { indent : 2 } ) )
You can’t perform that action at this time.
0 commit comments