Skip to content

Commit 35bd1e2

Browse files
committedNov 4, 2021
Update Dependencies
1 parent 69968d4 commit 35bd1e2

File tree

4 files changed

+1869
-1149
lines changed

4 files changed

+1869
-1149
lines changed
 

‎docs/index.html

+370-182
Large diffs are not rendered by default.

‎package-lock.json

+1,481-961
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎readme.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,28 @@ As `outStream` was specified, wrapped output is written directly to the stream.
5959

6060
### Images
6161

62+
If your terminal suppots them, you can add images into the wrapped output ste
63+
6264
```js
6365
import {truwrap, createImage} from '@thebespokepixel/truwrap'
6466

6567
const image = createImage({
6668
name: 'test',
6769
file: join(dirname(fileURLToPath(import.meta.url)), '../media/test.png'),
68-
height: 1,
70+
width: 'auto', // Number of chars wide you'd like image. 'auto' to take it from the image/set height.
71+
height: 1, // Number of lines the image will take
72+
space: ' ' // A text string that is printed under the image so you can flow the wrapped text around it.
6973
})
7074

7175
var renderer = truwrap({
7276
mode: 'container'
7377
})
7478

7579
truwrap.write(image.render({
76-
nobreak: false,
77-
align: 1
80+
nobreak: true, // Don't add a linebreak after the image.
81+
stretch: false, // If true, distort the image the image to fit the width/height
82+
align: 1 // How many lines to move back up after printing the image.
83+
spacing: ' ' // A string to print after realigning the cursor after printing the image.
7884
}))
7985

8086
console.log(truwrap.end())

‎src/docs/example.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,28 @@ As `outStream` was specified, wrapped output is written directly to the stream.
2424

2525
### Images
2626

27+
If your terminal suppots them, you can add images into the wrapped output ste
28+
2729
```js
2830
import {truwrap, createImage} from '@thebespokepixel/truwrap'
2931

3032
const image = createImage({
3133
name: 'test',
3234
file: join(dirname(fileURLToPath(import.meta.url)), '../media/test.png'),
33-
height: 1,
35+
width: 'auto', // Number of chars wide you'd like image. 'auto' to take it from the image/set height.
36+
height: 1, // Number of lines the image will take
37+
space: ' ' // A text string that is printed under the image so you can flow the wrapped text around it.
3438
})
3539

3640
var renderer = truwrap({
3741
mode: 'container'
3842
})
3943

4044
truwrap.write(image.render({
41-
nobreak: false,
42-
align: 1
45+
nobreak: true, // Don't add a linebreak after the image.
46+
stretch: false, // If true, distort the image the image to fit the width/height
47+
align: 1 // How many lines to move back up after printing the image.
48+
spacing: ' ' // A string to print after realigning the cursor after printing the image.
4349
}))
4450

4551
console.log(truwrap.end())

0 commit comments

Comments
 (0)
Please sign in to comment.