Skip to content

Commit 7a2bab8

Browse files
committed
docs: use
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 85e6ebc commit 7a2bab8

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff 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

example.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 }))

preview.png

13.1 KB
Loading

0 commit comments

Comments
 (0)