Who doesn't like boxes? Especially if there's something nice hidden in the box! Today we'll look at a tiny library that adds a box to any text: boxen.
As usual, install it with e.g. deno add npm:boxen
and create a file, e.g. main.ts
:
import boxen from "boxen";
console.log(boxen("Happy Holidays!", { padding: 1 }));
And when you run it with deno run -A ./main.ts
you should be able to see something like that:
There are some styling options you could apply, e.g. double
or round
borders and different color. Or, if you're up for it you could try and do something like that:
import boxen from "boxen";
console.log(
boxen(
boxen(
boxen("Happy Holidays!", {
padding: 1,
borderStyle: "round",
borderColor: "greenBright",
}),
{
padding: 1,
borderStyle: "round",
borderColor: "yellowBright",
}
),
{
padding: 1,
borderStyle: "round",
borderColor: "redBright",
}
)
);
And get something like this:
Liked the content and would love to have more of it all year long?
Top comments (3)
This is a really fun little series.
Thank you so much! Glad you liked it!
Great.